Category
php-in-php · runtime-shrink (#1492, re-#20050 / #19362)
Problem
lib/JIT/Builtin/StringHashCryptoJit.php still gates the thin JitHashCryptoKernel path behind UserScriptAotDeferNestedJit::shouldDefer() (env PHP_COMPILER_AOT_USER_SCRIPT). On that deferred path it also emits hash_equals_deferred_stub that always returns 0 — so user-script AOT hash_equals() is permanently false.
#20050 / StringHashAlgos replaced the NestedJit defer gate with Context::isThinStandaloneAotMain() so bootstrap thin standalone and user-script AOT share one path without the NestedJit audit surface.
php-src reference
PHP implementation target
lib/JIT/Builtin/StringHashCryptoJit.php — replace UserScriptAotDeferNestedJit::shouldDefer with $context->isThinStandaloneAotMain(); thin → JitHashCryptoKernel + real StringHashEquals::ensureLinked (delete hash_equals_deferred_stub); embed/non-thin stays StringHashCryptoPhp / JitVmHelperLink
test/unit/StringHashCryptoRuntimeShrinkTest.php — assert no UserScriptAotDeferNestedJit; assert isThinStandaloneAotMain; assert no hash_equals_deferred_stub
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/StringHashCryptoRuntimeShrinkTest.php test/unit/StringHashEqualsRuntimeShrinkTest.php
vendor/bin/phpunit --filter HashEqualsBuiltinTest
make bootstrap-selfhost-vm-driver-execute-probe
'
Done when
Refs #1492, #20050, #19362, #10533
Category
php-in-php· runtime-shrink (#1492, re-#20050 / #19362)Problem
lib/JIT/Builtin/StringHashCryptoJit.phpstill gates the thinJitHashCryptoKernelpath behindUserScriptAotDeferNestedJit::shouldDefer()(envPHP_COMPILER_AOT_USER_SCRIPT). On that deferred path it also emitshash_equals_deferred_stubthat always returns 0 — so user-script AOThash_equals()is permanently false.#20050/StringHashAlgosreplaced the NestedJit defer gate withContext::isThinStandaloneAotMain()so bootstrap thin standalone and user-script AOT share one path without the NestedJit audit surface.php-src reference
PHP_FUNCTION(hash)/hash_equals/ HMAC / PBKDF2 / HKDFPHP implementation target
lib/JIT/Builtin/StringHashCryptoJit.php— replaceUserScriptAotDeferNestedJit::shouldDeferwith$context->isThinStandaloneAotMain(); thin →JitHashCryptoKernel+ realStringHashEquals::ensureLinked(deletehash_equals_deferred_stub); embed/non-thin staysStringHashCryptoPhp/JitVmHelperLinktest/unit/StringHashCryptoRuntimeShrinkTest.php— assert noUserScriptAotDeferNestedJit; assertisThinStandaloneAotMain; assert nohash_equals_deferred_stubRepro
Done when
UserScriptAotDeferNestedJitremoved fromStringHashCryptoJit.phpisThinStandaloneAotMain(php-in-php: delete StringHashAlgos/HmacAlgos NestedJit defer — thin standalone via JitHashAlgosKernel (re-#19355) #20050 / Rename shape)hash_equals_deferred_stubdeleted; thin path links realStringHashEqualsmake bootstrap-selfhost-vm-driver-execute-probegreenRefs #1492, #20050, #19362, #10533