Skip to content

php-in-php: JIT IncludePathRuntime → IncludePathJitHelper PHP (#9245) - #10789

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-include-path-9245
Jun 23, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-include-path-9245

Conversation

@PurHur

@PurHur PurHur commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace phpc_include_path_* LLVM globals + ~350-line libc access/realpath resolve loop in IncludePathRuntime.php with thin bridges into compiled PHP helpers.
  • Add IncludePathJitHelper (NUL-delimited stack) and IncludePathResolveJitHelper (Zend parity via ScriptStack/VmStatPath; JIT path uses is_file/realpath).
  • VmIncludePath and VmFs::resolveIncludePath() delegate to the helpers so VM + JIT share storage.

Closes #9245

C runtime shrink

Removed from lib/JIT/Builtin/IncludePathRuntime.php
phpc_include_path_depth / phpc_include_path_current / phpc_include_path_stack LLVM globals
implementGlobals, implementInitDefaultPath, full LLVM implementResolve (access/realpath/memcpy loop)
libc externals: access, realpath, strchr, memcpy for include_path

php-src reference

  • ext/standard/basic_functions.c — php_get_include_path / php_set_include_path
  • ext/standard/streams.c — php_stream_resolve_include_path

Verification

./script/docker-exec.sh php vendor/bin/phpunit --filter 'IncludePathRuntime|StreamResolveIncludePath'
# OK (7 tests, 29 assertions)

./script/docker-exec.sh php vendor/bin/phpunit --filter 'JITTest::testCases.*stream_resolve_include_path_jit'
# OK

./script/docker-exec.sh bash -c 'php bin/vm.php test/repro/include_path_9245.php && php bin/jit.php test/repro/include_path_9245.php'
# true / true / false (both engines)

Made with Cursor

Replace phpc_include_path_* LLVM globals and libc resolve loop with compiled
PHP stack/resolve helpers; VmIncludePath and VmFs delegate to shared storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 8b61ef2 into master Jun 23, 2026
@PurHur
PurHur deleted the agent/runtime-php-include-path-9245 branch June 23, 2026 11:44
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 IncludePathRuntime — route include_path builtins through VmFs PHP not LLVM globals (#1492)

1 participant