Skip to content

php-in-php: Object_.php tranche 3 — destructor/static/instance property LLVM (#9938) - #11704

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9938-object-llvm-tranche3
Jun 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9938-object-llvm-tranche3

Conversation

@PurHur

@PurHur PurHur commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract ObjectDestructorLlvm (__object__invoke_destructor dispatch + magic __destruct calls)
  • Extract ObjectStaticPropertyInitLlvm (typed static property global init emission)
  • Extract ObjectInstancePropertyLlvm (ordinary instance property fetch + dynamic fetch box)
  • Object_.php: 6208 → 5723 lines (−485, ~9% cumulative from ~6300 baseline)

Closes #9938 (partial — 30% shrink target still open for follow-up tranches)

php-src reference (semantics unchanged)

  • Zend/zend_object_handlers.c — property read/write
  • Zend/zend_enum.c — enum case singleton fetch

Verification

php vendor/bin/phpunit test/unit/ObjectPropertyRuntimeShrinkTest.php
# OK (8 tests, 27 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/issue9938_enum_property.php   # bool(true)
php bin/vm.php test/repro/issue9938_enum_property.php  # bool(true)
php bin/jit.php test/repro/issue9938_enum_property.php # bool(true)
'

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

Lines moved

Module Role
ObjectDestructorLlvm.php destructor LLVM
ObjectStaticPropertyInitLlvm.php static property __init__ emission
ObjectInstancePropertyLlvm.php instance property fetch/box LLVM

Made with Cursor

…ect_.php (#9938 tranche 3)

Route __object__invoke_destructor, static property init emission, and ordinary
instance property fetch/box through dedicated LLVM helper modules to shrink the
Object_.php monolith toward the 30% reduction target.

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 Type/Object_.php — shrink ~6.3k-line object/property LLVM monolith via VmObject PHP helpers (#1492)

1 participant