Skip to content

php-in-php: drop Type::initialize always-on openssl/hash/json/libcrypt/password/random_bytes ensureLinked — lazy Jit* ABI (peer #34327) #34332

Description

@PurHur

Category

php-in-php / runtime-shrink · cold-build surface · peer #34327 / Trust #32122

Problem

Type::initialize() on the non-STANDALONE path still eagerly NestedJITs openssl encrypt/sign/digest/pbkdf2, hash crypto (+ equals/algos), json encode/decode, libcrypt, password crypto/random_bytes, and StringRandomBytes even when the script never calls those builtins. Call sites already ensureLinked before lookup (or need a one-line JitRandomBytes ensureLinked).

php-src reference

PHP implementation target

  • lib/JIT/Builtin/Type.php — remove eager ensureLinked for listed runtimes
  • ext/standard/JitRandomBytes.php — StringRandomBytes::ensureLinked before lookup (gap vs other Jit* owners)
  • Update TypeDead*StillEnsureLinks* guards for those ABIs to call-site ownership
  • Unit shrink test peer TypeDeadTypeInitializeLazyCryptoJsonRuntimeShrinkTest

Repro

./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc './script/cold-build-check.sh'

Done when

  • Type::initialize no longer eagerly ensureLinks listed crypto/json/password/random runtimes
  • openssl/hash/json/crypt/password/random_bytes still match Zend via call-site ensureLinked
  • ./script/aot-smoke.sh stays 8/8
  • cold-build-check ok
  • No new runtime/*.c

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 / JITbugSomething isn't workingimplementation-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