Skip to content

php-in-php: drop UserScriptAotDeferNestedJit from LocaleParser — always JitVmHelperLink + LocaleParserJitHelper (#1492) #20101

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, follow #20028 rename / #20086 StatPath / #17072 locale AOT)

Problem

lib/JIT/Builtin/LocaleParser.php still early-returns on UserScriptAotDeferNestedJit::shouldDefer() before JitVmHelperLink::ensureBridge. User-script / thin standalone AOT never links __phpc_jit_locale_get_* bridges for non-literal locales; embed already uses LocaleParserJitHelper → VmLocale.

#20028 proved the same helper can always route through JitVmHelperLink (NestedJIT of the PHP helper, with env clearing inside the link helper). Locale parsing is pure PHP string work — no libc kernel required.

Mode Today Target
Thin / user-script AOT shouldDefer → skip link JitVmHelperLink → LocaleParserJitHelper
Embed / non-thin LocaleParserJitHelper NestedJIT unchanged

php-src reference

PHP implementation target

  • lib/JIT/Builtin/LocaleParser.php — delete UserScriptAotDeferNestedJit import + early return; keep NestedJitCompileScope guard; always JitVmHelperLink::ensureBridge
  • test/unit/LocaleParserRuntimeShrinkTest.php — assert no UserScriptAotDeferNestedJit; bridge via JitVmHelperLink + LocaleParserJitHelper

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/LocaleParserRuntimeShrinkTest.php test/unit/LocaleParseTest.php test/unit/LocaleDefaultTest.php
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • UserScriptAotDeferNestedJit removed from LocaleParser.php
  • Always JitVmHelperLink + LocaleParserJitHelper for locale_get_* bridges
  • Shrink + Locale unit tests green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites defer gate deleted

Refs #1492, #17072, #20028, #20086

Activity

  1. added
    enhancementNew feature or request
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 17, 2026
  2. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run

    Trust gates (pre-claim):

    • bootstrap-inventory --check → OK 5448/5448
    • release-readiness --json → user_release_ready: yes (inventory/spine/readme/north-star5-fast/vm-driver-probe all ok)
    • First failing command: none (Pillar 1 green)

    Migrating LocaleParser NestedJit defer → always JitVmHelperLink + LocaleParserJitHelper.

  3. PurHur commented on Jul 17, 2026

    @PurHur
    OwnerAuthor

    Merged via #20103

    LocaleParser no longer early-returns on NestedJIT defer — user-script AOT links locale_get_* through JitVmHelperLink + LocaleParserJitHelper.

    Verify: shrink unit OK; PHP_COMPILER_PROFILE=8.4 user-script AOT dynamic → zh|CN|Hans; vm-driver-execute-probe OK.

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