Language: user __destruct() JIT/AOT invoke (#4013) - #4018
Merged
Merged
Conversation
Wire __object__invoke_destructor dispatch, phpc_gc shutdown destructors, and main-script deferral via phpc_destruct_set_allow_delref. VM matches end-then-bye ordering; AOT/JIT native paths need follow-up on post-shutdown output integrity. php-src: Zend/zend_objects.c zend_objects_destroy_object Co-authored-by: Cursor <cursoragent@cursor.com>
Merge master. Skip JIT/AOT compliance until native __destruct invoke stops dumping spurious stdout after correct end/bye output (VM path unchanged). phpc_gc_run_shutdown_destructors avoids double-free when destructor delref already unregistered the object. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
|
Maintainer triage: keeping open — body already documents AOT stdout corruption + JIT harness exit -1. VM repro ordering looks correct; merge after AOT/JIT compliance green on |
Defer destructor GC until after main PHP but before __shutdown__ frees compile-time string globals and sg_* tables; treat __destruct as void in JIT lowering; invoke path keeps delref deferred without post-call delref. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
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
__destruct()for JIT/AOT via__object__invoke_destructor(class-id dispatch, php-srczend_objects_destroy_objectsubset).phpc_gc.cwith destructor registry,phpc_gc_run_shutdown_destructors, and main-script deferral (phpc_destruct_set_allow_delref(0)sonew D(); echo end;matches VM ordering).Refcountdelref to invoke destructors on scope release when allowed, and skip destroy while main script defers.php-src reference:
Zend/zend_objects.c—zend_objects_destroy_objectVerification
Status
Not merge-ready — AOT post-shutdown heap corruption pollutes stdout after correct
end/bye; JIT MCJIT needs harness investigation. VM path and destructor ordering for main script are correct.Closes #4013 when follow-up fixes land.
Made with Cursor