Repository navigation
JIT: preg_replace_callback() compile-time string callbacks (#1177) - #1315
Merged
Merged
Conversation
Connect ext/standard call() to JitPregReplaceCallback via a per-callback LLVM shim that adapts __value__* match vectors to user functions returning strings. Add JIT/AOT PHPT coverage, sync capability matrix and stdlib JIT audit, and drop session_id from the VM-only deferred list now that JIT is implemented. Closes #1177. Contributes to #1056 and #1237. Co-authored-by: Cursor <cursoragent@cursor.com>
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
preg_replace_callback()call()toJitPregReplaceCallback::invoke()for compile-time string user-function callbacks in the current compile unit.__compiler_preg_replace_callbackruntime receives__value__* (*)(__value__*)while user functions keep__string__* (*)(__hashtable__*)signatures.docs/capabilities.mdanddocs/stdlib-jit-audit.md.session_idfromSelfHostBuiltinPolicyVM-only deferred list (JIT already implemented on master).Contributes to North Star 2 self-host (#1056) and stdlib wave 2 (#1237).
Closes #1177.
Test plan
php bin/vm.phpsmoke forpreg_replace_callbackcompliance casePHPUnit test/unit/PregReplaceCallbackBuiltinTest.php./script/ci-fast.shinphp-compiler:22.04-dev(tar pipe; harness bind-mount empty)./script/ci-local.shfull LLVM gate (MCJIT execution segfaults on this harness host for all JIT scripts; module verify passes for the new lowering)Made with Cursor