Skip to content

php-in-php: route get_class class-id LLVM through GetClassJitHelper (#10222) - #11477

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10222-reflection-jit-helper
Jun 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10222-reflection-jit-helper

Conversation

@PurHur

@PurHur PurHur commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add GetClassJitHelper + GetClassRuntime thin bridge (__phpc_class_name_from_id)
  • ReflectionBuiltinHelper::classNameFromId no longer emits per-class LLVM select chain (~14 LOC removed)
  • Per-compile-unit class table embedded when nested helper is compiled

Closes #10222 (partial — literal reflection helpers already PHP at compile time; runtime get_class path migrated)

php-src reference

  • ext/standard/basic_functions.c — PHP_FUNCTION(get_class)
  • Zend/zend_builtin_functions.c — zend_get_object_classname

LLVM shrink

  • ReflectionBuiltinHelper.php: 336 → 332 lines; removed allClassNamesById() select loop in classNameFromId

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
./vendor/bin/phpunit --filter "ReflectionBuiltinHelperRuntimeShrinkTest|GetClassRuntimeStandaloneTest"
php bin/vm.php -r "class C {} echo get_class(new C());"
php bin/jit.php -r "class C {} echo get_class(new C());"
php script/check-selfhost-spine-coverage-sync.php
'
OK (4 tests, 14 assertions)
C
C
check-selfhost-spine-coverage-sync: OK

./script/ci-fast.sh — green

Made with Cursor

…10222).

Replace ReflectionBuiltinHelper's per-class LLVM select chain with a compiled PHP helper and thin __phpc_class_name_from_id bridge.

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.

php-in-php: JIT ReflectionBuiltinHelper — route reflection builtin LLVM through VmReflection PHP not ~336-line monolith (#1492)

1 participant