Closed Bug 1526257 Opened 5 years ago Closed 5 years ago

Make cell iteration harder to misuse

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jonco, Assigned: pbone)

References

Details

Attachments

(3 files)

Following bug 1519037 we should refactor our zone cell iteration APIs to make them harder to misuse, specifically having a public version that filters out about-to-be-finalized cells during incremental sweeping.

I'm thinking the public one should be Zone::cellIter (which could use a filtered iterator built on ZoneCellIter) and we should switch to using ZoneCellIter directly in the GC.

Assignee: nobody → pbone
Status: NEW → ASSIGNED

ZoneCellIter can return cells that are about to be finalised in the next GC
slice. These cells can be used briefly but cannot be kept around and the GC
needs this behaviour.

This change introduces ZoneCellIterSafe which will not return about-to-be
finalised cells. Zone::cellIter() will use it now, the old behaviour is now
in cellIterUnsafe().

Update several uses of cellIter() to cellIterUnsafe() where that behaviour
is needed.

The new cellIter() now filters out cells that are about to be finalised.

Depends on D19890

Attachment #9044090 - Attachment description: Bug 1526257 - (part 1) Add a SafeZoneCellIter, making cellIter() GC-safe r=sfink! → Bug 1526257 - (part 1) Add a SafeZoneCellIter, making cellIter() GC-safe r=sfink!,r=arai

Depends on D19891

Pushed by pbone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d8ca9f5b4c24
(part 1) Add a SafeZoneCellIter, making cellIter() GC-safe r=sfink,arai
https://hg.mozilla.org/integration/autoland/rev/a9070349961b
(part 2) Remove reundant IsAboutToBeFinalised calls r=arai
https://hg.mozilla.org/integration/autoland/rev/a68a646241f1
(part 3) Rename ZoneCellIter classes r=sfink
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: