Skip to content

php-in-php: drop always-on LibcExtern/Module strrchr after StrrchrJitHelper (#31403/#31374 shape) #31458

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #31403 / #31374 / #30530)

Problem

User-script strrchr() already routes through StrrchrJitHelper + StringStrrchr (__phpc_jit_strrchr, #15406). Always-on LibcExtern + Module::jitInit still register libc strrchr for every compile — same dead always-on surface #31403 removed for stat/access/lstat.

Path Today Target
User-script AOT strrchr() StrrchrJitHelper / VmString::strrchr (already) unchanged
LibcExtern always-on strrchr drop row
Module::jitInit always-on try/add drop; comment #31403 peer
NestedJIT JitTempnamKernel ensureLibc already declares strrchr module-locally unchanged
ReflectionSetup::shortNameFromCstr lookupFunction relies on always-on ensureLibcStrrchr module-local

php-src reference

PHP implementation target

  • lib/JIT/LibcExtern.php — drop strrchr row; cite this issue
  • ext/standard/Module.php — drop always-on decl
  • lib/JIT/Builtin/ReflectionSetup.phpensureLibcStrrchr before shortNameFromCstr lookup
  • test/unit/LibcExternDeadDeclsRuntimeShrinkTest.php + ModuleAlwaysOnFsDeclsRuntimeShrinkTest.php — guard the drop

Repro

./script/phpunit.sh --filter LibcExternDeadDeclsRuntimeShrinkTest
./script/phpunit.sh --filter ModuleAlwaysOnFsDeclsRuntimeShrinkTest

Done when

  • strrchr absent from LibcExtern specs and Module::jitInit always-on decls
  • ReflectionSetup declares strrchr module-locally; JitTempnamKernel keep working
  • Shrink unit tests green
  • PR body cites LOC removed from always-on surface

Refs #1492, #31403, #31374, #30530, #15406

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