Skip to content

php-in-php: JIT ScalarDimFetchHelper → ScalarDimFetchJitHelper PHP (#10271) - #10282

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-scalar-dim-fetch-10271
Jun 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-scalar-dim-fetch-10271

Conversation

@PurHur

@PurHur PurHur commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route scalar ZEND_FETCH_DIM_R JIT warnings through compiled ScalarDimFetchJitHelper PHP via ScalarDimFetchRuntime instead of inline LLVM __compiler_trigger_error IR in ScalarDimFetchHelper.
  • Add ErrorReporter::arrayOffsetOnNonContainerMessage() as VM/JIT message SSOT (php-src: Zend/zend_execute.c).
  • Shrink lib/JIT/ScalarDimFetchHelper.php from 44 → 27 lines (removed emitArrayOffsetWarning() LLVM path).

C runtime shrink

No new runtime/*.c logic. Removed ~17 lines of inline LLVM warning emission from ScalarDimFetchHelper.php.

Verification

make bootstrap-selfhost-vm-driver-execute-probe
# bootstrap-selfhost-vm-driver-execute-probe: OK

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "\$x=42; var_export(\$x[0]); echo \"\\n\";" 2>&1 | head -3
php bin/vm.php -r "\$x=42; var_export(\$x[0]); echo \"\\n\";" 2>&1 | head -3
php bin/jit.php -r "\$x=42; var_export(\$x[0]); echo \"\\n\";" 2>&1 | head -5
'
# PHP Warning: Trying to access array offset on value of type int
# NULL (VM + JIT)

vendor/bin/phpunit --filter ScalarDimFetchJitHelperTest
# OK (1 test, 4 assertions)

vendor/bin/phpunit --filter "DimFetch|array_offset_scalar|dim_fetch_null"
# OK (9 tests, 14 assertions)

php script/check-selfhost-spine-coverage-sync.php
# OK

Closes #10271

Made with Cursor

…hJitHelper (#10271)

Move ZEND_FETCH_DIM_R scalar warning message SSOT into VM PHP and compile it
for JIT/AOT via ScalarDimFetchRuntime, shrinking ScalarDimFetchHelper to a
thin trampoline that no longer emits inline __compiler_trigger_error IR.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit bdf1a1e into master Jun 20, 2026
@PurHur
PurHur deleted the agent/runtime-php-scalar-dim-fetch-10271 branch June 20, 2026 03:28
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.

php-in-php: JIT ScalarDimFetchHelper — route scalar dim fetch warnings through Vm PHP not LLVM (#1492)

1 participant