From 11822099b1e362f05b6787048892fc0114bed39c Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Wed, 1 Feb 2023 09:06:13 +0000 Subject: [PATCH] Bug 1813487 - Add barriers on ExportNameVector type r=sfink This makes it so you can just call trace() on it. The barriers should not end up being triggered anyway. Differential Revision: https://phabricator.services.mozilla.com/D168227 --- js/src/builtin/ModuleObject.cpp | 5 +---- js/src/builtin/ModuleObject.h | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/js/src/builtin/ModuleObject.cpp b/js/src/builtin/ModuleObject.cpp index 0ebdc10c9c47..07a2a2b27adf 100644 --- a/js/src/builtin/ModuleObject.cpp +++ b/js/src/builtin/ModuleObject.cpp @@ -594,10 +594,7 @@ void ModuleNamespaceObject::ProxyHandler::trace(JSTracer* trc, auto& self = proxy->as(); if (self.hasExports()) { - for (JSAtom*& name : self.mutableExports()) { - TraceManuallyBarrieredEdge(trc, &name, - "ModuleNamespaceObject export name"); - } + self.mutableExports().trace(trc); } if (self.hasBindings()) { diff --git a/js/src/builtin/ModuleObject.h b/js/src/builtin/ModuleObject.h index 0a8922ff192a..aefabb11af36 100644 --- a/js/src/builtin/ModuleObject.h +++ b/js/src/builtin/ModuleObject.h @@ -188,10 +188,8 @@ class IndirectBindingMap { // Vector of atoms representing the names exported from a module namespace. // -// Barriers are not required because this is either used as a root, or a -// non-mutable field of ModuleNamespaceObject. Don't change this without adding -// barriers. -using ExportNameVector = GCVector; +// This is used both on the stack and in the heap. +using ExportNameVector = GCVector, 0, SystemAllocPolicy>; class ModuleNamespaceObject : public ProxyObject { public: -- 2.11.4.GIT