Repository navigation
Stdlib: AOT iconv_substr via __string__ fold + NestedJIT (#27197) - #27910
Merged
Merged
Conversation
Return boxed __string__*/false instead of constantFromString() (unknown*) so thin AOT can infer the builtin result, and link runtime via IconvStringJitHelper NestedJIT for non-foldable string args. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
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
iconv_substr('abcdef', 1, 3, 'UTF-8')failing withCannot infer JIT variable type from LLVM type: unknown*— same root cause asiconv()fold (Regression: mb_strlen()/mb_substr()/mb_strpos()/iconv()/iconv_strlen(null) TypeError under PROFILE=8.4 — Zend DEP+coerce (ext/mbstring, ext/iconv) #21197):constantFromString()is a C-string global, not__string__*.__value__*(string|false) and addIconvStringJitHelper+StringIconvSubstrNestedJIT for non-literal string args (literal offset/length/encoding).ext/iconv/iconv.c—PHP_FUNCTION(iconv_substr).Closes #27197
Test plan
php bin/vm.php test/repro/issue_27197_iconv_substr_aot.php→bcd/bcdphp bin/jit.php test/repro/issue_27197_iconv_substr_aot.php→bcd/bcd./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/compile.php -o /tmp/iconv27197 test/repro/issue_27197_iconv_substr_aot.php && /tmp/iconv27197'→bcd/bcdvendor/bin/phpunit --filter IconvSubstrRuntimeShrinkTest→ OK (4)vendor/bin/phpunit --filter iconv_substr test/aot/→ OK (1)php script/check-selfhost-spine-coverage-sync.php→ OKNot covered: thin AOT NestedJIT with runtime-loaded int offset/length (same class as truly dynamic
iconv_mime_decodemode under AOT); call-site integer literals work.Gate snapshot:
release-readiness --jsonon master tip before this change:user_release_ready: no(north-star5-fast gen-0 manifest/driver mismatch #8713) — pre-existing pillar-1, not this PR.Made with Cursor