Skip to content

php-in-php: JIT StreamPathRuntime — route __phpc_stream_path through VmFs PHP not LLVM handle table (#1492) #9480

Description

@PurHur

Category

php-in-php · stdlib · streams / stat (#1492)

Problem

JIT/AOT fstat() and related stream path lookups use lib/JIT/Builtin/StreamPathRuntime.php LLVM that reads phpc_stream_handles[] / phpc_stream_paths[] globals. VM stream opens already record paths in ext/standard/VmFs.php / stream wrappers.

Duplicated path tables mean JIT fstat() can miss paths registered by VM fopen() and drift from php-src php_stream metadata behavior (#6764).

php-src reference

Repro

<?php
$p = sys_get_temp_dir() . '/phpc_stream_path_probe.txt';
file_put_contents($p, 'x');
$h = fopen($p, 'r');
var_export(fstat($h));
fclose($h);
@unlink($p);
./script/docker-exec.sh -- php bin/vm.php repro.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php repro.php'

Both must return a populated stat array for the same handle; JIT must not return false when VM succeeds.

Scope (this repo)

Layer Path
VM SSOT ext/standard/VmFs.php, VmPhpFdStream.php, stream resource metadata
LLVM today lib/JIT/Builtin/StreamPathRuntime.php, StreamGlobalsJit.php
Consumers JIT fstat lowering, clearstatcache path keys

Done when

  • JIT/AOT stream path resolution calls PHP VmFs/stream metadata (thin trampoline OK)
  • StreamPathRuntime.php deleted or stub; no parallel path globals in LLVM
  • ./script/ci-fast.sh --filter fstat green (VM + JIT)
  • PR notes LLVM lines removed (~166 today + global tables)

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 / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions