Repository navigation
Feat: N-12a function-local virtual objects (#143 step 1) - #272
Merged
Merged
Conversation
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.
Refs #143 (step 1; step 2 borrowed reads / pair elision next, regions in #268).
A pure function whose N-11 object (no del, no weakref) comes from New and is read only through FieldGet, with only no-user-code nodes in between, keeps its fields in C locals and allocates nothing; the verifier recomputes the virtual set (forged entries rejected as verify/virtual-escape); anything else stays N-11; the class guard still deopts. SPEC N-12a states the known difference: an object whose allocation was removed raises no MemoryError. Checked from source: a pure f(a, b) -> P(a, b).y compiles with virtual=('p',) and no tp_new_fixed.
Red: 17 tests failed/errored before. Tests: test_virtual_objects 17, test_verify 218, test_cgen_classes 23, test_class_methods 51, test_pipeline 6, test_free_threaded 24 (2 failed once at load 20, passed on rerun). Mutation: allowing Call in the virtual set fails a test. The new file is added to the ASan/UBSan job. Follow-up found: #271. Merge held for the macOS runner freeze.