commit 06166ae6872b1c95e46ab4edad421966387469e5
parent 31c1af05c7ee19cd2e005f34447a03ea5e9a53ea
Author: Matthew Gaudet <mgaudet@mozilla.com>
Date: Fri, 28 Nov 2025 21:41:20 +0000
Bug 2002035 - Remove unnecessary barriers in MustConsumeMicroTaskRunnable r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D274352
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h
@@ -109,7 +109,9 @@ class SuppressedMicroTasks : public MicroTaskRunnable {
// A gecko wrapper for the JS::MicroTask type. Used to enforce both
// that this is handled move only, but also that we have succesfully
// consumed this microtask before destruction.
-class MustConsumeMicroTask {
+//
+// This type must be rooted, it holds onto a JS reference.
+class MOZ_STACK_CLASS MustConsumeMicroTask {
public:
// We need a public constructor to allow forward declared Rooted
MustConsumeMicroTask() = default;
@@ -253,14 +255,14 @@ class MustConsumeMicroTask {
}
void trace(JSTracer* aTrc) {
- TraceEdge(aTrc, &mMicroTask, "MustConsumeMicroTask value");
+ TraceRoot(aTrc, &mMicroTask, "MustConsumeMicroTask value");
}
private:
explicit MustConsumeMicroTask(JS::GenericMicroTask&& aMicroTask)
: mMicroTask(aMicroTask) {}
- JS::Heap<JS::GenericMicroTask> mMicroTask;
+ JS::GenericMicroTask mMicroTask;
};
class SuppressedMicroTaskList final : public MicroTaskRunnable {