Skip to content

php-in-php: drop isThinStandaloneAotMain libc fork from StringRename — always JitVmHelperLink + RenameJitHelper (re-#20028) #20603

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, re-#20028 / #19186 unlink / #20589 var_export)

Problem

#20028 removed UserScriptAotDeferNestedJit from StringRename but replaced it with isThinStandaloneAotMain() → implementLibcBody / JitRenameKernel libc rename(2) LLVM (~50 LOC fork). Peer builtins already always NestedJIT the PHP helper: StringUnlink (#19186), StringVarExport (#20589). Thin AOT still bypasses RenameJitHelper warnings/stat-cache invalidation that embed gets.

Path Today Target
Embed / non-thin RenameJitHelper via ensureBridge unchanged
Thin standalone AOT JitRenameKernel libc body RenameJitHelper via ensureBridge
Nested leaf phpc_rename_kernel / JitRenameKernel keep (inside helper only)

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StringRename.php — always JitVmHelperLink::ensureBridge (drop implementLibcBody / isThinStandaloneAotMain / LIBC_ENTRY)
  • Keep JitRenameKernel + phpc_rename_kernel as NestedJIT leaf inside RenameJitHelper only
  • test/unit/RenameRuntimeShrinkTest.php — assert Unlink shape (no thin libc fork)
  • Mark /ext/standard/RenameJitHelper.php runtime_unsafe in emit-helper-runtime-object.php only if HELPER_RUNTIME_O unit.o is red (peer php-in-php: delete JitVarExportKernel — always JitVmHelperLink + VarExportJitHelper PHP (#1492) #20589)

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/RenameRuntimeShrinkTest.php
vendor/bin/phpunit test/unit/RenameBuiltinTest.php --filter testAotNativeBinaryMatchesPhpSubset
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • implementLibcBody / isThinStandaloneAotMain / rename_libc_entry gone from StringRename.php
  • Thin + embed both use RenameJitHelper via ensureBridge
  • RenameRuntimeShrinkTest + AOT RenameBuiltinTest green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed

Refs #1492, #20028, #19215, #19186, #20589, #10533

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 & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions