php-in-php: class_exists()/interface_exists() JIT via VmReflection PHP (#16185)#16186
Merged
Merged
Conversation
#16185) Route runtime JIT paths through ClassExistsJitHelper and InterfaceExistsJitHelper instead of inline strcasecmp LLVM loops; keep JitClassExists::stringDataPtr for other introspection JIT users. 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
Migrates
class_exists()andinterface_exists()JIT runtime paths from inline LLVMstrcasecmploops to compiled PHP helpers, matching the pattern merged in #16173 (trait_exists).VmReflection::classExists()/VmReflection::interfaceExists()ClassExistsJitHelper+InterfaceExistsJitHelperviaStringClassExists/StringInterfaceExists(JitVmHelperLink)JitClassExists.php56→31 LOC (−25);JitInterfaceExists.php58→32 LOC (−26); compile-time literal fast paths unchanged (ReflectionBuiltinHelper)JitClassExists::stringDataPtr()— still used byJitFilterId,JitClassUses,JitGetClassMethodslib/AOT/runtime/(floor unchanged:phpc_progress.cSIGSEGV handler only)Closes #16185
Verification
php-src reference
ext/standard/basic_functions.c—PHP_FUNCTION(class_exists)/PHP_FUNCTION(interface_exists)Made with Cursor