perf(runtime): property attributes live with the keys (descriptor arrays); no per-object attribute tables - #11411
Conversation
A key list that carries any non-default attribute owns a parallel attributes array (one entry per key position, with cumulative summary and Bloom words), attached through the named-properties reserve slot the collector already traces and growth already carries. Attribute-free key lists are unchanged. The canonical trie's edge is (key, entry): a default entry hashes as before, a key that arrives with its attributes appends in place, and a change to an existing key rebuilds the list from that key. The shape record carries the attribute summary byte (identity), which the class-chain store check reads first. An ordinary object's attributes leave the property_descriptors table, its owner index and its meta Bloom bits; the hashed attribute generation is deleted. Deletes, squeezes and the dictionary latch carry entries; a dictionary receiver edits its private list in place. The read IC declines only an accessor key and the write ICs only a key that is not plain writable data (emitted write PIC mask 0x1987 -> 0x1180). Builtin installs, fast-arm accessor defines and arguments objects claim their keys with their attributes. Default-off PERRY_ATTR_DIAG census behind the attr-census feature.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (65)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe runtime now stores ordinary-object property attributes alongside key lists and includes attribute summaries in shape identity. Descriptor operations and inline-cache checks use per-key attributes. The change also adds regression coverage and an opt-in attribute census. ChangesKey-Backed Property Attributes
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant PropertyDefinition
participant DescriptorState
participant KeyAttributes
participant ShapeRecord
participant WriteInlineCache
PropertyDefinition->>DescriptorState: apply attribute edit
DescriptorState->>KeyAttributes: update the key entry
KeyAttributes->>ShapeRecord: publish attribute summary
WriteInlineCache->>ShapeRecord: inspect receiver shape
WriteInlineCache->>KeyAttributes: check target key writability
Merge Risk: ⚪ Minimal · up to This change moves property attributes onto key lists and makes cache eligibility depend on each key's attributes. The integrity, deletion, and cache-guard paths that were examined behave correctly, and no concrete merge-blocking issue remains. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The change substantially alters core runtime object metadata and cached property-write behavior. The implementation includes safeguards for descriptor enforcement and garbage collection, but an optional diagnostic feature can write through the runtime process’s filesystem authority when enabled; ownership of that enablement in deployed environments remains unverified. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
What
Charter step 3: property attributes live with the keys, like V8's descriptor arrays.
definePropertyof a new key.defineProperty, freeze, seal) rebuilds the list from that key onward, as V8 copies its descriptor array. Freeze does this once.descriptor_state/filter.rs).Numbers
Dedicated Linux host, both arms built there, 5 interleaved rounds. Outputs are identical.
transpileModuleinstructionsCensus (tsc / Zod):
Verification
test_gap_attrs_in_shape.ts(62 rows, strict),_sloppy.ctsand the newtest_gap_attrs_with_keys.ts.6287_timer_batch_order,attrs_with_keys,common_ffi_handle_ids_distinct);node_redis_from_sourcegoes from compile_fail to diff. It now builds; the output diff is not yet attributed.cargo fmtis clean.run_lint_gatespasses except the two host-only failures.Follow-up: charter step 3's accessor stage. Class
get/setbecome real accessor properties on the class prototype, and it deletes #11348'sclass_accessor_cache.rs.Summary by CodeRabbit