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
This commit is contained in:
Jon Coppeard 2023-02-01 09:06:13 +00:00
parent a0e9013302
commit 11822099b1
2 changed files with 3 additions and 8 deletions

View file

@ -594,10 +594,7 @@ void ModuleNamespaceObject::ProxyHandler::trace(JSTracer* trc,
auto& self = proxy->as<ModuleNamespaceObject>();
if (self.hasExports()) {
for (JSAtom*& name : self.mutableExports()) {
TraceManuallyBarrieredEdge(trc, &name,
"ModuleNamespaceObject export name");
}
self.mutableExports().trace(trc);
}
if (self.hasBindings()) {

View file

@ -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<JSAtom*, 0, SystemAllocPolicy>;
// This is used both on the stack and in the heap.
using ExportNameVector = GCVector<HeapPtr<JSAtom*>, 0, SystemAllocPolicy>;
class ModuleNamespaceObject : public ProxyObject {
public: