Skip to content

Stdlib: locale_filter_matches() JIT lowering via VmLocale helper (#32119) - #32177

Merged
PurHur merged 2 commits into
masterfrom
agent/advanced-stdlib-32119-locale-filter-matches-jit
Aug 18, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/advanced-stdlib-32119-locale-filter-matches-jit

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace locale_filter_matches() JIT RuntimeException (JIT lowering not implemented; use VM) with prefix-filter lowering that matches VM/VmLocale::filterMatches() (php-src ext/intl/locale/locale_methods.c).
  • Compile-time fold when languageTag/locale/canonicalize are literals; otherwise NestedJIT LocaleFilterMatchesJitHelper::filterMatchesArgv() via __phpc_jit_locale_filter_matches (int 0/1 → i1, peer #31966).
  • Same helper for Locale::filterMatches() (functionProxies['locale::filtermatches']). php-src-strict; no php-compiler-strict shortcut.

Closes #32119

Test plan

  • ./script/phpunit.sh --filter 'LocaleFilterMatchesJitShrinkTest|LocaleFilterMatchesJitCompileTest|LocaleFilterMatchesJit32119'
    • OK (7 tests, 27 assertions) — VM + JIT .phpt result path (ordinary, named, vars, canonicalize keyword/grandfathered, unknown $langtag)
  • ./script/docker-exec.sh -- bash -lc 'php test/repro/issue_32119_locale_filter_matches_jit.php'
    • filter_pos=true / filter_named=true / filter_vars=true / kw_f=0 / kw_t=1
  • php script/bootstrap-inventory.php --check → OK 7586/7586
  • Host AOT of advertised locale_filter_matches (this image: extension_loaded('intl')=0; AOT fixture SKIPIFs)

php-src: ext/intl/locale/locale_methods.c, ext/intl/php_intl.stub.php
PHP: ext/intl/JitLocaleFilterMatches.php, ext/intl/LocaleFilterMatchesJitHelper.php, lib/JIT/Builtin/LocaleFilterMatchesRuntime.php

Made with Cursor

PurHur and others added 2 commits August 18, 2026 11:59
)

Replace the JIT-not-implemented throw with compile-time prefix-filter fold
and a NestedJIT helper so locale_filter_matches()/Locale::filterMatches()
match VM/php-src canonicalize semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ddd4663 into master Aug 18, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the agent/advanced-stdlib-32119-locale-filter-matches-jit branch August 18, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: locale_filter_matches() JIT path throws instead of matching php-src prefix filtering (ext/intl/locale/locale_methods.c)

1 participant