AOT: keep native long on int +/−/* hot path (#36189) - #36281
Merged
Conversation
binaryNativeLong no longer boxes every non-overflow result via __value__writeLong; overflow still promotes to double on a cold path with a flag for VALUE consumers. Verified: IntArithOverflowPromote31964AotTest + IntSubOverflowPromote32422AotTest 3/3, aot-smoke 9/9, north-star5-verify-fast OK. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/issue-36189-typed-int-native-long
branch
from
September 2, 2026 03:57
7f00c8b to
6b437e7
Compare
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::binaryNativeLongreturnsTYPE_NATIVE_LONGon the non-overflow path instead of boxing via__value__writeLongon everyint ⊙ intoperation (Perf: typed int arithmetic boxes every result since overflow promotion — fibo(30) 8x slower than the 2026-07-28 build (lib/JIT/JitLongArithOverflow.php) #36189).i1flag +materializeOverflowableNativeLong()hook inJitValueBox::valuePtrFromNativeVariablepreservesvar_dump/VALUE consumers.php-src reference
fast_long_add_function/ZEND_SIGNED_ADD_OVERFLOW: fast path staysIS_LONG, overflow materialises double.Verification
Not run this run:
script/differential-sweep.sh --aot --repeat 3, fibo wall-time benchmark refresh (benchmarks/README.md).Closes #36189
Made with Cursor