Skip to content

php-in-php: GcCollectCyclesRuntime phase 3 — destruct_try_invoke + object_release_storage PHP (#18660)#18664

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-gc-destruct-release-18701
Jul 13, 2026
Merged

php-in-php: GcCollectCyclesRuntime phase 3 — destruct_try_invoke + object_release_storage PHP (#18660)#18664
PurHur merged 1 commit into
masterfrom
agent/runtime-php-gc-destruct-release-18701

Conversation

@PurHur

@PurHur PurHur commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route phpc_destruct_try_invoke through GcDestructTryInvokeJitHelper PHP (replaces ~43 LOC inline LLVM guards + destructor dispatch).
  • Route phpc_object_release_storage through GcObjectReleaseStorageJitHelper PHP (replaces ~24 LOC notify/unregister/free LLVM loop).
  • Add thin phpc_*_native internals for constructed/destructor/notify/mm_free ABI bridges via GcCollectCyclesNativeOpsJit.
  • LLVM shrink: 124 lines removed from lib/JIT/Builtin/GcCollectCyclesRuntime.php; semantics moved to ext/standard/ PHP helpers.

Closes #18660

php-src reference

  • Zend/zend_objects_API.c — destructor invocation / object free

Verification

vendor/bin/phpunit --filter 'GcDestructShutdownRuntimeShrinkTest|GcDestructAllowDelrefRuntimeShrinkTest|GcCollectCyclesCollectRuntimeShrinkTest|GcDestructTryInvokeRuntimeShrinkTest'
# OK (17 tests, 72 assertions)

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

Made with Cursor

…h PHP helpers (#18660)

Replace inline LLVM orchestration in GcCollectCyclesRuntime with
GcDestructTryInvokeJitHelper and GcObjectReleaseStorageJitHelper PHP SSOT
plus thin native bridges for constructed/destructor/notify/free ABI.

Closes #18660

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit ff9f328 into master Jul 13, 2026
1 check failed
@PurHur PurHur deleted the agent/runtime-php-gc-destruct-release-18701 branch July 13, 2026 17:45
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: GcCollectCyclesRuntime phase 3 — route destruct_try_invoke + object_release_storage LLVM through PHP helpers (#1492)

1 participant