Skip to content

php-in-php: class_implements() JIT via ClassImplementsJitHelper PHP (#16960)#16964

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-class-implements
Jul 6, 2026
Merged

php-in-php: class_implements() JIT via ClassImplementsJitHelper PHP (#16960)#16964
PurHur merged 1 commit into
masterfrom
agent/runtime-php-class-implements

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ClassImplementsJitHelper (SSOT: VmReflection::resolveClassForClassImplements() + classImplementsArray()) and StringClassImplements thin __phpc_jit_class_implements bridge via JitVmHelperLink.
  • JitClassImplements keeps compile-time literal / TYPE_OBJECT / boxed-object LLVM fast paths (AOT parity); routes other dynamic operands through PHP helper instead of rejecting at compile time.
  • Spine includes helper + bridge; ClassImplementsRuntimeShrinkTest guard.

Closes #16960

php-src reference

  • ext/standard/basic_functions.cPHP_FUNCTION(class_implements)

PHP implementation

  • ext/standard/ClassImplementsJitHelper.php — runtime SSOT
  • lib/JIT/Builtin/StringClassImplements.php — JIT/AOT ABI bridge
  • ext/standard/JitClassImplements.php — compile-time fast paths + routeThroughPhpHelper()

Verification (Docker)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter ClassImplementsRuntimeShrinkTest'
# OK (4 tests, 10 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter class_implements'
# OK (17 tests, 25 assertions) — VM + JIT + AOT fixtures

make bootstrap-selfhost-vm-driver-execute-probe
# bootstrap-selfhost-vm-driver-execute-probe: OK

Note: php script/check-selfhost-spine-coverage-sync.php is red on master for unrelated LazyProperty spine drift (#16958); not introduced by this diff.

Made with Cursor

…16960)

Route dynamic class_implements() operands through VmReflection PHP helper
and a thin __phpc_jit_class_implements bridge; keep compile-time object/value
LLVM fast paths for AOT parity with master.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit f35bf82 into master Jul 6, 2026
1 check failed
@PurHur PurHur deleted the agent/runtime-php-class-implements branch July 6, 2026 16:40
PurHur added a commit that referenced this pull request Jul 6, 2026
…16972)

Spine entry SHA drifted after #16964/#16965 require_once additions;
sync prelinked stamp/manifest and roadmap footnotes so ci-fast spine
gates pass without auto-heal.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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: class_implements() JIT via ClassImplementsJitHelper PHP — drop inline LLVM in JitClassImplements.php (#1492)

1 participant