Skip to content

php-in-php: drop UserScriptAotDeferNestedJit from MathNextafter/MathFpow — thin libc via isThinStandaloneAotMain (#1492) #20034

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, follow #20011 bin2hex / #20028 rename / #19259)

Problem

lib/JIT/Builtin/MathNextafter.php and MathFpow.php still gate user-script AOT through UserScriptAotDeferNestedJit::shouldDefer() → JitNextafterKernel / JitFpowKernel. #20011 / #20028 proved the same thin path can use Context::isThinStandaloneAotMain() (no defer class) while embed keeps JitVmHelperLink → *JitHelper PHP.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/MathNextafter.php — remove UserScriptAotDeferNestedJit; thin libc via isThinStandaloneAotMain() + JitNextafterKernel; else always JitVmHelperLink::ensureBridge → NextafterJitHelper
  • lib/JIT/Builtin/MathFpow.php — same shape for JitFpowKernel / FpowJitHelper
  • test/unit/NextafterRuntimeShrinkTest.php / FpowRuntimeShrinkTest.php — assert no defer class; thin kernel + helper bridge remain

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/NextafterRuntimeShrinkTest.php
vendor/bin/phpunit test/unit/FpowRuntimeShrinkTest.php
vendor/bin/phpunit test/aot/AotTest.php --filter "nextafter|fpow"
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • UserScriptAotDeferNestedJit removed from MathNextafter and MathFpow
  • Thin path uses isThinStandaloneAotMain() + kernel
  • Embed path still *JitHelper via JitVmHelperLink
  • Shrink unit tests + AOT nextafter/fpow fixtures green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed / defer gate deleted

Refs #1492, #19259, #20011, #20028, #15062, #15189

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