Bug 1809141 - Use separate mutex when adding to the delayed marking list r=sfink
commit1a4be2694612e6f85c0771df5ec31803ec2d4d3d
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 11 Jan 2023 10:12:49 +0000 (11 10:12 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Wed, 11 Jan 2023 10:12:49 +0000 (11 10:12 +0000)
tree73abe47a9ef07ec52efdd7a2d3b3504ef57cd683
parentc0c3246d5ab53187277748a559d93a44f8e346d1
Bug 1809141 - Use separate mutex when adding to the delayed marking list r=sfink

Currently this uses the GC lock, but that may already be held at this point if
we OOM during parallel marking. Also the helper thread mutex may be held if we
are marking helper thread state.

Adding to the delayed  marking list needs synchronization, but we only mark
this on a single thread (main or helper thread) so we don't need to lock there.

The patch adds a new mutex to use for this with mutex order higher that the
helper thread state mutex.

Differential Revision: https://phabricator.services.mozilla.com/D166325
js/src/gc/GC.cpp
js/src/gc/GCRuntime.h
js/src/gc/Marking.cpp
js/src/vm/MutexIDs.h