fix: preserve factory class identity and dynamic heritage - #9753
fix: preserve factory class identity and dynamic heritage#9753proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (15)
Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughFunction-nested classes with dynamic heritage now create distinct class objects per evaluation. Runtime prototype links, constructor checks, ChangesDynamic heritage class evaluation
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to Function-body classes with dynamic heritage now retain distinct per-evaluation constructors and superclass chains, with coverage for identity, reflection, inheritance, static state, and Promise statics. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 14 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hot-path note from the cc performance campaign (see if promise_static_function_spec(name).is_some() && promise_parent_in_chain(class_id)Property reads on class objects are on the measured hot path for the compiled claude-code TUI ( |
|
Landed on |
Summary
A function-body declaration such as
class D extends (P ?? Object) {}now creates a distinct constructor on every evaluation. Factory chains retain their chosen superclass:mk(null) !== mk(A)andObject.getPrototypeOf(B) === A.Changes
ClassExprFresh, and replace the stale lowering comment.instanceof, and inherited property/method lookup. Mark these links separately from ordinary runtime wiring, without flushing unrelated caches on every construction.Related issue
Closes #9502.
Test plan
Developed and tested via SSH on
root@perrymaster.skelpo.net, based on12efed122.cargo test --lib -p perry-hir: 382 passed, 1 ignored.cargo test --lib -p perry-codegen: 1,410 passed, 1 ignored.cargo test --lib -p perry-runtime(single-threaded): 3,123 passed, 4 ignored.run_parity_tests.sh --filter test_gap_9502_after the fix.test_gap_derived_param_props, is rejected by the Node oracle on both versions.PERRY_GC_SCHEDULE_SEED=999 PERRY_GC_SCHEDULE_RATE=1 PERRY_GC_PROTECT_FROMSPACE=1: 10,006 copying collections, 108,818 moved objects.One repeated runtime run hit
async_hooks::test_support::tests::native_async_resource_accepts_string_and_symbol_expandos; its isolated rerun and the subsequent full runtime run passed. The full 702-fixture gap suite was not completed locally.Checklist
Summary by CodeRabbit
Bug Fixes
instanceof, prototype reflection, inherited method lookup, and static state for independently evaluated classes.Tests
instanceofbehavior.