fix(runtime): PPI DESTROY/refcount wiring + PPI future-work doc#737
Open
fglock wants to merge 4 commits into
Open
fix(runtime): PPI DESTROY/refcount wiring + PPI future-work doc#737fglock wants to merge 4 commits into
fglock wants to merge 4 commits into
Conversation
…module plan - InheritanceResolver: do not cache failed DESTROY lookups as null (compile order can define DESTROY after an early miss). - DestroyDispatch: set destroyFired only once Perl DESTROY will run, so a transient resolution miss does not skip PPI::Element::DESTROY. - RuntimeScalar: incrementRefCountForContainerStore activates refCount=-1 nested referents and skips MIN_VALUE / WEAKLY_TRACKED. - dev/modules/ppi.md: future work for t/04_element.t %_PARENT teardown; README index row for PPI. PPI t/04_element.t tests 202/206 remain failing; the doc lists next steps. Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor <bot@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…f skipping misses Cache failed DESTROY lookups as null for performance, but clear DESTROY-related methodCache entries and DestroyDispatch caches whenever *::DESTROY map slots change or a stash CV is defined in-place (globalCodeRefFqn + setLargeRefCounted). Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Replace DESTROY-only methodCache flush with invalidateMethodLookupCachesForStashSubKey: drop cached lookups matching the sub's final segment (e.g. My::Pkg::foo → foo, including \0noautoload keys). DestroyDispatch still clears only when the leaf is DESTROY. GlobalCodeRefMap skips invalidation on first empty stub put; put/remove and setLargeRefCounted cover defined installs and in-place CV updates. Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor <noreply@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…hes/arrays
incrementRefCountForContainerStore must only bootstrap RuntimeHash/RuntimeArray
slots from refCount=-1; promoting other referents (e.g. weak_ref targets that
are refs to readonly scalars) regressed Moo's t/accessor-weaken.t.
PPI nested {children} containers remain covered.
Generated with [Cursor](https://cursor.com/docs)
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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
DESTROYis resolved during load order transitions: avoid caching a failedDESTROYlookup as null, and avoid settingdestroyFiredbefore we know PerlDESTROYwill run.incrementRefCountForContainerStoreso nested anonymous referents atrefCount == -1are activated before the container-store increment (skip destroyed and weak-tracked referents).dev/modules/ppi.mdwith a dated follow-up section fort/04_element.t/%PPI::Singletons::_PARENT(tests 202 and 206 still fail after this PR; the doc lists ordered next steps). Link the module doc fromdev/modules/README.md.Test plan
make(full unit suite) — passed locally before push../jcpan -t PPIortimeout 180 ./jperl … cpan/build/PPI-*/t/04_element.t— expect 202 and 206 to still fail until follow-up refcount work; no regression target asserted for the full PPI suite in this change.