Perf: keep native-long +/−/* on TYPE_NATIVE_LONG hot path (#36189) - #36280
Merged
Conversation
binaryNativeLong() was boxing every result into __value__ after #31964, turning typed recursion (fibo_r) into ~400-instruction value dispatch. Restore direct i64 results for native-long pairs; literals still fold via tryFoldBinary and boxed operands still use writeBoxedBinary overflow paths. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
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.
Summary
JitLongArithOverflow::binaryNativeLong()no longer boxes every native-long+/-/*into__value__after AOT: integer overflow wraps instead of promoting to float — silent wrong arithmetic #31964TYPE_NATIVE_LONG(direct i64 SSA) — restores typed-recursion performance (fibo_rdisassembly has 0__value__*calls)tryFoldBinary; boxed operands still usewriteBoxedBinaryCloses #36189
Root cause
#31964 (#89867d206f) routed all native-long arithmetic through
writeBoxedBinary, forcing 7-way value dispatch on everyn-2/+infibo_r.Verification
Not covered
script/differential-sweep.sh --aot --repeat 3(not run this run — no lowering-shape change beyond native-long pair fast path)Made with Cursor