Bug 1238711 - Rename TraceableVector to GCVector; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Mon, 28 Dec 2015 11:45:13 -0800
changeset 279456 08f99465a9ccf5bcba5e34b9dabe4e349134e492
parent 279455 481ed606661347f3f8a52b2cb92eec9215dce972
child 279457 18f5d9d83ab87ecb45bd2184b10e65e7316e3080
push idunknown
push userunknown
push dateunknown
reviewerssfink
bugs1238711
milestone46.0a1
Bug 1238711 - Rename TraceableVector to GCVector; r=sfink
js/public/GCVector.h
js/public/TraceableVector.h
js/src/NamespaceImports.h
js/src/builtin/ModuleObject.cpp
js/src/builtin/ModuleObject.h
js/src/ds/IdValuePair.h
js/src/frontend/Parser.h
js/src/gc/Rooting.h
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jsapi-tests/testGCExactRooting.cpp
js/src/jsapi-tests/testGCUniqueId.cpp
js/src/jsapi.h
js/src/jscntxt.h
js/src/jsobj.h
js/src/moz.build
js/src/vm/Runtime.h
js/src/vm/String.h
rename from js/public/TraceableVector.h
rename to js/public/GCVector.h
--- a/js/public/TraceableVector.h
+++ b/js/public/GCVector.h
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef js_TraceableVector_h
-#define js_TraceableVector_h
+#ifndef js_GCVector_h
+#define js_GCVector_h
 
 #include "mozilla/Vector.h"
 
 #include "js/RootingAPI.h"
 #include "js/TracingAPI.h"
 #include "js/Vector.h"
 
 namespace js {
 
-// A TraceableVector is a Vector with an additional trace method that knows how
+// A GCVector is a Vector with an additional trace method that knows how
 // to visit all of the items stored in the Vector. For vectors that contain GC
 // things, this is usually more convenient than manually iterating and marking
 // the contents.
 //
 // Most types of GC pointers as keys and values can be traced with no extra
 // infrastructure.  For structs and non-gc-pointer members, ensure that there
 // is a specialization of DefaultGCPolicy<T> with an appropriate trace method
 // available to handle the custom type. Generic helpers can be found in
@@ -28,30 +28,30 @@ namespace js {
 //
 // Note that although this Vector's trace will deal correctly with moved items,
 // it does not itself know when to barrier or trace items. To function properly
 // it must either be used with Rooted, or barriered and traced manually.
 template <typename T,
           size_t MinInlineCapacity = 0,
           typename AllocPolicy = TempAllocPolicy,
           typename GCPolicy = DefaultGCPolicy<T>>
-class TraceableVector : public JS::Traceable
+class GCVector : public JS::Traceable
 {
     mozilla::Vector<T, MinInlineCapacity, AllocPolicy> vector;
 
   public:
-    explicit TraceableVector(AllocPolicy alloc = AllocPolicy())
+    explicit GCVector(AllocPolicy alloc = AllocPolicy())
       : vector(alloc)
     {}
 
-    TraceableVector(TraceableVector&& vec)
+    GCVector(GCVector&& vec)
       : vector(mozilla::Move(vec.vector))
     {}
 
-    TraceableVector& operator=(TraceableVector&& vec) {
+    GCVector& operator=(GCVector&& vec) {
         vector = mozilla::Move(vec.vector);
         return *this;
     }
 
     size_t length() const { return vector.length(); }
     bool empty() const { return vector.empty(); }
     size_t capacity() const { return vector.capacity(); }
 
@@ -113,28 +113,28 @@ class TraceableVector : public JS::Trace
     size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
         return vector.sizeOfExcludingThis(mallocSizeOf);
     }
 
     size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
         return vector.sizeOfIncludingThis(mallocSizeOf);
     }
 
-    static void trace(TraceableVector* vec, JSTracer* trc) { vec->trace(trc); }
+    static void trace(GCVector* vec, JSTracer* trc) { vec->trace(trc); }
 
     void trace(JSTracer* trc) {
         for (auto& elem : vector)
             GCPolicy::trace(trc, &elem, "vector element");
     }
 };
 
 template <typename Outer, typename T, size_t Capacity, typename AllocPolicy, typename GCPolicy>
-class TraceableVectorOperations
+class GCVectorOperations
 {
-    using Vec = TraceableVector<T, Capacity, AllocPolicy, GCPolicy>;
+    using Vec = GCVector<T, Capacity, AllocPolicy, GCPolicy>;
     const Vec& vec() const { return static_cast<const Outer*>(this)->get(); }
 
   public:
     const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); }
     size_t length() const { return vec().length(); }
     bool empty() const { return vec().empty(); }
     size_t capacity() const { return vec().capacity(); }
     const T* begin() const { return vec().begin(); }
@@ -142,20 +142,20 @@ class TraceableVectorOperations
     const T& back() const { return vec().back(); }
 
     JS::Handle<T> operator[](size_t aIndex) const {
         return JS::Handle<T>::fromMarkedLocation(&vec().operator[](aIndex));
     }
 };
 
 template <typename Outer, typename T, size_t Capacity, typename AllocPolicy, typename GCPolicy>
-class MutableTraceableVectorOperations
-  : public TraceableVectorOperations<Outer, T, Capacity, AllocPolicy, GCPolicy>
+class MutableGCVectorOperations
+  : public GCVectorOperations<Outer, T, Capacity, AllocPolicy, GCPolicy>
 {
-    using Vec = TraceableVector<T, Capacity, AllocPolicy, GCPolicy>;
+    using Vec = GCVector<T, Capacity, AllocPolicy, GCPolicy>;
     const Vec& vec() const { return static_cast<const Outer*>(this)->get(); }
     Vec& vec() { return static_cast<Outer*>(this)->get(); }
 
   public:
     const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); }
     AllocPolicy& allocPolicy() { return vec().allocPolicy(); }
     const T* begin() const { return vec().begin(); }
     T* begin() { return vec().begin(); }
@@ -209,32 +209,32 @@ class MutableTraceableVectorOperations
     template<typename U> T* insert(T* aP, U&& aVal) {
         return vec().insert(aP, mozilla::Forward<U>(aVal));
     }
     void erase(T* aT) { vec().erase(aT); }
     void erase(T* aBegin, T* aEnd) { vec().erase(aBegin, aEnd); }
 };
 
 template <typename T, size_t N, typename AP, typename GP>
-class RootedBase<TraceableVector<T,N,AP,GP>>
-  : public MutableTraceableVectorOperations<JS::Rooted<TraceableVector<T,N,AP,GP>>, T,N,AP,GP>
+class RootedBase<GCVector<T,N,AP,GP>>
+  : public MutableGCVectorOperations<JS::Rooted<GCVector<T,N,AP,GP>>, T,N,AP,GP>
 {};
 
 template <typename T, size_t N, typename AP, typename GP>
-class MutableHandleBase<TraceableVector<T,N,AP,GP>>
-  : public MutableTraceableVectorOperations<JS::MutableHandle<TraceableVector<T,N,AP,GP>>,
+class MutableHandleBase<GCVector<T,N,AP,GP>>
+  : public MutableGCVectorOperations<JS::MutableHandle<GCVector<T,N,AP,GP>>,
                                             T,N,AP,GP>
 {};
 
 template <typename T, size_t N, typename AP, typename GP>
-class HandleBase<TraceableVector<T,N,AP,GP>>
-  : public TraceableVectorOperations<JS::Handle<TraceableVector<T,N,AP,GP>>, T,N,AP,GP>
+class HandleBase<GCVector<T,N,AP,GP>>
+  : public GCVectorOperations<JS::Handle<GCVector<T,N,AP,GP>>, T,N,AP,GP>
 {};
 
 template <typename T, size_t N, typename AP, typename GP>
-class PersistentRootedBase<TraceableVector<T,N,AP,GP>>
-  : public MutableTraceableVectorOperations<JS::PersistentRooted<TraceableVector<T,N,AP,GP>>,
+class PersistentRootedBase<GCVector<T,N,AP,GP>>
+  : public MutableGCVectorOperations<JS::PersistentRooted<GCVector<T,N,AP,GP>>,
                                             T,N,AP,GP>
 {};
 
 } // namespace js
 
-#endif // js_TraceableVector_h
+#endif // js_GCVector_h
--- a/js/src/NamespaceImports.h
+++ b/js/src/NamespaceImports.h
@@ -8,17 +8,17 @@
 // make unqualified references to them.
 
 #ifndef NamespaceImports_h
 #define NamespaceImports_h
 
 // These includes are needed these for some typedefs (e.g. HandleValue) and
 // functions (e.g. NullValue())...
 #include "js/CallNonGenericMethod.h"
-#include "js/TraceableVector.h"
+#include "js/GCVector.h"
 #include "js/TypeDecls.h"
 #include "js/Value.h"
 
 // ... but we do forward declarations of the structs and classes not pulled in
 // by the headers included above.
 namespace JS {
 
 class Latin1Chars;
@@ -31,19 +31,19 @@ class UTF8CharsZ;
 
 template <typename T>
 class AutoVectorRooter;
 typedef AutoVectorRooter<Value> AutoValueVector;
 typedef AutoVectorRooter<jsid> AutoIdVector;
 typedef AutoVectorRooter<JSObject*> AutoObjectVector;
 typedef AutoVectorRooter<JSScript*> AutoVector;
 
-using ValueVector = js::TraceableVector<JS::Value>;
-using IdVector = js::TraceableVector<jsid>;
-using ScriptVector = js::TraceableVector<JSScript*>;
+using ValueVector = js::GCVector<JS::Value>;
+using IdVector = js::GCVector<jsid>;
+using ScriptVector = js::GCVector<JSScript*>;
 
 template <typename T> class AutoVectorRooter;
 template<typename K, typename V> class AutoHashMapRooter;
 template<typename T> class AutoHashSetRooter;
 
 class MOZ_STACK_CLASS SourceBufferHolder;
 
 class HandleValueArray;
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -1161,17 +1161,17 @@ MakeElementValue(JSString *string)
 
 static Value
 MakeElementValue(JSObject *object)
 {
     return ObjectValue(*object);
 }
 
 template <typename T>
-ArrayObject* ModuleBuilder::createArray(const TraceableVector<T>& vector)
+ArrayObject* ModuleBuilder::createArray(const GCVector<T>& vector)
 {
     uint32_t length = vector.length();
     RootedArrayObject array(cx_, NewDenseFullyAllocatedArray(cx_, length));
     if (!array)
         return nullptr;
 
     array->setDenseInitializedLength(length);
     for (uint32_t i = 0; i < length; i++)
--- a/js/src/builtin/ModuleObject.h
+++ b/js/src/builtin/ModuleObject.h
@@ -7,17 +7,17 @@
 #ifndef builtin_ModuleObject_h
 #define builtin_ModuleObject_h
 
 #include "jsapi.h"
 #include "jsatom.h"
 
 #include "gc/Zone.h"
 
-#include "js/TraceableVector.h"
+#include "js/GCVector.h"
 
 #include "vm/NativeObject.h"
 #include "vm/ProxyObject.h"
 
 namespace js {
 
 class ModuleEnvironmentObject;
 class ModuleObject;
@@ -191,17 +191,17 @@ struct FunctionDeclaration
 {
     FunctionDeclaration(HandleAtom name, HandleFunction fun);
     void trace(JSTracer* trc);
 
     RelocatablePtrAtom name;
     RelocatablePtrFunction fun;
 };
 
-using FunctionDeclarationVector = TraceableVector<FunctionDeclaration, 0, ZoneAllocPolicy>;
+using FunctionDeclarationVector = GCVector<FunctionDeclaration, 0, ZoneAllocPolicy>;
 
 class ModuleObject : public NativeObject
 {
   public:
     enum
     {
         ScriptSlot = 0,
         StaticScopeSlot,
@@ -277,28 +277,28 @@ class MOZ_STACK_CLASS ModuleBuilder
     explicit ModuleBuilder(JSContext* cx, HandleModuleObject module);
 
     bool processImport(frontend::ParseNode* pn);
     bool processExport(frontend::ParseNode* pn);
     bool processExportFrom(frontend::ParseNode* pn);
 
     bool hasExportedName(JSAtom* name) const;
 
-    using ExportEntryVector = TraceableVector<ExportEntryObject*>;
+    using ExportEntryVector = GCVector<ExportEntryObject*>;
     const ExportEntryVector& localExportEntries() const {
         return localExportEntries_;
     }
 
     bool buildTables();
     bool initModule();
 
   private:
-    using AtomVector = TraceableVector<JSAtom*>;
+    using AtomVector = GCVector<JSAtom*>;
     using RootedAtomVector = JS::Rooted<AtomVector>;
-    using ImportEntryVector = TraceableVector<ImportEntryObject*>;
+    using ImportEntryVector = GCVector<ImportEntryObject*>;
     using RootedImportEntryVector = JS::Rooted<ImportEntryVector>;
     using RootedExportEntryVector = JS::Rooted<ExportEntryVector>;
 
     JSContext* cx_;
     RootedModuleObject module_;
     RootedAtomVector requestedModules_;
     RootedAtomVector importedBoundNames_;
     RootedImportEntryVector importEntries_;
@@ -311,17 +311,17 @@ class MOZ_STACK_CLASS ModuleBuilder
 
     bool appendExportEntry(HandleAtom exportName, HandleAtom localName);
     bool appendExportFromEntry(HandleAtom exportName, HandleAtom moduleRequest,
                                HandleAtom importName);
 
     bool maybeAppendRequestedModule(HandleAtom module);
 
     template <typename T>
-    ArrayObject* createArray(const TraceableVector<T>& vector);
+    ArrayObject* createArray(const GCVector<T>& vector);
 };
 
 bool InitModuleClasses(JSContext* cx, HandleObject obj);
 
 } // namespace js
 
 template<>
 inline bool
--- a/js/src/ds/IdValuePair.h
+++ b/js/src/ds/IdValuePair.h
@@ -6,18 +6,18 @@
 
 #ifndef ds_IdValuePair_h
 #define ds_IdValuePair_h
 
 #include "jsapi.h"
 
 #include "NamespaceImports.h"
 #include "gc/Tracer.h"
+#include "js/GCVector.h"
 #include "js/Id.h"
-#include "js/TraceableVector.h"
 
 namespace js {
 
 struct IdValuePair
 {
     Value value;
     jsid id;
 
@@ -32,13 +32,13 @@ struct IdValuePair
     {}
 
     void trace(JSTracer* trc) {
         TraceRoot(trc, &value, "IdValuePair::value");
         TraceRoot(trc, &id, "IdValuePair::id");
     }
 };
 
-using IdValueVector = TraceableVector<IdValuePair>;
+using IdValueVector = GCVector<IdValuePair>;
 
 } /* namespace js */
 
 #endif /* ds_IdValuePair_h */
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -231,17 +231,17 @@ struct MOZ_STACK_CLASS ParseContext : pu
     // information about the parse chain, this may be nullptr if
     // parent != nullptr.
     ParseContext<ParseHandler>* oldpc;
 
   public:
     OwnedAtomDefnMapPtr lexdeps;    /* unresolved lexical name dependencies */
 
     // All inner functions in this context. Only filled in when parsing syntax.
-    Rooted<TraceableVector<JSFunction*>> innerFunctions;
+    Rooted<GCVector<JSFunction*>> innerFunctions;
 
     // In a function context, points to a Directive struct that can be updated
     // to reflect new directives encountered in the Directive Prologue that
     // require reparsing the function. In global/module/generator-tail contexts,
     // we don't need to reparse when encountering a DirectivePrologue so this
     // pointer may be nullptr.
     Directives* newDirectives;
 
@@ -267,17 +267,17 @@ struct MOZ_STACK_CLASS ParseContext : pu
         blockNode(ParseHandler::null()),
         decls_(prs->context, prs->alloc),
         args_(prs->context),
         vars_(prs->context),
         bodyLevelLexicals_(prs->context),
         parserPC(&prs->pc),
         oldpc(prs->pc),
         lexdeps(prs->context),
-        innerFunctions(prs->context, TraceableVector<JSFunction*>(prs->context)),
+        innerFunctions(prs->context, GCVector<JSFunction*>(prs->context)),
         newDirectives(newDirectives),
         inDeclDestructuring(false)
     {
         prs->pc = this;
         if (sc->isFunctionBox())
             parseUsingFunctionBox.emplace(prs->context, sc->asFunctionBox());
     }
 
--- a/js/src/gc/Rooting.h
+++ b/js/src/gc/Rooting.h
@@ -50,16 +50,16 @@ typedef JS::Rooted<JSAtom*>            R
 typedef JS::Rooted<JSLinearString*>    RootedLinearString;
 typedef JS::Rooted<PropertyName*>      RootedPropertyName;
 typedef JS::Rooted<ArrayObject*>       RootedArrayObject;
 typedef JS::Rooted<GlobalObject*>      RootedGlobalObject;
 typedef JS::Rooted<PlainObject*>       RootedPlainObject;
 typedef JS::Rooted<SavedFrame*>        RootedSavedFrame;
 typedef JS::Rooted<ScriptSourceObject*> RootedScriptSource;
 
-typedef TraceableVector<JSFunction*>   FunctionVector;
-typedef TraceableVector<PropertyName*> PropertyNameVector;
-typedef TraceableVector<Shape*>        ShapeVector;
-typedef TraceableVector<JSString*>     StringVector;
+typedef GCVector<JSFunction*>   FunctionVector;
+typedef GCVector<PropertyName*> PropertyNameVector;
+typedef GCVector<Shape*>        ShapeVector;
+typedef GCVector<JSString*>     StringVector;
 
 } /* namespace js */
 
 #endif /* gc_Rooting_h */
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -21,17 +21,17 @@
 #include "jit/Linker.h"
 #include "jit/Lowering.h"
 #ifdef JS_ION_PERF
 # include "jit/PerfSpewer.h"
 #endif
 #include "jit/SharedICHelpers.h"
 #include "jit/VMFunctions.h"
 #include "js/Conversions.h"
-#include "js/TraceableVector.h"
+#include "js/GCVector.h"
 #include "vm/Opcodes.h"
 #include "vm/TypedArrayCommon.h"
 
 #include "jsboolinlines.h"
 #include "jsscriptinlines.h"
 
 #include "jit/JitFrames-inl.h"
 #include "jit/MacroAssembler-inl.h"
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -14,17 +14,17 @@
 #include "jsgc.h"
 #include "jsopcode.h"
 
 #include "builtin/TypedObject.h"
 #include "jit/BaselineICList.h"
 #include "jit/BaselineJIT.h"
 #include "jit/SharedIC.h"
 #include "jit/SharedICRegisters.h"
-#include "js/TraceableVector.h"
+#include "js/GCVector.h"
 #include "vm/ArrayObject.h"
 #include "vm/UnboxedObject.h"
 
 namespace js {
 namespace jit {
 
 // WarmUpCounter_Fallback
 
--- a/js/src/jsapi-tests/testGCExactRooting.cpp
+++ b/js/src/jsapi-tests/testGCExactRooting.cpp
@@ -2,18 +2,18 @@
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ds/TraceableFifo.h"
 #include "js/GCHashTable.h"
+#include "js/GCVector.h"
 #include "js/RootingAPI.h"
-#include "js/TraceableVector.h"
 
 #include "jsapi-tests/tests.h"
 
 using namespace js;
 
 BEGIN_TEST(testGCExactRooting)
 {
     JS::RootedObject rootCx(cx, JS_NewPlainObject(cx));
@@ -198,17 +198,17 @@ BEGIN_TEST(testGCHandleHashMap)
     JS_GC(rt);
 
     CHECK(CheckMyHashMap(cx, map));
 
     return true;
 }
 END_TEST(testGCHandleHashMap)
 
-using ShapeVec = TraceableVector<Shape*>;
+using ShapeVec = GCVector<Shape*>;
 
 BEGIN_TEST(testGCRootedVector)
 {
     JS::Rooted<ShapeVec> shapes(cx, ShapeVec(cx));
 
     for (size_t i = 0; i < 10; ++i) {
         RootedObject obj(cx, JS_NewObject(cx, nullptr));
         RootedValue val(cx, UndefinedValue());
@@ -244,37 +244,37 @@ BEGIN_TEST(testGCRootedVector)
     // Ensure rooted converts to handles.
     CHECK(receiveHandleToShapeVector(shapes));
     CHECK(receiveMutableHandleToShapeVector(&shapes));
 
     return true;
 }
 
 bool
-receiveConstRefToShapeVector(const JS::Rooted<TraceableVector<Shape*>>& rooted)
+receiveConstRefToShapeVector(const JS::Rooted<GCVector<Shape*>>& rooted)
 {
     // Ensure range enumeration works through the reference.
     for (auto shape : rooted) {
         CHECK(shape);
     }
     return true;
 }
 
 bool
-receiveHandleToShapeVector(JS::Handle<TraceableVector<Shape*>> handle)
+receiveHandleToShapeVector(JS::Handle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
     for (auto shape : handle) {
         CHECK(shape);
     }
     return true;
 }
 
 bool
-receiveMutableHandleToShapeVector(JS::MutableHandle<TraceableVector<Shape*>> handle)
+receiveMutableHandleToShapeVector(JS::MutableHandle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
     for (auto shape : handle) {
         CHECK(shape);
     }
     return true;
 }
 END_TEST(testGCRootedVector)
@@ -313,17 +313,17 @@ BEGIN_TEST(testTraceableFifo)
         CHECK(shapes.popFront());
     }
 
     CHECK(shapes.empty());
     return true;
 }
 END_TEST(testTraceableFifo)
 
-using ShapeVec = TraceableVector<Shape*>;
+using ShapeVec = GCVector<Shape*>;
 
 static bool
 FillVector(JSContext* cx, MutableHandle<ShapeVec> shapes)
 {
     for (size_t i = 0; i < 10; ++i) {
         RootedObject obj(cx, JS_NewObject(cx, nullptr));
         RootedValue val(cx, UndefinedValue());
         // Construct a unique property name to ensure that the object creates a
--- a/js/src/jsapi-tests/testGCUniqueId.cpp
+++ b/js/src/jsapi-tests/testGCUniqueId.cpp
@@ -2,16 +2,17 @@
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gc/GCInternals.h"
 #include "gc/Zone.h"
+#include "js/GCVector.h"
 
 #include "jsapi-tests/tests.h"
 
 static void
 MinimizeHeap(JSRuntime* rt)
 {
     // The second collection is to force us to wait for the background
     // sweeping that the first GC started to finish.
@@ -76,17 +77,17 @@ BEGIN_TEST(testGCUID)
     CHECK(uintptr_t(obj.get()) == tenuredAddr);
     CHECK(!obj->zone()->hasUniqueId(obj));
     CHECK(obj->zone()->getUniqueId(obj, &tmp));
     CHECK(uid != tmp);
     uid = tmp;
 
     // Allocate a few arenas worth of objects to ensure we get some compaction.
     const static size_t N = 2049;
-    using ObjectVector = js::TraceableVector<JSObject*>;
+    using ObjectVector = js::GCVector<JSObject*>;
     JS::Rooted<ObjectVector> vec(cx, ObjectVector(cx));
     for (size_t i = 0; i < N; ++i) {
         obj = JS_NewPlainObject(cx);
         CHECK(obj);
         CHECK(vec.append(obj));
     }
 
     // Transfer our vector to tenured if it isn't there already.
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -21,21 +21,21 @@
 #include <stdint.h>
 #include <stdio.h>
 
 #include "jsalloc.h"
 #include "jspubtd.h"
 
 #include "js/CallArgs.h"
 #include "js/Class.h"
+#include "js/GCVector.h"
 #include "js/HashTable.h"
 #include "js/Id.h"
 #include "js/Principals.h"
 #include "js/RootingAPI.h"
-#include "js/TraceableVector.h"
 #include "js/TracingAPI.h"
 #include "js/Utility.h"
 #include "js/Value.h"
 #include "js/Vector.h"
 
 /************************************************************************/
 
 namespace JS {
@@ -213,19 +213,19 @@ class MOZ_RAII AutoVectorRooter : public
 
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 typedef AutoVectorRooter<Value> AutoValueVector;
 typedef AutoVectorRooter<jsid> AutoIdVector;
 typedef AutoVectorRooter<JSObject*> AutoObjectVector;
 
-using ValueVector = js::TraceableVector<JS::Value>;
-using IdVector = js::TraceableVector<jsid>;
-using ScriptVector = js::TraceableVector<JSScript*>;
+using ValueVector = js::GCVector<JS::Value>;
+using IdVector = js::GCVector<jsid>;
+using ScriptVector = js::GCVector<JSScript*>;
 
 template<class Key, class Value>
 class MOZ_RAII AutoHashMapRooter : protected AutoGCRooter
 {
   private:
     typedef js::HashMap<Key, Value> HashMapImpl;
 
   public:
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -6,17 +6,17 @@
 
 /* JS execution context. */
 
 #ifndef jscntxt_h
 #define jscntxt_h
 
 #include "mozilla/MemoryReporting.h"
 
-#include "js/TraceableVector.h"
+#include "js/GCVector.h"
 #include "js/Vector.h"
 #include "vm/Runtime.h"
 
 #ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable:4100) /* Silence unreferenced formal parameter warnings */
 #endif
 
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -17,29 +17,29 @@
  */
 
 #include "mozilla/MemoryReporting.h"
 
 #include "gc/Barrier.h"
 #include "gc/Marking.h"
 #include "js/Conversions.h"
 #include "js/GCAPI.h"
+#include "js/GCVector.h"
 #include "js/HeapAPI.h"
-#include "js/TraceableVector.h"
 #include "vm/Shape.h"
 #include "vm/String.h"
 #include "vm/Xdr.h"
 
 namespace JS {
 struct ClassInfo;
 } // namespace JS
 
 namespace js {
 
-using PropertyDescriptorVector = TraceableVector<PropertyDescriptor>;
+using PropertyDescriptorVector = GCVector<PropertyDescriptor>;
 class GCMarker;
 class Nursery;
 
 namespace gc {
 class RelocationOverlay;
 } // namespace gc
 
 inline JSObject*
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -106,31 +106,31 @@ EXPORTS.js += [
     '../public/CallNonGenericMethod.h',
     '../public/CharacterEncoding.h',
     '../public/Class.h',
     '../public/Conversions.h',
     '../public/Date.h',
     '../public/Debug.h',
     '../public/GCAPI.h',
     '../public/GCHashTable.h',
+    '../public/GCVector.h',
     '../public/HashTable.h',
     '../public/HeapAPI.h',
     '../public/Id.h',
     '../public/Initialization.h',
     '../public/LegacyIntTypes.h',
     '../public/MemoryMetrics.h',
     '../public/Principals.h',
     '../public/ProfilingFrameIterator.h',
     '../public/ProfilingStack.h',
     '../public/Proxy.h',
     '../public/RequiredDefines.h',
     '../public/RootingAPI.h',
     '../public/SliceBudget.h',
     '../public/StructuredClone.h',
-    '../public/TraceableVector.h',
     '../public/TraceKind.h',
     '../public/TracingAPI.h',
     '../public/TrackedOptimizationInfo.h',
     '../public/TypeDecls.h',
     '../public/UbiNode.h',
     '../public/UbiNodeBreadthFirst.h',
     '../public/UbiNodeCensus.h',
     '../public/UbiNodeDominatorTree.h',
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -28,21 +28,21 @@
 #endif
 #include "builtin/AtomicsObject.h"
 #include "ds/FixedSizeHash.h"
 #include "frontend/ParseMaps.h"
 #include "gc/GCRuntime.h"
 #include "gc/Tracer.h"
 #include "irregexp/RegExpStack.h"
 #include "js/Debug.h"
+#include "js/GCVector.h"
 #include "js/HashTable.h"
 #ifdef DEBUG
 # include "js/Proxy.h" // For AutoEnterPolicy
 #endif
-#include "js/TraceableVector.h"
 #include "js/Vector.h"
 #include "vm/CodeCoverage.h"
 #include "vm/CommonPropertyNames.h"
 #include "vm/DateTime.h"
 #include "vm/MallocProvider.h"
 #include "vm/SPSProfiler.h"
 #include "vm/Stack.h"
 #include "vm/Stopwatch.h"
@@ -141,17 +141,17 @@ struct ScopeCoordinateNameCache {
 
     Shape* shape;
     Map map;
 
     ScopeCoordinateNameCache() : shape(nullptr) {}
     void purge();
 };
 
-using ScriptAndCountsVector = TraceableVector<ScriptAndCounts, 0, SystemAllocPolicy>;
+using ScriptAndCountsVector = GCVector<ScriptAndCounts, 0, SystemAllocPolicy>;
 
 struct EvalCacheEntry
 {
     JSLinearString* str;
     JSScript* script;
     JSScript* callerScript;
     jsbytecode* pc;
 };
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -1131,17 +1131,17 @@ static_assert(sizeof(PropertyName) == si
               "string subclasses must be binary-compatible with JSString");
 
 static MOZ_ALWAYS_INLINE jsid
 NameToId(PropertyName* name)
 {
     return NON_INTEGER_ATOM_TO_JSID(name);
 }
 
-using PropertyNameVector = js::TraceableVector<PropertyName*>;
+using PropertyNameVector = js::GCVector<PropertyName*>;
 
 template <typename CharT>
 void
 CopyChars(CharT* dest, const JSLinearString& str);
 
 static inline UniqueChars
 StringToNewUTF8CharsZ(ExclusiveContext* maybecx, JSString& str)
 {