Skip to content

php-in-php: lazy Utf8Latin1/RewriteVars/Define/Strspn/FileGetContents/Readfile from ensureFullStandaloneBodies (Context.php) #35089

Description

@PurHur

Category

php-in-php · runtime-shrink · Pillar Trust (#32122 .1 mint class)

Problem

Context::ensureFullStandaloneBodies still eagerly NestedJITs stdlib ABIs during every full standalone init — peers already made these lazy on the minimal path (#34578) and on Type::initialize (#34474 / #34423):

  1. StringUtf8Latin1::ensureStandaloneBodies
  2. RewriteVarsRuntime::ensureStandaloneBodies
  3. DefineRuntime::ensureStandaloneBodies
  4. StringStrspn::ensureStandaloneBodies
  5. StringFileGetContents::ensureStandaloneBodies (comment cites BootstrapCompileSmokeM3Emit #15604 — that call site must ensureLinked before lookup)
  6. StringReadfile::ensureStandaloneBodies

Leftover Context NestedJIT vs Runtime ABI drift mints utf8_*.1 / define.1 / file_get_contents.1 / readfile.1 / strspn.1 (#31894 / #32122). Call sites already ensureLinked before lookup (JitUtf8Latin1 / JitDefine / JitFileGetContents / readfile.php / SpnJitLowering / RewriteVarsRuntime).

php-src reference

PHP implementation target

  • lib/JIT/Context.php — drop always-on NestedJIT from ensureFullStandaloneBodies
  • lib/JIT/BootstrapCompileSmokeM3Emit.phpStringFileGetContents::ensureLinked before __compiler_file_get_contents lookup
  • Unit shrink guards mirroring ContextFullStandaloneLazyStreamRuntimeShrinkTest / ContextMinimalStandaloneLazyStdlibRuntimeShrinkTest

Done when

  • ensureFullStandaloneBodies does not call the six ensures above
  • ./script/aot-smoke.sh stays 8/8
  • Targeted ./script/phpunit.sh --filter ContextFullStandaloneLazyStdlib|ContextMinimalStandaloneLazyStdlib|ContextFullStandaloneLazyStream
  • No new runtime/*.c / lib/AOT/runtime/*.c

Parent

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions