Skip to content

php-in-php: strcasecmp()/strncasecmp() JIT via CaseCompareJitHelper PHP — drop libc LLVM (#1492) #15225

Description

@PurHur

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

  • No direct libc strcasecmp/strncasecmp in ext JIT call paths after bridge install
  • VM/JIT match Zend; spine sync + bootstrap VM driver probe green

Refs north star #1492

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions