Skip to content

Optimize Value equality and abstract equality checks in runtime - #1673

Merged
bwikbs merged 2 commits into
Samsung:masterfrom
ksh8281:perf2
Sep 18, 2026
Merged

bwikbs merged 2 commits into
Samsung:masterfrom
ksh8281:perf2

Conversation

@ksh8281

@ksh8281 ksh8281 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Optimizes equalsTo and abstractEqualsTo comparison paths across both
32-bit and 64-bit architectures to improve performance.

Introduces numberEqualsToSlowCase as a NEVER_INLINE out-of-line method.
Because floating-point comparison is the only part of the equality check
requiring FP registers, keeping it out of line prevents the compiler
from spilling and holding FP images of the operands across the entire
inlined equalsTo/abstractEqualsTo caller contexts.

For 32-bit architectures, re-implements the comparison paths to dispatch
directly on tag and payload halves. Identical bitwise representations
are quickly resolved with a cheap NaN check bypassing 64-bit stack
operations. This avoids expensive pointer-ness and double range checks
on common paths.

Additionally, introduces helper functions isNullishPayload, isNaNDouble,
and isNaNValueBits to perform fast, register-free double NaN and nullish
checks directly on raw bits.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
Fixes the toImpl overload for OptionalRef<ValueRef> to correctly
delegate to toImpl(const ValueRef* v) instead of creating a Value
directly from raw payload bits.

Directly invoking Value(EncodedValue::fromPayload(v.value())) bypasses
the type-safety checks and specific tag/payload wrapping logic provided
by the standard toImpl(const ValueRef*) conversion path. Routing through
toImpl ensures the value payload is properly adapted according to the
standard adaptation protocols defined in ValueAdapter.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
@bwikbs
bwikbs merged commit 9bb7469 into Samsung:master Sep 18, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants