Bug 1486782 - Remove unnecessary includes of gc/Zone.h r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 30 Aug 2018 20:10:21 +0100
changeset 434112 fcae304349d841a9bb2850c59dcc70680b857aa7
parent 434111 7d07908ee08acfa5333806b907bce7fb20c59dc1
child 434113 498b35c45ec1e50d5f98bcc2ac49c90357c920a2
push id107269
push userjcoppeard@mozilla.com
push dateThu, 30 Aug 2018 19:11:17 +0000
treeherdermozilla-inbound@fcae304349d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1486782
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1486782 - Remove unnecessary includes of gc/Zone.h r=sfink
js/src/ctypes/CTypes.cpp
js/src/frontend/BinToken.cpp
js/src/frontend/BinTokenReaderBase.cpp
js/src/frontend/BinTokenReaderMultipart.cpp
js/src/frontend/BinTokenReaderTester.cpp
js/src/frontend/TokenStream.h
js/src/gc/GCInternals.h
js/src/gc/WeakMap-inl.h
js/src/jsapi-tests/testBinASTReader.cpp
js/src/jsapi-tests/testBinTokenReaderTester.cpp
js/src/jsapi-tests/testGCUniqueId.cpp
js/src/jsapi-tests/testGCWeakRef.cpp
js/src/jsapi-tests/testIsInsideNursery.cpp
js/src/jsfriendapi.cpp
js/src/shell/js.cpp
js/src/vm/Compartment.cpp
js/src/vm/Compartment.h
js/src/vm/GlobalObject.h
js/src/vm/ObjectGroup.cpp
js/src/vm/Realm.h
js/src/vm/RegExpConstants.h
js/src/vm/RegExpShared.h
js/src/vm/UnboxedObject.h
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -33,17 +33,16 @@
 
 #include "jsexn.h"
 #include "jsnum.h"
 
 #include "builtin/TypedObject.h"
 #include "ctypes/Library.h"
 #include "gc/FreeOp.h"
 #include "gc/Policy.h"
-#include "gc/Zone.h"
 #include "jit/AtomicOperations.h"
 #include "js/AutoByteString.h"
 #include "js/StableStringChars.h"
 #include "js/UniquePtr.h"
 #include "js/Vector.h"
 #include "util/Windows.h"
 #include "vm/JSContext.h"
 #include "vm/JSFunction.h"
--- a/js/src/frontend/BinToken.cpp
+++ b/js/src/frontend/BinToken.cpp
@@ -7,18 +7,18 @@
 #include "frontend/BinToken.h"
 
 #include "mozilla/Maybe.h"
 
 #include <sys/types.h>
 
 #include "frontend/BinSourceRuntimeSupport.h"
 #include "frontend/TokenStream.h"
-#include "gc/Zone.h"
 #include "js/Result.h"
+#include "vm/Runtime.h"
 
 namespace js {
 namespace frontend {
 
 const BinaryASTSupport::CharSlice BINKIND_DESCRIPTIONS[] = {
 #define WITH_VARIANT(_, SPEC_NAME) BinaryASTSupport::CharSlice(SPEC_NAME, sizeof(SPEC_NAME) - 1),
     FOR_EACH_BIN_KIND(WITH_VARIANT)
 #undef WITH_VARIANT
--- a/js/src/frontend/BinTokenReaderBase.cpp
+++ b/js/src/frontend/BinTokenReaderBase.cpp
@@ -2,17 +2,16 @@
  * 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 "frontend/BinTokenReaderBase.h"
 
 #include "frontend/BinSource-macros.h"
-#include "gc/Zone.h"
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 template<typename T> using ErrorResult = mozilla::GenericErrorResult<T>;
 
 // We use signalling NaN (which doesn't exist in the JS syntax)
--- a/js/src/frontend/BinTokenReaderMultipart.cpp
+++ b/js/src/frontend/BinTokenReaderMultipart.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/EndianUtils.h"
 #include "mozilla/Maybe.h"
 
 #include <utility>
 
 #include "frontend/BinSource-macros.h"
 #include "frontend/BinSourceRuntimeSupport.h"
 
-#include "gc/Zone.h"
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 // The magic header, at the start of every binjs file.
 const char MAGIC_HEADER[] = "BINJS";
 // The latest format version understood by this tokenizer.
--- a/js/src/frontend/BinTokenReaderTester.cpp
+++ b/js/src/frontend/BinTokenReaderTester.cpp
@@ -8,17 +8,16 @@
 #include "frontend/BinTokenReaderTester.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Casting.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/PodOperations.h"
 
 #include "frontend/BinSource-macros.h"
-#include "gc/Zone.h"
 #include "js/Result.h"
 
 namespace js {
 namespace frontend {
 
 using BinFields = BinTokenReaderTester::BinFields;
 using AutoList = BinTokenReaderTester::AutoList;
 using AutoTaggedTuple = BinTokenReaderTester::AutoTaggedTuple;
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -205,17 +205,19 @@
 #include "frontend/ErrorReporter.h"
 #include "frontend/TokenKind.h"
 #include "js/CompileOptions.h"
 #include "js/UniquePtr.h"
 #include "js/Vector.h"
 #include "util/Text.h"
 #include "util/Unicode.h"
 #include "vm/ErrorReporting.h"
-#include "vm/RegExpShared.h"
+#include "vm/JSAtom.h"
+#include "vm/RegExpConstants.h"
+#include "vm/StringType.h"
 
 struct JSContext;
 struct KeywordInfo;
 
 namespace js {
 
 class AutoKeepAtoms;
 
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -11,17 +11,16 @@
 #ifndef gc_GCInternals_h
 #define gc_GCInternals_h
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Maybe.h"
 
 #include "gc/GC.h"
 #include "gc/RelocationOverlay.h"
-#include "gc/Zone.h"
 #include "vm/HelperThreads.h"
 #include "vm/Runtime.h"
 
 namespace js {
 namespace gc {
 
 class MOZ_RAII AutoCheckCanAccessAtomsDuringGC
 {
@@ -316,14 +315,14 @@ DelayCrossCompartmentGrayMarking(JSObjec
 inline bool
 IsOOMReason(JS::gcreason::Reason reason)
 {
     return reason == JS::gcreason::LAST_DITCH ||
            reason == JS::gcreason::MEM_PRESSURE;
 }
 
 TenuredCell*
-AllocateCellInGC(Zone* zone, AllocKind thingKind);
+AllocateCellInGC(JS::Zone* zone, AllocKind thingKind);
 
 } /* namespace gc */
 } /* namespace js */
 
 #endif /* gc_GCInternals_h */
--- a/js/src/gc/WeakMap-inl.h
+++ b/js/src/gc/WeakMap-inl.h
@@ -4,17 +4,16 @@
  * 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 gc_WeakMap_inl_h
 #define gc_WeakMap_inl_h
 
 #include "gc/WeakMap.h"
 
-#include "gc/Zone.h"
 #include "vm/JSContext.h"
 
 namespace js {
 
 template <typename T>
 static T extractUnbarriered(const WriteBarrieredBase<T>& v)
 {
     return v.get();
--- a/js/src/jsapi-tests/testBinASTReader.cpp
+++ b/js/src/jsapi-tests/testBinASTReader.cpp
@@ -22,17 +22,16 @@
 #include "mozilla/Maybe.h"
 
 #include "jsapi.h"
 
 #include "frontend/BinSource.h"
 #include "frontend/FullParseHandler.h"
 #include "frontend/ParseContext.h"
 #include "frontend/Parser.h"
-#include "gc/Zone.h"
 #include "js/Vector.h"
 
 #include "jsapi-tests/tests.h"
 
 #include "vm/Interpreter.h"
 
 using UsedNameTracker = js::frontend::UsedNameTracker;
 using namespace JS;
--- a/js/src/jsapi-tests/testBinTokenReaderTester.cpp
+++ b/js/src/jsapi-tests/testBinTokenReaderTester.cpp
@@ -13,17 +13,16 @@
 #elif defined(XP_UNIX)
 #include <fcntl.h>
 #include <unistd.h>
 #endif // defined (XP_WIN) || defined (XP_UNIX)
 
 #include "mozilla/Maybe.h"
 
 #include "frontend/BinTokenReaderTester.h"
-#include "gc/Zone.h"
 
 #include "js/Vector.h"
 
 #include "jsapi-tests/tests.h"
 
 using mozilla::Maybe;
 
 using Tokenizer = js::frontend::BinTokenReaderTester;
--- a/js/src/jsapi-tests/testGCUniqueId.cpp
+++ b/js/src/jsapi-tests/testGCUniqueId.cpp
@@ -1,17 +1,16 @@
 /* -*- 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/. */
 
 #include "gc/GCInternals.h"
-#include "gc/Zone.h"
 #include "js/GCVector.h"
 
 #include "jsapi-tests/tests.h"
 
 #include "gc/Zone-inl.h"
 
 static void
 MinimizeHeap(JSContext* cx)
--- a/js/src/jsapi-tests/testGCWeakRef.cpp
+++ b/js/src/jsapi-tests/testGCWeakRef.cpp
@@ -1,17 +1,16 @@
 /* -*- 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/. */
 
 #include "gc/Barrier.h"
-#include "gc/Zone.h"
 #include "js/RootingAPI.h"
 
 #include "jsapi-tests/tests.h"
 
 struct MyHeap
 {
     explicit MyHeap(JSObject* obj) : weak(obj) {}
     js::WeakRef<JSObject*> weak;
--- a/js/src/jsapi-tests/testIsInsideNursery.cpp
+++ b/js/src/jsapi-tests/testIsInsideNursery.cpp
@@ -1,16 +1,15 @@
 /* -*- 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/. */
 
-#include "gc/Zone.h"
 #include "jsapi-tests/tests.h"
 
 #include "vm/JSContext-inl.h"
 
 BEGIN_TEST(testIsInsideNursery)
 {
     /* Non-GC things are never inside the nursery. */
     CHECK(!cx->nursery().isInside(cx));
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -214,17 +214,17 @@ js::GetScriptRealm(JSScript* script)
 
 JS_FRIEND_API(bool)
 JS_ScriptHasMutedErrors(JSScript* script)
 {
     return script->mutedErrors();
 }
 
 JS_FRIEND_API(bool)
-JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc)
+JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<JS::PropertyDescriptor> desc)
 {
     return cx->compartment()->wrap(cx, desc);
 }
 
 JS_FRIEND_API(void)
 JS_TraceShapeCycleCollectorChildren(JS::CallbackTracer* trc, JS::GCCellPtr shape)
 {
     MOZ_ASSERT(shape.is<Shape>());
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -66,17 +66,16 @@
 #include "builtin/ModuleObject.h"
 #include "builtin/RegExp.h"
 #include "builtin/TestingFunctions.h"
 #if defined(JS_BUILD_BINAST)
 # include "frontend/BinSource.h"
 #endif // defined(JS_BUILD_BINAST)
 #include "frontend/Parser.h"
 #include "gc/PublicIterators.h"
-#include "gc/Zone.h"
 #include "jit/arm/Simulator-arm.h"
 #include "jit/InlinableNatives.h"
 #include "jit/Ion.h"
 #include "jit/JitcodeMap.h"
 #include "jit/JitRealm.h"
 #include "jit/shared/CodeGenerator-shared.h"
 #include "js/AutoByteString.h"
 #include "js/CompilationAndEvaluation.h"
@@ -4305,17 +4304,17 @@ EnsureModuleLoaderScriptObjectMap(JSCont
 {
     auto priv = EnsureShellCompartmentPrivate(cx);
     if (!priv)
         return nullptr;
 
     if (priv->moduleLoaderScriptObjectMap)
         return priv->moduleLoaderScriptObjectMap.get();
 
-    Zone* zone = cx->zone();
+    JS::Zone* zone = cx->zone();
     auto* map = cx->new_<ScriptObjectMap>(zone);
     if (!map)
         return nullptr;
 
     priv->moduleLoaderScriptObjectMap.reset(map);
     return map;
 }
 
--- a/js/src/vm/Compartment.cpp
+++ b/js/src/vm/Compartment.cpp
@@ -343,17 +343,17 @@ Compartment::rewrap(JSContext* cx, Mutab
     // not need to create or return an existing wrapper.
     if (obj->compartment() == this)
         return true;
 
     return getOrCreateWrapper(cx, existing, obj);
 }
 
 bool
-Compartment::wrap(JSContext* cx, MutableHandle<PropertyDescriptor> desc)
+Compartment::wrap(JSContext* cx, MutableHandle<JS::PropertyDescriptor> desc)
 {
     if (!wrap(cx, desc.object()))
         return false;
 
     if (desc.hasGetterObject()) {
         if (!wrap(cx, desc.getterObject()))
             return false;
     }
--- a/js/src/vm/Compartment.h
+++ b/js/src/vm/Compartment.h
@@ -12,23 +12,24 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/Variant.h"
 
 #include <stddef.h>
 
 #include "gc/Barrier.h"
 #include "gc/NurseryAwareHashMap.h"
-#include "gc/Zone.h"
 #include "js/UniquePtr.h"
+#include "vm/JSObject.h"
+#include "vm/JSScript.h"
 
 namespace js {
 
 namespace gc {
-template <typename Node, typename Derived> class ComponentFinder;
+struct ZoneComponentFinder;
 } // namespace gc
 
 class CrossCompartmentKey
 {
   public:
     enum DebuggerObjectKind : uint8_t { DebuggerSource, DebuggerEnvironment, DebuggerObject,
                                         DebuggerWasmScript, DebuggerWasmSource };
     using DebuggerAndObject = mozilla::Tuple<NativeObject*, JSObject*, DebuggerObjectKind>;
@@ -441,17 +442,17 @@ class JS::Compartment
 
     MOZ_MUST_USE inline bool wrap(JSContext* cx, JS::MutableHandleValue vp);
 
     MOZ_MUST_USE bool wrap(JSContext* cx, js::MutableHandleString strp);
 #ifdef ENABLE_BIGINT
     MOZ_MUST_USE bool wrap(JSContext* cx, js::MutableHandle<JS::BigInt*> bi);
 #endif
     MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandleObject obj);
-    MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc);
+    MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<JS::PropertyDescriptor> desc);
     MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<JS::GCVector<JS::Value>> vec);
     MOZ_MUST_USE bool rewrap(JSContext* cx, JS::MutableHandleObject obj, JS::HandleObject existing);
 
     MOZ_MUST_USE bool putWrapper(JSContext* cx, const js::CrossCompartmentKey& wrapped,
                                  const js::Value& wrapper);
 
     js::WrapperMap::Ptr lookupWrapper(const js::Value& wrapped) const {
         return crossCompartmentWrappers.lookup(js::CrossCompartmentKey(wrapped));
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -12,24 +12,24 @@
 
 #include "builtin/Array.h"
 #include "builtin/Boolean.h"
 #include "js/Vector.h"
 #include "vm/ArrayBufferObject.h"
 #include "vm/ErrorObject.h"
 #include "vm/JSFunction.h"
 #include "vm/Realm.h"
-#include "vm/RegExpStatics.h"
 #include "vm/Runtime.h"
 
 namespace js {
 
 class Debugger;
 class TypedObjectModuleObject;
 class LexicalEnvironmentObject;
+class RegExpStatics;
 
 /*
  * Global object slots are reserved as follows:
  *
  * [0, APPLICATION_SLOTS)
  *   Pre-reserved slots in all global objects set aside for the embedding's
  *   use. As with all reserved slots these start out as UndefinedValue() and
  *   are traced for GC purposes. Apart from that the engine never touches
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -11,17 +11,16 @@
 
 #include "jsexn.h"
 
 #include "builtin/DataViewObject.h"
 #include "gc/FreeOp.h"
 #include "gc/HashUtil.h"
 #include "gc/Policy.h"
 #include "gc/StoreBuffer.h"
-#include "gc/Zone.h"
 #include "js/CharacterEncoding.h"
 #include "js/UniquePtr.h"
 #include "vm/ArrayObject.h"
 #include "vm/JSObject.h"
 #include "vm/RegExpObject.h"
 #include "vm/Shape.h"
 #include "vm/TaggedProto.h"
 
--- a/js/src/vm/Realm.h
+++ b/js/src/vm/Realm.h
@@ -15,17 +15,16 @@
 #include "mozilla/Tuple.h"
 #include "mozilla/Variant.h"
 #include "mozilla/XorShift128PlusRNG.h"
 
 #include <stddef.h>
 
 #include "builtin/Array.h"
 #include "gc/Barrier.h"
-#include "gc/Zone.h"
 #include "js/UniquePtr.h"
 #include "vm/ArrayBufferObject.h"
 #include "vm/Compartment.h"
 #include "vm/ReceiverGuard.h"
 #include "vm/RegExpShared.h"
 #include "vm/SavedStacks.h"
 #include "vm/Time.h"
 #include "wasm/WasmRealm.h"
new file mode 100644
--- /dev/null
+++ b/js/src/vm/RegExpConstants.h
@@ -0,0 +1,42 @@
+/* -*- 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 vm_RegExpConstants_h
+#define vm_RegExpConstants_h
+
+#include "builtin/SelfHostingDefines.h"
+
+namespace js {
+
+enum RegExpFlag : uint8_t
+{
+    IgnoreCaseFlag  = 0x01,
+    GlobalFlag      = 0x02,
+    MultilineFlag   = 0x04,
+    StickyFlag      = 0x08,
+    UnicodeFlag     = 0x10,
+
+    NoFlags         = 0x00,
+    AllFlags        = 0x1f
+};
+
+static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
+              GlobalFlag == REGEXP_GLOBAL_FLAG &&
+              MultilineFlag == REGEXP_MULTILINE_FLAG &&
+              StickyFlag == REGEXP_STICKY_FLAG &&
+              UnicodeFlag == REGEXP_UNICODE_FLAG,
+              "Flag values should be in sync with self-hosted JS");
+
+enum RegExpRunStatus
+{
+    RegExpRunStatus_Error,
+    RegExpRunStatus_Success,
+    RegExpRunStatus_Success_NotFound
+};
+
+} /* namespace js */
+
+#endif /* vm_RegExpConstants_h */
--- a/js/src/vm/RegExpShared.h
+++ b/js/src/vm/RegExpShared.h
@@ -10,65 +10,39 @@
  */
 
 #ifndef vm_RegExpShared_h
 #define vm_RegExpShared_h
 
 #include "mozilla/Assertions.h"
 #include "mozilla/MemoryReporting.h"
 
-#include "builtin/SelfHostingDefines.h"
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
 #include "gc/Marking.h"
 #include "gc/Zone.h"
 #include "js/AllocPolicy.h"
 #include "js/UbiNode.h"
 #include "js/Vector.h"
 #include "vm/ArrayObject.h"
 #include "vm/JSAtom.h"
+#include "vm/RegExpConstants.h"
 
 namespace js {
 
 class ArrayObject;
 class RegExpRealm;
 class RegExpShared;
 class RegExpStatics;
 class VectorMatchPairs;
 
 using RootedRegExpShared = JS::Rooted<RegExpShared*>;
 using HandleRegExpShared = JS::Handle<RegExpShared*>;
 using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
 
-enum RegExpFlag : uint8_t
-{
-    IgnoreCaseFlag  = 0x01,
-    GlobalFlag      = 0x02,
-    MultilineFlag   = 0x04,
-    StickyFlag      = 0x08,
-    UnicodeFlag     = 0x10,
-
-    NoFlags         = 0x00,
-    AllFlags        = 0x1f
-};
-
-static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
-              GlobalFlag == REGEXP_GLOBAL_FLAG &&
-              MultilineFlag == REGEXP_MULTILINE_FLAG &&
-              StickyFlag == REGEXP_STICKY_FLAG &&
-              UnicodeFlag == REGEXP_UNICODE_FLAG,
-              "Flag values should be in sync with self-hosted JS");
-
-enum RegExpRunStatus
-{
-    RegExpRunStatus_Error,
-    RegExpRunStatus_Success,
-    RegExpRunStatus_Success_NotFound
-};
-
 /*
  * A RegExpShared is the compiled representation of a regexp. A RegExpShared is
  * potentially pointed to by multiple RegExpObjects. Additionally, C++ code may
  * have pointers to RegExpShareds on the stack. The RegExpShareds are kept in a
  * table so that they can be reused when compiling the same regex string.
  *
  * To save memory, a RegExpShared is not created for a RegExpObject until it is
  * needed for execution. When a RegExpShared needs to be created, it is looked
--- a/js/src/vm/UnboxedObject.h
+++ b/js/src/vm/UnboxedObject.h
@@ -3,17 +3,16 @@
  * 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 vm_UnboxedObject_h
 #define vm_UnboxedObject_h
 
 #include "gc/DeletePolicy.h"
-#include "gc/Zone.h"
 #include "vm/JSObject.h"
 #include "vm/Runtime.h"
 #include "vm/TypeInference.h"
 
 namespace js {
 
 // Memory required for an unboxed value of a given type. Returns zero for types
 // which can't be used for unboxed objects.
@@ -54,17 +53,17 @@ class UnboxedLayout : public mozilla::Li
         Property()
           : name(nullptr), offset(UINT32_MAX), type(JSVAL_TYPE_MAGIC)
         {}
     };
 
     typedef Vector<Property, 0, SystemAllocPolicy> PropertyVector;
 
   private:
-    Zone* zone_;
+    JS::Zone* zone_;
 
     // If objects in this group have ever been converted to native objects,
     // these store the corresponding native group and initial shape for such
     // objects. Type information for this object is reflected in nativeGroup.
     GCPtrObjectGroup nativeGroup_;
     GCPtrShape nativeShape_;
 
     // Any script/pc which the associated group is created for.
@@ -94,23 +93,23 @@ class UnboxedLayout : public mozilla::Li
     int32_t* traceList_;
 
     // If this layout has been used to construct script or JSON constant
     // objects, this code might be filled in to more quickly fill in objects
     // from an array of values.
     GCPtrJitCode constructorCode_;
 
   public:
-    explicit UnboxedLayout(Zone* zone)
+    explicit UnboxedLayout(JS::Zone* zone)
       : zone_(zone), nativeGroup_(nullptr), nativeShape_(nullptr),
         allocationScript_(nullptr), allocationPc_(nullptr), replacementGroup_(nullptr),
         size_(0), newScript_(nullptr), traceList_(nullptr), constructorCode_(nullptr)
     {}
 
-    Zone* zone() const { return zone_; }
+    JS::Zone* zone() const { return zone_; }
 
     bool initProperties(const PropertyVector& properties, size_t size) {
         size_ = size;
         return properties_.appendAll(properties);
     }
 
     ~UnboxedLayout() {
         if (newScript_)