Category
php-in-php · php-src-strict
Problem
strcasecmp()/strncasecmp() JIT still call libc via lookupFunction('strcasecmp'|'strncasecmp'); VM SSOT is VmString::strcasecmp() / VmString::strncasecmp(). Sibling strnatcmp()/strnatcasecmp() already use NaturalCompareJitHelper PHP bridges (#13535).
php-src reference
Repro
./script/docker-exec.sh -- php bin/vm.php -r 'var_export(strcasecmp("A","a"));'
./script/docker-exec.sh -- ./vendor/bin/phpunit --filter StrcasecmpRuntimeShrink
Scope
| Path |
Work |
ext/standard/CaseCompareJitHelper.php |
Delegate to VmString::* |
lib/JIT/Builtin/StringCaseCompare.php |
i8* bridge like StringNaturalCompare |
ext/standard/strcasecmp.php etc. |
ensureLinked + PHP bridge |
Done when
Refs north star #1492
Category
php-in-php· php-src-strictProblem
strcasecmp()/strncasecmp()JIT still call libc vialookupFunction('strcasecmp'|'strncasecmp'); VM SSOT isVmString::strcasecmp()/VmString::strncasecmp(). Siblingstrnatcmp()/strnatcasecmp()already useNaturalCompareJitHelperPHP bridges (#13535).php-src reference
PHP_FUNCTION(strcasecmp|strncasecmp)Repro
./script/docker-exec.sh -- php bin/vm.php -r 'var_export(strcasecmp("A","a"));' ./script/docker-exec.sh -- ./vendor/bin/phpunit --filter StrcasecmpRuntimeShrinkScope
ext/standard/CaseCompareJitHelper.phpVmString::*lib/JIT/Builtin/StringCaseCompare.phpStringNaturalCompareext/standard/strcasecmp.phpetc.ensureLinked+ PHP bridgeDone when
strcasecmp/strncasecmpin ext JIT call paths after bridge installRefs north star #1492