Skip to content

php-in-php: move PregMatchUserScriptLlvm stubs → JitPregMatchKernel in ext/standard (#1492) #19399

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, same pattern as #19389 htmlspecialchars / #19373 getenv / #19344 bin2hex)

Problem

lib/JIT/Builtin/PregMatchUserScriptLlvm.php still houses user-script AOT __compiler_preg_* stubs (~134 LOC) when UserScriptAotDeferNestedJit::shouldDefer(). Embed/full JIT already uses PregJitHelperVmPregNative.

Same #16075 nested-helper constraint as other kernels: deferred paths cannot nested-compile PregJitHelper reliably. Keep the thin stub kernels — but move them out of lib/JIT/Builtin/ into ext/standard/ so the JIT-builtin surface shrinks.

Also restores Pillar 1 trust: master spine is missing ext/sockets/socket_select.php after #19390 (north-star5-fast / release-readiness red).

php-src reference

PHP implementation target

  • ext/standard/JitPregMatchKernel.php — new: emit stubs moved from PregMatchUserScriptLlvm
  • lib/JIT/Builtin/PregMatchRuntime.php — defer → JitPregMatchKernel::implement
  • Delete lib/JIT/Builtin/PregMatchUserScriptLlvm.php
  • Update test/unit/PregMatchUserScriptLlvmTest.php / shrink tests + spine require list
  • Add missing ext/sockets/socket_select.php to spine (trust gate)
  • SSOT remains ext/standard/PregJitHelper.phpVmPregNative

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/PregMatchUserScriptLlvmTest.php test/unit/PregMatchRuntimeShrinkTest.php
php script/check-selfhost-spine-coverage-sync.php
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • PregMatchUserScriptLlvm.php deleted
  • User-script/deferred path uses JitPregMatchKernel in ext/standard/
  • PregMatch unit shrink tests green
  • php script/check-selfhost-spine-coverage-sync.php green (includes socket_select.php)
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites LOC moved out of lib/JIT/Builtin/

Refs #1492, #16075, #16734, #19389, #19373

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