Closed Bug 1647319 Opened 4 years ago Closed 4 years ago

Create an abstraction for nested iteration

Categories

(Core :: JavaScript: GC, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(6 files)

There are several places where we write an iterator class that combines two other iterators such that it yields all x from iterator X(y) for all y from iterator Y. I've heard this called nested iteration but I don't know if there's a better name.

We should factor out the logic for this to save reimplementing it everywhere.

It's useful in later patches to have zone iterators whose constructors take a single parameter.

Depends on D80482

There's only one place this is called with SkipAtoms and it's fine to include the atoms zone there.

Depends on D80484

This also means we can simplify ArenaCellIter is it doesn't need to support reset() any more. I had to rename the getCell/get methods returning TenuredCell*/T* to get/as to make this work.

I also changed use of |ArenaCellIter i| to |ArenaCellIter cell|, like we do for ZonesIter.

Depends on D80485

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1adf40ab95b9 Split off NonAtomZonesIter from ZonesIter and add AllZonesIter r=sfink https://hg.mozilla.org/integration/autoland/rev/bd0b3614efcf Add NestedIterator template class r=sfink https://hg.mozilla.org/integration/autoland/rev/0e900e18ead7 Use NestedIterator to implement public iterators for realms and compartments r=sfink https://hg.mozilla.org/integration/autoland/rev/32b62f886374 GCZones constructor doesn't need to take ZoneSelector parameter r=sfink https://hg.mozilla.org/integration/autoland/rev/61916f49f2b3 Use NestedIterator to implement ZoneAllCellIter r=sfink https://hg.mozilla.org/integration/autoland/rev/cf488a06921e Use NestedIterator to implement ArenasToUnmark r=sfink
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a59ad84db1b Split off NonAtomZonesIter from ZonesIter and add AllZonesIter r=sfink https://hg.mozilla.org/integration/autoland/rev/8624539378e1 Add NestedIterator template class r=sfink https://hg.mozilla.org/integration/autoland/rev/791dfca7e74d Use NestedIterator to implement public iterators for realms and compartments r=sfink https://hg.mozilla.org/integration/autoland/rev/fe6e1d55aa8f GCZones constructor doesn't need to take ZoneSelector parameter r=sfink https://hg.mozilla.org/integration/autoland/rev/17c17458be2e Use NestedIterator to implement ZoneAllCellIter r=sfink https://hg.mozilla.org/integration/autoland/rev/9ba80352f5c3 Use NestedIterator to implement ArenasToUnmark r=sfink
Blocks: 1651683
Regressions: 1652246
Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: