Optimize Value equality and abstract equality checks in runtime - #1673
Merged
Merged
Conversation
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
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.