Stdlib: locale_lookup() JIT lowering via VmLocale helper (#32118) - #32174
Merged
Conversation
Replace the JIT-not-implemented throw with compile-time RFC 4647 fold and a NestedJIT helper so locale_lookup()/Locale::lookup() match VM/php-src. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
locale_lookup()JITRuntimeException(JIT lowering not implemented; use VM) with RFC 4647 lowering that matches VM/VmLocale::lookup()(php-srcext/intl/locale/locale_methods.c).LocaleLookupJitHelper::lookupArgv()via__phpc_jit_locale_lookup.Locale::lookup()(functionProxies['locale::lookup']). php-src-strict; no php-compiler-strict shortcut.Closes #32118
Test plan
./script/phpunit.sh --filter 'LocaleLookupJitShrinkTest|LocaleLookupJitCompileTest|LocaleLookupJit32118'.phptresult path, LLVM compile-only fold, helper SSOT./script/docker-exec.sh -- bash -lc 'php test/repro/issue_32118_locale_lookup_jit.php'lookup_pos=de/lookup_named=de/lookup_vars=de/lookup_fallback=en_US./script/docker-exec.sh -- bash -lc 'php test/repro/issue_25198_locale_lookup_named.php'$langtagmatch VM/Reflection stubsphp script/bootstrap-inventory.php --check→OK 7581/7581locale_lookup(this image:extension_loaded('intl')=0; AOT fixture SKIPIFs)Not covered:
check-selfhost-spine-coverage-syncis already red on master for 6 unrelated ldap/stream-include files (not this diff). Capability-matrix/syntax--checkalso drifted on master before this change; not regenerated.php-src:
ext/intl/locale/locale_methods.c,ext/intl/php_intl.stub.phpPHP:
ext/intl/JitLocaleLookup.php,ext/intl/LocaleLookupJitHelper.php,lib/JIT/Builtin/LocaleLookupRuntime.phpMade with Cursor