Category
enhancement · php-in-php / runtime-shrink · Pillar 1 (Trust) · #32122 class
Problem
Type\HashTable::implement() still always emits locale/natural/multisort LLVM (__hashtable__sortStringKeysLocale, __hashtable__sortStringKeyValuesLocale, __hashtable__sort*Natural*, __multisort__packed). Those bodies call ensureStrcollAbis / ensureNaturalCompareAbis, so every AOT compile (including hello-world) NestedJITs strcoll/strnatcmp during HashTable init.
#35626 only moved the ensureLinked call off implement() entry; the sort implement* methods still run at init. Leftover NestedJIT vs Runtime ABI drift mints strcoll.1 / strnatcmp.1 (Module.php:180 — #31894 / #32122).
| Repro |
Zend 8.2+ |
AOT today |
<?php echo "hi\n"; |
n/a |
HashTable init NestedJITs locale/natural/multisort + strcoll |
php-src reference
PHP implementation target
lib/JIT/Builtin/Type/HashTable.php — do not registerFn/implement* locale/natural/multisort at type init; ensureSortAbi() register+implement on first lookup
lib/JIT/Builtin/KeySortRuntime.php / ValueSortRuntime.php / NaturalSortRuntime.php / MultisortRuntime.php — call ensureSortAbi for the ABI in use only
- No new
lib/AOT/runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/hello.bin /tmp/hello.php'
Hello-world IR must not contain __hashtable__sortStringKeysLocale / strcoll from HashTable init.
Done when
Category
enhancement· php-in-php / runtime-shrink · Pillar 1 (Trust) · #32122 classProblem
Type\HashTable::implement()still always emits locale/natural/multisort LLVM (__hashtable__sortStringKeysLocale,__hashtable__sortStringKeyValuesLocale,__hashtable__sort*Natural*,__multisort__packed). Those bodies callensureStrcollAbis/ensureNaturalCompareAbis, so every AOT compile (including hello-world) NestedJITsstrcoll/strnatcmpduring HashTable init.#35626 only moved the
ensureLinkedcall offimplement()entry; the sortimplement*methods still run at init. Leftover NestedJIT vs Runtime ABI drift mintsstrcoll.1/strnatcmp.1(Module.php:180— #31894 / #32122).<?php echo "hi\n";php-src reference
ext/standard/array.c—php_array_ksort/php_natsort/php_array_multisortext/standard/string.c—php_strcoll/strnatcmpPHP implementation target
lib/JIT/Builtin/Type/HashTable.php— do notregisterFn/implement*locale/natural/multisort at type init;ensureSortAbi()register+implement on first lookuplib/JIT/Builtin/KeySortRuntime.php/ValueSortRuntime.php/NaturalSortRuntime.php/MultisortRuntime.php— callensureSortAbifor the ABI in use onlylib/AOT/runtime/*.cRepro
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/hello.bin /tmp/hello.php'Hello-world IR must not contain
__hashtable__sortStringKeysLocale/strcollfrom HashTable init.Done when
./script/aot-smoke.shstays 8/8