Skip to content

php-in-php: JIT IncludePathRuntime — route include_path builtins through VmFs PHP not LLVM globals (#1492) #9245

Description

@PurHur

Category

php-in-php · JIT/AOT lowering migration

Problem

VM get_include_path() / set_include_path() / restore_include_path() / stream_resolve_include_path() use PHP builtins in ext/standard/ + lib/Web/IncludePathResolver.php.

JIT/AOT duplicates include-path stack semantics in lib/JIT/Builtin/IncludePathRuntime.php and lib/JIT/Builtin/Type.php (__compiler_get_include_path, __compiler_set_include_path, __compiler_restore_include_path, __compiler_stream_resolve_include_path, phpc_include_path_* LLVM globals).

This diverges from VM behavior and blocks shrinking the C/LLVM runtime per #1492.

php-src reference (semantics)

Repro

<?php
$old = get_include_path();
set_include_path($old . PATH_SEPARATOR . '/tmp');
var_export(str_contains(get_include_path(), '/tmp'));
echo "\n";
restore_include_path();
var_export(get_include_path() === $old);
echo "\n";
var_export(stream_resolve_include_path('compile_driver.php') !== false);
echo "\n";
php bin/vm.php repro_include_path.php
php bin/jit.php repro_include_path.php
Engine Expected
Zend true, true, bool per CWD
VM matches Zend
JIT today may diverge — uses IncludePathRuntime LLVM stack

Scope

Layer Path
Shrink lib/JIT/Builtin/IncludePathRuntime.php — delete LLVM stack impl
JIT Route through JitResolveIncludePath / builtin jit() on ext/standard/*include_path*.php
Shared lib/Web/IncludePathResolver.php — single SSOT for VM+JIT
AOT link PHP helpers, not phpc_include_path_* globals

Done when

  • JIT include_path builtins match VM/php-src on repro
  • stream_resolve_include_path() JIT uses same resolver as VM
  • PR cites lines removed from IncludePathRuntime.php / Type.php LLVM registrations
  • ./script/ci-fast.sh --filter include_path green (or add compliance guard)

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions