Closed Bug 1786309 Opened 2 years ago Closed 2 years ago

Simplify representation of zones set

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(4 files)

The GC iterates over zones in many places. Currently the set of zones is represented by a single atoms zone and a vector of non-atoms zones. Iterators such as AllZonesIter exist to hide this distinction.

It would be simpler to represent this as a single vector with the invariant that the atoms zone is always the first element. Then iteration is just vector iteration, optionally starting at the second element if you don't want the atoms zone.

Creation of non-atoms zones already happens in GC.cpp, in js::NewRealm.
Arguably creation of zones should be split between the GC and the VM. Zones are
a GC concept, but much of their contents are VM specific.

Depends on D155224

Depends on D155226

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c54c096740d9 Part 1: Remove unused methods to get the atoms zone r=sfink https://hg.mozilla.org/integration/autoland/rev/4a3ba646d292 Part 2: Move creation of the atoms zone into GCRuntime::init r=sfink https://hg.mozilla.org/integration/autoland/rev/0db63b7bac22 Part 3: Store the atoms zone at the start of the zones vector r=sfink https://hg.mozilla.org/integration/autoland/rev/c1884222a881 Part 4: Simplify zone iteration r=sfink
Blocks: 1786506
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: