Skip to content

php-in-php: delete StringNaturalCompareJit LLVM — route strnatcmp/strnatcasecmp through NaturalCompareJitHelper PHP (#1492) #13535

Description

@PurHur

Category

php-in-php · compile-pipeline / self-host #1492

Problem

lib/JIT/Builtin/StringNaturalCompareJit.php (~365 LOC) embeds LLVM natural-order compare for strnatcmp/strnatcasecmp. VM semantics already live in ext/standard/VmString.php (strnatcmp / strnatcasecmp). C runtime deleted in #5517; LLVM monolith remains and blocks PHP-in-PHP.

php-src reference

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_dump(strnatcmp(\"img10\", \"img2\"));"
php bin/jit.php -r "var_dump(strnatcmp(\"img10\", \"img2\"));"'

Scope

Path Work
ext/standard/NaturalCompareJitHelper.php SSOT bridge calling VmString::strnatcmp/strnatcasecmp
lib/JIT/Builtin/StringStrnatcmp.php / StringStrnatcasecmp.php Thin ABI bridge (keep i8* signature for HashTable sort)
Delete lib/JIT/Builtin/StringNaturalCompareJit.php

Done when

  • JIT strnatcmp/strnatcasecmp match VM on repro
  • PR cites LLVM lines removed from StringNaturalCompareJit.php
  • vendor/bin/phpunit --filter NaturalCompare green
  • make bootstrap-selfhost-vm-driver-execute-probe OK

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