Closed Bug 1449506 Opened 8 years ago Closed 8 years ago

Clarify AtomMarking synchronisation

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

The comments in AtomMarkingRuntime say that the table of unused indexes is protected by the GC lock, but the field is wrapped with ExclusiveAccessLockOrGCTaskData<>. In fact it is only ever accessed with the GC lock held.
This patch changes the wrapper to GCLockData<> and passes AutoLockGC& through to everything that touches it. I find the latter helps me to see where locks are held in the code. I changed the assertions in the methods that update chunk mark bits to ensure that we're in a GC with no helper threads running. Currently we assert that the current thread holds the exclusive access lock but that's actually a bit of a lie because this is executed on a helper thread while the main thread holds the lock and the assertion somehow allows this. I'll file for that as well. For AtomMarkingRuntime::adoptMarkedAtoms we don't need the exclusive access lock at this point. This is called when merging zones after the source zone has ceased to belong to a helper thread.
Attachment #8963029 - Flags: review?(sphink)
Blocks: 1449511
Priority: -- → P3
Attachment #8963029 - Flags: review?(sphink) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: