refactor(runtime): split field_set_by_name.rs (#7402) - #7444
Merged
Conversation
added 2 commits
August 5, 2026 13:59
…ine cap (#7402) Pure mechanical relocation of `js_object_set_field_by_name` and its neighbours into topical sub-modules. The file sat at exactly 2000 of 2000 allowed lines, so the next line added anywhere in it turned the required `lint` context red. No behaviour change: every moved statement is byte-identical, and the split point for the tail is the `RuntimeHandleScope` creation, so the `refresh_roots_after_alloc!()` macro (#7341) and all 16 of its call sites — plus both `GC_STORE_AUDIT(INIT)` markers — stay together in one file with their ordering untouched.
…e split (#7402) Both addr-class gate inputs are PATH-keyed, so a pure file split trips them even though no site is added or removed: - scripts/addr_class_allowlist.txt matches by `rel_path.startswith(prefix)`, and the prefix ended in `.rs`, so it stopped covering the code the moment it moved into field_set_by_name/. Widened to the directory-and-file prefix. - scripts/addr_class_ratchet_baseline.txt is a per-(rule, file) COUNT, so the grandfathered sites land on new paths with no baseline entry and read as a regression. Regenerated with --write-baseline (the workflow its own header prescribes for exactly this case). Sums are preserved: handle-floor 11 -> 1+3+6+1, lone-valid-obj-ptr 3 -> 2+1, and the gate still reports 544 ratcheted sites total, same as before the split. Also adds the changelog.d fragment required by the changeset gate, and drops a stale clause from the module doc (the diagnostic helper moved to write_helpers.rs).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe field-setting implementation is split into topical Rust modules. The entry point delegates rooted assignment to the tail module, while fast paths, attribute setters, write helpers, and path-based metadata are updated. ChangesField setter split
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
✨ 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 |
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.
Closes #7402. The file sat at exactly 2000 of 2000 allowed lines, so the next line anyone added turned
lintred — andlintis required, so every merge after that bypasses a required gate. That already happened once today.field_set_by_name.rsfield_set_by_name/tail.rsfield_set_by_name/fast_paths.rsfield_set_by_name/write_helpers.rsfield_set_by_name/attr_variants.rsPure move, proven. Every relocated region diffs IDENTICAL against
origin/main—tail.rsis 937 lines verbatim. Only 5 lines differ across the whole 2000: four file-privateunsafe fns promoted topub(super), and one now-dead#[allow(unused_assignments)]whose assignments left with the macro.The split point is the
RuntimeHandleScopecreation, chosen deliberately so therefresh_roots_after_alloc!()macro (#7341), all 16 of its call sites, and bothGC_STORE_AUDIT(INIT)markers stay in one file with their order untouched. No rooted step crosses a module boundary — that ordering was the subject of two PRs today and must not move.Verification
origin/mainbaseline run in the same sessioncheck_file_size.shexit 0, proven able to fail viaPERRY_FILE_SIZE_THRESHOLD=900addr_class_inventory.pypasses; sums preserved across the split (handle-floor 11 → 1+3+6+1, lone-valid-obj-ptr 3 → 2+1, 544 ratcheted sites before and after)cargo checkproven able to fail via a deliberate errorLatent hazard this exposed
Both addr-class gate inputs are path-keyed, so any file split trips them even with zero new sites.
addr_class_allowlist.txtmatches viarel_path.startswith(prefix)with an entry ending in.rs, andaddr_class_ratchet_baseline.txtis a per-(rule, file) count. Re-keyed here; it will bite the next person told to split a file.Note for #7435
Its hunk targets the URL-setter arm, now at
field_set_by_name/tail.rs:317— the patch is written againstfield_set_by_name.rs:1240and needs retargeting.tail.rshas 1032 lines of headroom for its 5.Summary by CodeRabbit
Refactor
Documentation