Repository navigation
Extend inline expr call-arg bridging for new expressions (#8561) - #8590
Merged
Merged
Conversation
Compile-time rewrite maps the if-entry ?string arm to null === $param ? null : $param (php-src equivalent) and tracks the JumpIf so branch targets stay aligned with IDENTICAL. Verification: php vendor/bin/phpunit test/unit/NullableNeNullTernaryRewriteTest.php test/unit/TernaryReturnMergeSlotTest.php php bin/vm.php test/repro/aot_ternary_ne_null.php PHP_COMPILER_BOOTSTRAP_AOT_LINK=1 php bin/compile.php -o /tmp/n test/repro/aot_ternary_ne_null.php && /tmp/n Co-authored-by: Cursor <cursoragent@cursor.com>
Return typed string operands directly from the if-entry arm instead of reading the shared phi VALUE box after merge-block dead-operand frees. Nullable/union if-arms keep per-arm RETURN from the phi slot; pure string params skip the box on the string arm only. Verification: - test/repro/ns_nullable_ternary_return.php AOT exit 0 (was segfault) - test/repro/aot_ternary_bool.php AOT exit 0 - test/repro/getenv_identical_false.php AOT prints yes - make bootstrap-aot-link still 16 failures (ns_func, ne_null, …) Co-authored-by: Cursor <cursoragent@cursor.com>
…8563). Rewrite direct and ternary returns of explicit ?T params to $param ?? null (php-src equivalent) so native AOT uses the proven coalesce VALUE-box path. Register nullable scalar returns as __value__* in JIT ABI; cherry-pick ?: merge lowering from #8555. Verification: php vendor/bin/phpunit test/unit/NullableNeNullTernaryRewriteTest.php test/unit/NullableStringReturnAbiTest.php PHP_COMPILER_BOOTSTRAP_AOT_LINK=1 php bin/compile.php -o /tmp/t test/repro/aot_ternary_ne_null.php && /tmp/t PHP_COMPILER_BOOTSTRAP_AOT_LINK=1 php bin/compile.php -o /tmp/t test/repro/aot_nullable_param_direct_return.php && /tmp/t Co-authored-by: Cursor <cursoragent@cursor.com>
php-cfg also splits Expr_New results from FuncCall/New ctor args; route TYPE_ARG_SEND through the producer slot directly to avoid AOT assign type mismatches. Unblocks const_string_folder bootstrap smokes. Co-authored-by: Cursor <cursoragent@cursor.com>
9 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
Expr_Newproducers andNew_ctor consumers (f(new C('x')),new C(['a'])).TYPE_ARG_SENDthrough the producer slot directly instead of emitting a cross-typeTYPE_ASSIGN, fixing AOT compile failure (Cannot assign operands of different types (yet): 134, 196) onconst_string_folder_func_call_args.php.php-src reference: N/A — compile-time CFG lowering (Zend
zend_compile.cemits a single temp; php-cfg splits producer/consumer).PHP implementation:
lib/Compiler.php(findInlineExprCallArgProducerSlot,compileCallArgSends).Verification
Closes #8561 (partial — M5 bootstrap-aot-link gate progress; remaining failures are unrelated stdlib/filesystem/hash smokes).
Made with Cursor