Skip to content

Stdlib: grapheme_str_split() JIT compile-time fold (#6246) - #19962

Merged
PurHur merged 1 commit into
masterfrom
fix/6246-grapheme-str-split-jit
Jul 17, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/6246-grapheme-str-split-jit

Conversation

@PurHur

@PurHur PurHur commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add JitGrapheme::tryStrSplitFold() — compile-time materialization of grapheme_str_split() using existing VmGrapheme::strSplit() (php-src ext/intl/grapheme/grapheme_string.c).
  • Wire grapheme_str_split::call() to fold literals (same pattern as grapheme_strlen() / preg_split()).
  • Guards: JIT PHPT grapheme_str_split_jit.phpt, AOT lint fixture + GraphemeStrSplitJitCompileTest.

Runtime JIT for non-literal operands remains deferred (unchanged).

Test plan

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter GraphemeStrSplitJitCompileTest'
# PHPUnit 9.6.21 — OK (1 test, 3 assertions)

Closes #6246 (JIT slice; VM path was already green when extension_loaded('intl')).

Made with Cursor

Add JitGrapheme::tryStrSplitFold mirroring other grapheme builtins; AOT lint + JIT PHPT guard.
php-src: ext/intl/grapheme/grapheme_string.c PHP_FUNCTION(grapheme_strsplit)

Co-authored-by: Cursor <cursoragent@cursor.com>
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: grapheme_strsplit() — ICU grapheme cluster split missing (ext/intl/grapheme)

1 participant