Bug 1573844 - Remove external references to js::Class r=mccr8
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 14 Aug 2019 17:15:15 +0000
changeset 488204 d8a479850f5903711dba26c4cbd9631baea8f844
parent 488203 3c8af6860ce4722fc04ff6808799a1c75a49147d
child 488205 c034401401c23f041958b032f5dad95ab382c228
push id113904
push userncsoregi@mozilla.com
push dateThu, 15 Aug 2019 19:41:00 +0000
treeherdermozilla-inbound@b283a7ef186c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1573844
milestone70.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 1573844 - Remove external references to js::Class r=mccr8 Depends on D41985 Differential Revision: https://phabricator.services.mozilla.com/D41986
docshell/base/BrowsingContext.cpp
dom/base/RemoteOuterWindowProxy.cpp
dom/base/nsGlobalWindowInner.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/DOMJSClass.h
dom/bindings/DOMJSProxyHandler.h
dom/bindings/RemoteObjectProxy.cpp
dom/bindings/RemoteObjectProxy.h
dom/bindings/SimpleGlobalObject.cpp
dom/plugins/base/nsJSNPRuntime.cpp
js/xpconnect/idl/nsIXPCScriptable.idl
js/xpconnect/public/xpc_make_class.h
js/xpconnect/public/xpc_map_end.h
js/xpconnect/src/Sandbox.cpp
js/xpconnect/src/XPCCallContext.cpp
js/xpconnect/src/XPCJSID.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCWrappedNativeJSOps.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/xpcprivate.h
js/xpconnect/wrappers/AccessCheck.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/base/CycleCollectedJSRuntime.h
--- a/docshell/base/BrowsingContext.cpp
+++ b/docshell/base/BrowsingContext.cpp
@@ -747,17 +747,17 @@ class RemoteLocationProxy
 };
 
 static const RemoteLocationProxy sSingleton;
 
 // Give RemoteLocationProxy 2 reserved slots, like the other wrappers,
 // so JSObject::swap can swap it with CrossCompartmentWrappers without requiring
 // malloc.
 template <>
-const js::Class RemoteLocationProxy::Base::sClass =
+const JSClass RemoteLocationProxy::Base::sClass =
     PROXY_CLASS_DEF("Proxy", JSCLASS_HAS_RESERVED_SLOTS(2));
 
 void BrowsingContext::Location(JSContext* aCx,
                                JS::MutableHandle<JSObject*> aLocation,
                                ErrorResult& aError) {
   aError.MightThrowJSException();
   sSingleton.GetProxyObject(aCx, &mLocation, /* aTransplantTo = */ nullptr,
                             aLocation);
--- a/dom/base/RemoteOuterWindowProxy.cpp
+++ b/dom/base/RemoteOuterWindowProxy.cpp
@@ -53,17 +53,17 @@ class RemoteOuterWindowProxy
 };
 
 static const RemoteOuterWindowProxy sSingleton;
 
 // Give RemoteOuterWindowProxy 2 reserved slots, like the other wrappers,
 // so JSObject::swap can swap it with CrossCompartmentWrappers without requiring
 // malloc.
 template <>
-const js::Class RemoteOuterWindowProxy::Base::sClass =
+const JSClass RemoteOuterWindowProxy::Base::sClass =
     PROXY_CLASS_DEF("Proxy", JSCLASS_HAS_RESERVED_SLOTS(2));
 
 bool GetRemoteOuterWindowProxy(JSContext* aCx, BrowsingContext* aContext,
                                JS::Handle<JSObject*> aTransplantTo,
                                JS::MutableHandle<JSObject*> aRetVal) {
   MOZ_ASSERT(!aContext->GetDocShell(),
              "Why are we creating a RemoteOuterWindowProxy?");
 
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -148,17 +148,17 @@ extern already_AddRefed<nsIScriptTimeout
     mozilla::dom::Function& aFunction,
     const mozilla::dom::Sequence<JS::Value>& aArguments,
     mozilla::ErrorResult& aError);
 
 extern already_AddRefed<nsIScriptTimeoutHandler> NS_CreateJSTimeoutHandler(
     JSContext* aCx, nsGlobalWindowInner* aWindow, const nsAString& aExpression,
     mozilla::ErrorResult& aError);
 
-extern const js::Class OuterWindowProxyClass;
+extern const JSClass OuterWindowProxyClass;
 
 //*****************************************************************************
 // nsGlobalWindowInner: Global Object for Scripting
 //*****************************************************************************
 
 // nsGlobalWindowInner inherits PRCList for maintaining a list of all inner
 // windows still in memory for any given outer window. This list is needed to
 // ensure that mOuterWindow doesn't end up dangling. The nature of PRCList means
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -342,17 +342,17 @@ nsPIDOMWindowOuter* nsPIDOMWindowOuter::
 
 // Give OuterWindowProxyClass 2 reserved slots, like the other wrappers, so
 // JSObject::swap can swap it with CrossCompartmentWrappers without requiring
 // malloc.
 //
 // We store the nsGlobalWindowOuter* in our first slot.
 //
 // We store our holder weakmap in the second slot.
-const js::Class OuterWindowProxyClass = PROXY_CLASS_DEF(
+const JSClass OuterWindowProxyClass = PROXY_CLASS_DEF(
     "Proxy", JSCLASS_HAS_RESERVED_SLOTS(2)); /* additional class flags */
 
 static const size_t OUTER_WINDOW_SLOT = 0;
 static const size_t HOLDER_WEAKMAP_SLOT = 1;
 
 class nsOuterWindowProxy : public MaybeCrossOriginObject<js::Wrapper> {
   typedef MaybeCrossOriginObject<js::Wrapper> Base;
 
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -135,17 +135,17 @@ extern already_AddRefed<nsIScriptTimeout
     mozilla::dom::Function& aFunction,
     const mozilla::dom::Sequence<JS::Value>& aArguments,
     mozilla::ErrorResult& aError);
 
 extern already_AddRefed<nsIScriptTimeoutHandler> NS_CreateJSTimeoutHandler(
     JSContext* aCx, nsGlobalWindowInner* aWindow, const nsAString& aExpression,
     mozilla::ErrorResult& aError);
 
-extern const js::Class OuterWindowProxyClass;
+extern const JSClass OuterWindowProxyClass;
 
 //*****************************************************************************
 // nsGlobalWindowOuter
 //*****************************************************************************
 
 // nsGlobalWindowOuter inherits PRCList for maintaining a list of all inner
 // windows still in memory for any given outer window. This list is needed to
 // ensure that mOuterWindow doesn't end up dangling. The nature of PRCList means
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -672,17 +672,17 @@ bool DefineUnforgeableAttributes(JSConte
 
 // We should use JSFunction objects for interface objects, but we need a custom
 // hasInstance hook because we have new interface objects on prototype chains of
 // old (XPConnect-based) bindings. We also need Xrays and arbitrary numbers of
 // reserved slots (e.g. for named constructors).  So we define a custom
 // funToString ObjectOps member for interface objects.
 JSString* InterfaceObjectToString(JSContext* aCx, JS::Handle<JSObject*> aObject,
                                   bool /* isToSource */) {
-  const js::Class* clasp = js::GetObjectClass(aObject);
+  const JSClass* clasp = js::GetObjectClass(aObject);
   MOZ_ASSERT(IsDOMIfaceAndProtoClass(clasp));
 
   const DOMIfaceAndProtoJSClass* ifaceAndProtoJSClass =
       DOMIfaceAndProtoJSClass::FromJSClass(clasp);
   return JS_NewStringCopyZ(aCx, ifaceAndProtoJSClass->mToString);
 }
 
 bool Constructor(JSContext* cx, unsigned argc, JS::Value* vp) {
@@ -721,17 +721,17 @@ static bool DefineConstructor(JSContext*
 
   // This is Enumerable: False per spec.
   return alreadyDefined ||
          JS_DefineProperty(cx, global, name, constructor, JSPROP_RESOLVING);
 }
 
 static JSObject* CreateInterfaceObject(
     JSContext* cx, JS::Handle<JSObject*> global,
-    JS::Handle<JSObject*> constructorProto, const js::Class* constructorClass,
+    JS::Handle<JSObject*> constructorProto, const JSClass* constructorClass,
     unsigned ctorNargs, const NamedConstructor* namedConstructors,
     JS::Handle<JSObject*> proto, const NativeProperties* properties,
     const NativeProperties* chromeOnlyProperties, const char* name,
     bool isChrome, bool defineOnGlobal,
     const char* const* legacyWindowAliases) {
   JS::Rooted<JSObject*> constructor(cx);
   MOZ_ASSERT(constructorProto);
   MOZ_ASSERT(constructorClass);
@@ -850,17 +850,17 @@ static JSObject* CreateInterfaceObject(
     }
   }
 
   return constructor;
 }
 
 static JSObject* CreateInterfacePrototypeObject(
     JSContext* cx, JS::Handle<JSObject*> global,
-    JS::Handle<JSObject*> parentProto, const js::Class* protoClass,
+    JS::Handle<JSObject*> parentProto, const JSClass* protoClass,
     const NativeProperties* properties,
     const NativeProperties* chromeOnlyProperties,
     const char* const* unscopableNames, const char* toStringTag,
     bool isGlobal) {
   JS::Rooted<JSObject*> ourProto(
       cx, JS_NewObjectWithUniqueType(cx, protoClass, parentProto));
   if (!ourProto ||
       // We don't try to define properties on the global's prototype; those
@@ -948,19 +948,19 @@ bool DefineProperties(JSContext* cx, JS:
     }
   }
 
   return true;
 }
 
 void CreateInterfaceObjects(
     JSContext* cx, JS::Handle<JSObject*> global,
-    JS::Handle<JSObject*> protoProto, const js::Class* protoClass,
+    JS::Handle<JSObject*> protoProto, const JSClass* protoClass,
     JS::Heap<JSObject*>* protoCache, const char* toStringTag,
-    JS::Handle<JSObject*> constructorProto, const js::Class* constructorClass,
+    JS::Handle<JSObject*> constructorProto, const JSClass* constructorClass,
     unsigned ctorNargs, const NamedConstructor* namedConstructors,
     JS::Heap<JSObject*>* constructorCache, const NativeProperties* properties,
     const NativeProperties* chromeOnlyProperties, const char* name,
     bool defineOnGlobal, const char* const* unscopableNames, bool isGlobal,
     const char* const* legacyWindowAliases) {
   MOZ_ASSERT(protoClass || constructorClass, "Need at least one class!");
   MOZ_ASSERT(
       !((properties &&
@@ -1102,17 +1102,17 @@ bool TryPreserveWrapper(JS::Handle<JSObj
   }
 
   JS::Rooted<jsid> dummyId(RootingCx());
   JS::Rooted<JS::Value> dummyValue(RootingCx());
   return addProperty(nullptr, obj, dummyId, dummyValue);
 }
 
 // Can only be called with a DOM JSClass.
-bool InstanceClassHasProtoAtDepth(const js::Class* clasp, uint32_t protoID,
+bool InstanceClassHasProtoAtDepth(const JSClass* clasp, uint32_t protoID,
                                   uint32_t depth) {
   const DOMJSClass* domClass = DOMJSClass::FromJSClass(clasp);
   return static_cast<uint32_t>(domClass->mInterfaceChain[depth]) == protoID;
 }
 
 // Only set allowNativeWrapper to false if you really know you need it; if in
 // doubt use true. Setting it to false disables security wrappers.
 bool XPCOMObjectToJsval(JSContext* cx, JS::Handle<JSObject*> scope,
@@ -1321,17 +1321,17 @@ inline const NativePropertyHooks* GetNat
       obj, CONSTRUCTOR_NATIVE_HOLDER_RESERVED_SLOT);
   const JSNativeHolder* nativeHolder =
       static_cast<const JSNativeHolder*>(v.toPrivate());
   return nativeHolder->mPropertyHooks;
 }
 
 inline const NativePropertyHooks* GetNativePropertyHooks(
     JSContext* cx, JS::Handle<JSObject*> obj, DOMObjectType& type) {
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
 
   const DOMJSClass* domClass = GetDOMClass(clasp);
   if (domClass) {
     bool isGlobal = (clasp->flags & JSCLASS_DOM_GLOBAL) != 0;
     type = isGlobal ? eGlobalInstance : eInstance;
     return domClass->mNativeHooks;
   }
 
@@ -1737,17 +1737,17 @@ static void DEBUG_CheckXBLLookup(JSConte
     if (id.get() == GetJSIDByIndex(cx, XPCJSContext::IDX_PROTOTYPE)) {
       return nativePropertyHooks->mPrototypeID == prototypes::id::_ID_Count ||
              ResolvePrototypeOrConstructor(
                  cx, wrapper, obj, nativePropertyHooks->mPrototypeID,
                  JSPROP_PERMANENT | JSPROP_READONLY, desc, cacheOnHolder);
     }
 
     if (id.get() == GetJSIDByIndex(cx, XPCJSContext::IDX_ISINSTANCE)) {
-      const js::Class* objClass = js::GetObjectClass(obj);
+      const JSClass* objClass = js::GetObjectClass(obj);
       if (IsDOMIfaceAndProtoClass(objClass) &&
           DOMIfaceAndProtoJSClass::FromJSClass(objClass)
               ->wantsInterfaceHasInstance) {
         cacheOnHolder = true;
         JSNativeWrapper interfaceIsInstanceWrapper = {InterfaceIsInstance,
                                                       nullptr};
         JSObject* funObj =
             XrayCreateFunction(cx, wrapper, interfaceIsInstanceWrapper, 1, id);
@@ -1761,17 +1761,17 @@ static void DEBUG_CheckXBLLookup(JSConte
         desc.setSetter(nullptr);
         desc.setGetter(nullptr);
         return true;
       }
     }
 
     if (id.get() == SYMBOL_TO_JSID(JS::GetWellKnownSymbol(
                         cx, JS::SymbolCode::hasInstance))) {
-      const js::Class* objClass = js::GetObjectClass(obj);
+      const JSClass* objClass = js::GetObjectClass(obj);
       if (IsDOMIfaceAndProtoClass(objClass) &&
           DOMIfaceAndProtoJSClass::FromJSClass(objClass)
               ->wantsInterfaceHasInstance) {
         cacheOnHolder = true;
         JSNativeWrapper interfaceHasInstanceWrapper = {InterfaceHasInstance,
                                                        nullptr};
         JSObject* funObj =
             XrayCreateFunction(cx, wrapper, interfaceHasInstanceWrapper, 1, id);
@@ -2420,17 +2420,17 @@ bool InterfaceHasInstance(JSContext* cx,
   // constructors, which are not cross-origin objects.
   JS::Rooted<JSObject*> thisObj(
       cx, js::CheckedUnwrapStatic(&args.thisv().toObject()));
   if (!thisObj) {
     // Just fall back on the normal thing, in case it still happens to work.
     return CallOrdinaryHasInstance(cx, args);
   }
 
-  const js::Class* thisClass = js::GetObjectClass(thisObj);
+  const JSClass* thisClass = js::GetObjectClass(thisObj);
 
   if (!IsDOMIfaceAndProtoClass(thisClass)) {
     return CallOrdinaryHasInstance(cx, args);
   }
 
   const DOMIfaceAndProtoJSClass* clasp =
       DOMIfaceAndProtoJSClass::FromJSClass(thisClass);
 
@@ -2496,17 +2496,17 @@ bool InterfaceIsInstance(JSContext* cx, 
   // whether this is a DOM constructor.
   JS::Rooted<JSObject*> thisObj(
       cx, js::CheckedUnwrapStatic(&args.thisv().toObject()));
   if (!thisObj) {
     args.rval().setBoolean(false);
     return true;
   }
 
-  const js::Class* thisClass = js::GetObjectClass(thisObj);
+  const JSClass* thisClass = js::GetObjectClass(thisObj);
   if (!IsDOMIfaceAndProtoClass(thisClass)) {
     args.rval().setBoolean(false);
     return true;
   }
 
   const DOMIfaceAndProtoJSClass* clasp =
       DOMIfaceAndProtoJSClass::FromJSClass(thisClass);
 
@@ -3424,17 +3424,17 @@ bool ForEachHandler(JSContext* aCx, unsi
   }
   JS::Rooted<JS::Value> rval(aCx, JS::UndefinedValue());
   // Now actually call the user specified callback
   return JS::Call(aCx, args.thisv(), callbackFn, newArgs, &rval);
 }
 
 static inline prototypes::ID GetProtoIdForNewtarget(
     JS::Handle<JSObject*> aNewTarget) {
-  const js::Class* newTargetClass = js::GetObjectClass(aNewTarget);
+  const JSClass* newTargetClass = js::GetObjectClass(aNewTarget);
   if (IsDOMIfaceAndProtoClass(newTargetClass)) {
     const DOMIfaceAndProtoJSClass* newTargetIfaceClass =
         DOMIfaceAndProtoJSClass::FromJSClass(newTargetClass);
     if (newTargetIfaceClass->mType == eInterface) {
       return newTargetIfaceClass->mPrototypeID;
     }
   } else if (JS_IsNativeFunction(aNewTarget, Constructor)) {
     return GetNativePropertyHooksFromConstructorFunction(aNewTarget)
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -117,17 +117,17 @@ inline T* UnwrapPossiblyNotInitializedDO
 
   JS::Value val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT);
   if (val.isUndefined()) {
     return nullptr;
   }
   return static_cast<T*>(val.toPrivate());
 }
 
-inline const DOMJSClass* GetDOMClass(const js::Class* clasp) {
+inline const DOMJSClass* GetDOMClass(const JSClass* clasp) {
   return IsDOMClass(clasp) ? DOMJSClass::FromJSClass(clasp) : nullptr;
 }
 
 inline const DOMJSClass* GetDOMClass(JSObject* obj) {
   return GetDOMClass(js::GetObjectClass(obj));
 }
 
 inline nsISupports* UnwrapDOMObjectToISupports(JSObject* aObject) {
@@ -717,19 +717,19 @@ struct NamedConstructor {
  * At least one of protoClass, constructorClass or constructor should be
  * non-null. If constructorClass or constructor are non-null, the resulting
  * interface object will be defined on the given global with property name
  * |name|, which must also be non-null.
  */
 // clang-format on
 void CreateInterfaceObjects(
     JSContext* cx, JS::Handle<JSObject*> global,
-    JS::Handle<JSObject*> protoProto, const js::Class* protoClass,
+    JS::Handle<JSObject*> protoProto, const JSClass* protoClass,
     JS::Heap<JSObject*>* protoCache, const char* toStringTag,
-    JS::Handle<JSObject*> interfaceProto, const js::Class* constructorClass,
+    JS::Handle<JSObject*> interfaceProto, const JSClass* constructorClass,
     unsigned ctorNargs, const NamedConstructor* namedConstructors,
     JS::Heap<JSObject*>* constructorCache,
     const NativeProperties* regularProperties,
     const NativeProperties* chromeOnlyProperties, const char* name,
     bool defineOnGlobal, const char* const* unscopableNames, bool isGlobal,
     const char* const* legacyWindowAliases);
 
 /**
@@ -1417,17 +1417,17 @@ inline void UpdateWrapper(T* p, void*, J
 // because the object can only be obtained by JS once, or they cannot be
 // meaningfully owned from the native side.
 //
 // This operation will return false only for non-nsISupports cycle-collected
 // objects, because we cannot determine if they are wrappercached or not.
 bool TryPreserveWrapper(JS::Handle<JSObject*> obj);
 
 // Can only be called with a DOM JSClass.
-bool InstanceClassHasProtoAtDepth(const js::Class* clasp, uint32_t protoID,
+bool InstanceClassHasProtoAtDepth(const JSClass* clasp, uint32_t protoID,
                                   uint32_t depth);
 
 // Only set allowNativeWrapper to false if you really know you need it; if in
 // doubt use true. Setting it to false disables security wrappers.
 bool XPCOMObjectToJsval(JSContext* cx, JS::Handle<JSObject*> scope,
                         xpcObjectHelper& helper, const nsIID* iid,
                         bool allowNativeWrapper,
                         JS::MutableHandle<JS::Value> rval);
@@ -2268,17 +2268,17 @@ inline bool XrayGetNativeProto(JSContext
         protop.set(protoGetter(cx));
       } else {
         protop.set(JS::GetRealmObjectPrototype(cx));
       }
     } else if (JS_ObjectIsFunction(obj)) {
       MOZ_ASSERT(JS_IsNativeFunction(obj, Constructor));
       protop.set(JS::GetRealmFunctionPrototype(cx));
     } else {
-      const js::Class* clasp = js::GetObjectClass(obj);
+      const JSClass* clasp = js::GetObjectClass(obj);
       MOZ_ASSERT(IsDOMIfaceAndProtoClass(clasp));
       ProtoGetter protoGetter =
           DOMIfaceAndProtoJSClass::FromJSClass(clasp)->mGetParentProto;
       protop.set(protoGetter(cx));
     }
   }
 
   return JS_WrapObject(cx, protop);
@@ -2332,28 +2332,28 @@ inline JSObject* GetCachedSlotStorageObj
 
 extern NativePropertyHooks sEmptyNativePropertyHooks;
 
 extern const JSClassOps sBoringInterfaceObjectClassClassOps;
 
 extern const js::ObjectOps sInterfaceObjectClassObjectOps;
 
 inline bool UseDOMXray(JSObject* obj) {
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   return IsDOMClass(clasp) || JS_IsNativeFunction(obj, Constructor) ||
          IsDOMIfaceAndProtoClass(clasp);
 }
 
 inline bool IsDOMConstructor(JSObject* obj) {
   if (JS_IsNativeFunction(obj, dom::Constructor)) {
     // NamedConstructor, like Image
     return true;
   }
 
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   // Check for a DOM interface object.
   return dom::IsDOMIfaceAndProtoClass(clasp) &&
          dom::DOMIfaceAndProtoJSClass::FromJSClass(clasp)->mType ==
              dom::eInterface;
 }
 
 #ifdef DEBUG
 inline bool HasConstructor(JSObject* obj) {
@@ -2583,17 +2583,17 @@ class MOZ_STACK_CLASS BindingJSObjectCre
   explicit BindingJSObjectCreator(JSContext* aCx) : mReflector(aCx) {}
 
   ~BindingJSObjectCreator() {
     if (mReflector) {
       js::SetReservedSlot(mReflector, DOM_OBJECT_SLOT, JS::UndefinedValue());
     }
   }
 
-  void CreateProxyObject(JSContext* aCx, const js::Class* aClass,
+  void CreateProxyObject(JSContext* aCx, const JSClass* aClass,
                          const DOMProxyHandler* aHandler,
                          JS::Handle<JSObject*> aProto, bool aLazyProto,
                          T* aNative, JS::Handle<JS::Value> aExpandoValue,
                          JS::MutableHandle<JSObject*> aReflector) {
     js::ProxyOptions options;
     options.setClass(aClass);
     options.setLazyProto(aLazyProto);
 
--- a/dom/bindings/DOMJSClass.h
+++ b/dom/bindings/DOMJSClass.h
@@ -413,17 +413,17 @@ typedef JSObject* (*WebIDLDeserializer)(
                                         nsIGlobalObject* aGlobal,
                                         JSStructuredCloneReader* aReader);
 
 // Special JSClass for reflected DOM objects.
 struct DOMJSClass {
   // It would be nice to just inherit from JSClass, but that precludes pure
   // compile-time initialization of the form |DOMJSClass = {...};|, since C++
   // only allows brace initialization for aggregate/POD types.
-  const js::Class mBase;
+  const JSClass mBase;
 
   // A list of interfaces that this object implements, in order of decreasing
   // derivedness.
   const prototypes::ID mInterfaceChain[MAX_PROTOTYPE_CHAIN_LENGTH];
 
   // We store the DOM object in reserved slot with index DOM_OBJECT_SLOT or in
   // the proxy private if we use a proxy object.
   // Sometimes it's an nsISupports and sometimes it's not; this class tells
@@ -452,21 +452,21 @@ struct DOMJSClass {
     return reinterpret_cast<const DOMJSClass*>(base);
   }
 
   const JSClass* ToJSClass() const { return &mBase; }
 };
 
 // Special JSClass for DOM interface and interface prototype objects.
 struct DOMIfaceAndProtoJSClass {
-  // It would be nice to just inherit from js::Class, but that precludes pure
+  // It would be nice to just inherit from JSClass, but that precludes pure
   // compile-time initialization of the form
   // |DOMJSInterfaceAndPrototypeClass = {...};|, since C++ only allows brace
   // initialization for aggregate/POD types.
-  const js::Class mBase;
+  const JSClass mBase;
 
   // Either eInterface, eInterfacePrototype, eGlobalInterfacePrototype or
   // eNamedPropertiesObject.
   DOMObjectType mType;  // uint8_t
 
   // Boolean indicating whether this object wants a @@hasInstance property
   // pointing to InterfaceHasInstance defined on it.  Only ever true for the
   // eInterface case.
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -148,17 +148,17 @@ class DOMProxyHandler : public BaseDOMPr
 
 // Class used by shadowing handlers (the ones that have [OverrideBuiltins].
 // This handles tracing the expando in ExpandoAndGeneration.
 class ShadowingDOMProxyHandler : public DOMProxyHandler {
   virtual void trace(JSTracer* trc, JSObject* proxy) const override;
 };
 
 inline bool IsDOMProxy(JSObject* obj) {
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   return clasp->isProxy() &&
          js::GetProxyHandler(obj)->family() == &DOMProxyHandler::family;
 }
 
 inline const DOMProxyHandler* GetDOMProxyHandler(JSObject* obj) {
   MOZ_ASSERT(IsDOMProxy(obj));
   return static_cast<const DOMProxyHandler*>(js::GetProxyHandler(obj));
 }
--- a/dom/bindings/RemoteObjectProxy.cpp
+++ b/dom/bindings/RemoteObjectProxy.cpp
@@ -166,17 +166,17 @@ bool RemoteObjectProxyBase::getOwnEnumer
 const char* RemoteObjectProxyBase::className(
     JSContext* aCx, JS::Handle<JSObject*> aProxy) const {
   MOZ_ASSERT(js::IsProxy(aProxy));
 
   return "Object";
 }
 
 void RemoteObjectProxyBase::GetOrCreateProxyObject(
-    JSContext* aCx, void* aNative, const js::Class* aClasp,
+    JSContext* aCx, void* aNative, const JSClass* aClasp,
     JS::Handle<JSObject*> aTransplantTo, JS::MutableHandle<JSObject*> aProxy,
     bool& aNewObjectCreated) const {
   xpc::CompartmentPrivate* priv =
       xpc::CompartmentPrivate::Get(JS::CurrentGlobalOrNull(aCx));
   xpc::CompartmentPrivate::RemoteProxyMap& map = priv->GetRemoteProxyMap();
   auto result = map.lookupForAdd(aNative);
   if (result) {
     MOZ_ASSERT(!aTransplantTo,
--- a/dom/bindings/RemoteObjectProxy.h
+++ b/dom/bindings/RemoteObjectProxy.h
@@ -111,17 +111,17 @@ class RemoteObjectProxyBase : public js:
   /**
    * Gets an existing cached proxy object, or creates a new one and caches it.
    * aProxy will be null on failure. aNewObjectCreated is set to true if a new
    * object was created, callers probably need to addref the native in that
    * case. aNewObjectCreated can be true even if aProxy is null, if something
    * failed after creating the object.
    */
   void GetOrCreateProxyObject(JSContext* aCx, void* aNative,
-                              const js::Class* aClasp,
+                              const JSClass* aClasp,
                               JS::Handle<JSObject*> aTransplantTo,
                               JS::MutableHandle<JSObject*> aProxy,
                               bool& aNewObjectCreated) const;
 
   const prototypes::ID mPrototypeID;
 
   friend struct SetDOMProxyInformation;
   static const char sCrossOriginProxyFamily;
@@ -165,17 +165,17 @@ class RemoteObjectProxy : public RemoteO
 
  private:
   bool EnsureHolder(JSContext* aCx, JS::Handle<JSObject*> aProxy,
                     JS::MutableHandle<JSObject*> aHolder) const final {
     return MaybeCrossOriginObjectMixins::EnsureHolder(
         aCx, aProxy, /* slot = */ 0, P, F, aHolder);
   }
 
-  static const js::Class sClass;
+  static const JSClass sClass;
 };
 
 /**
  * Returns true if aObj is a cross-process proxy object that
  * represents an object implementing the WebIDL interface for
  * aProtoID.
  */
 inline bool IsRemoteObjectProxy(JSObject* aObj, prototypes::ID aProtoID) {
--- a/dom/bindings/SimpleGlobalObject.cpp
+++ b/dom/bindings/SimpleGlobalObject.cpp
@@ -71,24 +71,24 @@ static const JSClassOps SimpleGlobalClas
     nullptr,
     nullptr,
     JS_GlobalObjectTraceHook,
 };
 
 static const js::ClassExtension SimpleGlobalClassExtension = {
     SimpleGlobal_moved};
 
-const js::Class SimpleGlobalClass = {
-    "",
-    JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE |
-        JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_FOREGROUND_FINALIZE,
-    &SimpleGlobalClassOps,
-    JS_NULL_CLASS_SPEC,
-    &SimpleGlobalClassExtension,
-    JS_NULL_OBJECT_OPS};
+const JSClass SimpleGlobalClass = {"",
+                                   JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE |
+                                       JSCLASS_PRIVATE_IS_NSISUPPORTS |
+                                       JSCLASS_FOREGROUND_FINALIZE,
+                                   &SimpleGlobalClassOps,
+                                   JS_NULL_CLASS_SPEC,
+                                   &SimpleGlobalClassExtension,
+                                   JS_NULL_OBJECT_OPS};
 
 // static
 JSObject* SimpleGlobalObject::Create(GlobalType globalType,
                                      JS::Handle<JS::Value> proto) {
   // We can't root our return value with our AutoJSAPI because the rooting
   // analysis thinks ~AutoJSAPI can GC.  So we need to root in a scope outside
   // the lifetime of the AutoJSAPI.
   JS::Rooted<JSObject*> global(RootingCx());
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -228,17 +228,17 @@ static bool NPObjWrapper_toPrimitive(JSC
                                      JS::Value* vp);
 
 static bool CreateNPObjectMember(NPP npp, JSContext* cx,
                                  JS::Handle<JSObject*> obj, NPObject* npobj,
                                  JS::Handle<jsid> id,
                                  NPVariant* getPropertyResult,
                                  JS::MutableHandle<JS::Value> vp);
 
-const js::Class sNPObjWrapperProxyClass =
+const JSClass sNPObjWrapperProxyClass =
     PROXY_CLASS_DEF(NPRUNTIME_JSCLASS_NAME, JSCLASS_HAS_RESERVED_SLOTS(1));
 
 typedef struct NPObjectMemberPrivate {
   JS::Heap<JSObject*> npobjWrapper;
   JS::Heap<JS::Value> fieldValue;
   JS::Heap<jsid> methodName;
   NPP npp = nullptr;
 } NPObjectMemberPrivate;
--- a/js/xpconnect/idl/nsIXPCScriptable.idl
+++ b/js/xpconnect/idl/nsIXPCScriptable.idl
@@ -18,17 +18,16 @@
 
 interface nsIXPConnectWrappedNative;
 
 [ptr] native JSContextPtr(JSContext);
 [ptr] native JSObjectPtr(JSObject);
 [ptr] native JSValPtr(JS::Value);
 [ptr] native JSFreeOpPtr(JSFreeOp);
 [ref] native JSCallArgsRef(const JS::CallArgs);
-[ptr] native jsClassPtr(const js::Class);
 [ptr] native JSClassPtr(const JSClass);
       native JSMutableHandleIdVector(JS::MutableHandleIdVector);
 
 %{ C++
     // nsIXPCScriptable flags (only 32 bits available!). They are defined via
     // #defines so they can be used in #ifndef guards in xpc_map_end.h.
 
     #define XPC_SCRIPTABLE_WANT_PRECREATE                   (1 <<  0)
@@ -59,17 +58,16 @@ interface nsIXPConnectWrappedNative;
  * boolean to PR_TRUE before making the call.  Implementations may skip writing
  * to *_retval unless they want to return PR_FALSE.
  */
 [builtinclass, uuid(19b70b26-7c3f-437f-a04a-2a8f9e28b617)]
 interface nsIXPCScriptable : nsISupports
 {
     readonly attribute AUTF8String className;
     [notxpcom,nostdcall] uint32_t getScriptableFlags();
-    [notxpcom,nostdcall] jsClassPtr getClass();
     [notxpcom,nostdcall] JSClassPtr getJSClass();
 
     void   preCreate(in nsISupports nativeObj, in JSContextPtr cx,
                      in JSObjectPtr globalObj, out JSObjectPtr parentObj);
 
     boolean enumerate(in nsIXPConnectWrappedNative wrapper,
                      in JSContextPtr cx, in JSObjectPtr obj);
 
--- a/js/xpconnect/public/xpc_make_class.h
+++ b/js/xpconnect/public/xpc_make_class.h
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 xpc_make_class_h
 #define xpc_make_class_h
 
-// This file should be used to create js::Class instances for nsIXPCScriptable
+// This file should be used to create JSClass instances for nsIXPCScriptable
 // instances. This includes any file that uses xpc_map_end.h.
 
 #include "xpcpublic.h"
 #include "mozilla/dom/DOMJSClass.h"
 
 bool XPC_WN_MaybeResolvingPropertyStub(JSContext* cx, JS::HandleObject obj,
                                        JS::HandleId id, JS::HandleValue v);
 bool XPC_WN_CannotModifyPropertyStub(JSContext* cx, JS::HandleObject obj,
--- a/js/xpconnect/public/xpc_map_end.h
+++ b/js/xpconnect/public/xpc_map_end.h
@@ -29,26 +29,23 @@ NS_IMETHODIMP XPC_MAP_CLASSNAME::GetClas
 }
 
 /**************************************************************/
 
 // virtual
 uint32_t XPC_MAP_CLASSNAME::GetScriptableFlags() { return (XPC_MAP_FLAGS); }
 
 // virtual
-const js::Class* XPC_MAP_CLASSNAME::GetClass() {
+const JSClass* XPC_MAP_CLASSNAME::GetJSClass() {
   static const JSClassOps classOps = XPC_MAKE_CLASS_OPS(GetScriptableFlags());
-  static const js::Class klass =
+  static const JSClass klass =
       XPC_MAKE_CLASS(XPC_MAP_QUOTED_CLASSNAME, GetScriptableFlags(), &classOps);
   return &klass;
 }
 
-// virtual
-const JSClass* XPC_MAP_CLASSNAME::GetJSClass() { return GetClass(); }
-
 /**************************************************************/
 
 #if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_PRECREATE)
 NS_IMETHODIMP XPC_MAP_CLASSNAME::PreCreate(nsISupports* nativeObj,
                                            JSContext* cx, JSObject* globalObj,
                                            JSObject** parentObj) {
   NS_ERROR("never called");
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -453,30 +453,30 @@ static const JSClassOps SandboxClassOps 
     nullptr,
     JS_GlobalObjectTraceHook,
 };
 
 static const js::ClassExtension SandboxClassExtension = {
     sandbox_moved /* objectMovedOp */
 };
 
-static const js::Class SandboxClass = {
+static const JSClass SandboxClass = {
     "Sandbox",
     XPCONNECT_GLOBAL_FLAGS_WITH_EXTRA_SLOTS(1) | JSCLASS_FOREGROUND_FINALIZE,
     &SandboxClassOps,
     JS_NULL_CLASS_SPEC,
     &SandboxClassExtension,
     JS_NULL_OBJECT_OPS};
 
 static const JSFunctionSpec SandboxFunctions[] = {
     JS_FN("dump", SandboxDump, 1, 0), JS_FN("debug", SandboxDebug, 1, 0),
     JS_FN("importFunction", SandboxImport, 1, 0), JS_FS_END};
 
 bool xpc::IsSandbox(JSObject* obj) {
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   return clasp == &SandboxClass;
 }
 
 /***************************************************************************/
 nsXPCComponents_utils_Sandbox::nsXPCComponents_utils_Sandbox() {}
 
 nsXPCComponents_utils_Sandbox::~nsXPCComponents_utils_Sandbox() {}
 
@@ -1064,17 +1064,17 @@ nsresult xpc::CreateSandboxObject(JSCont
     creationOptions.setNewCompartmentInSystemZone();
   }
 
   creationOptions.setInvisibleToDebugger(options.invisibleToDebugger)
       .setTrace(TraceXPCGlobal);
 
   realmOptions.behaviors().setDiscardSource(options.discardSource);
 
-  const js::Class* clasp = &SandboxClass;
+  const JSClass* clasp = &SandboxClass;
 
   RootedObject sandbox(
       cx, xpc::CreateGlobalObject(cx, clasp, principal, realmOptions));
   if (!sandbox) {
     return NS_ERROR_FAILURE;
   }
 
   // Use exclusive expandos for non-system-principal sandboxes.
@@ -1146,17 +1146,17 @@ nsresult xpc::CreateSandboxObject(JSCont
         // is on the cx, so use that same realm for the CheckedUnwrapDynamic
         // call.
         JSObject* unwrappedProto =
             js::CheckedUnwrapDynamic(options.proto, cx, false);
         if (!unwrappedProto) {
           JS_ReportErrorASCII(cx, "Sandbox must subsume sandboxPrototype");
           return NS_ERROR_INVALID_ARG;
         }
-        const js::Class* unwrappedClass = js::GetObjectClass(unwrappedProto);
+        const JSClass* unwrappedClass = js::GetObjectClass(unwrappedProto);
         useSandboxProxy = IS_WN_CLASS(unwrappedClass) ||
                           mozilla::dom::IsDOMClass(unwrappedClass);
       }
 
       if (useSandboxProxy) {
         // Wrap it up in a proxy that will do the right thing in terms
         // of this-binding for methods.
         RootedValue priv(cx, ObjectValue(*options.proto));
--- a/js/xpconnect/src/XPCCallContext.cpp
+++ b/js/xpconnect/src/XPCCallContext.cpp
@@ -10,17 +10,17 @@
 #include "jsfriendapi.h"
 #include "js/Wrapper.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
 using namespace xpc;
 using namespace JS;
 
-static inline bool IsTearoffClass(const js::Class* clazz) {
+static inline bool IsTearoffClass(const JSClass* clazz) {
   return clazz == &XPC_WN_Tearoff_JSClass;
 }
 
 XPCCallContext::XPCCallContext(
     JSContext* cx, HandleObject obj /* = nullptr               */,
     HandleObject funobj /* = nullptr               */,
     HandleId name /* = JSID_VOID             */,
     unsigned argc /* = NO_ARGS               */, Value* argv /* = nullptr */,
@@ -64,17 +64,17 @@ XPCCallContext::XPCCallContext(
   JSObject* unwrapped =
       js::CheckedUnwrapDynamic(obj, cx, /* stopAtWindowProxy = */ false);
   if (!unwrapped) {
     JS_ReportErrorASCII(mJSContext,
                         "Permission denied to call method on |this|");
     mState = INIT_FAILED;
     return;
   }
-  const js::Class* clasp = js::GetObjectClass(unwrapped);
+  const JSClass* clasp = js::GetObjectClass(unwrapped);
   if (IS_WN_CLASS(clasp)) {
     mWrapper = XPCWrappedNative::Get(unwrapped);
   } else if (IsTearoffClass(clasp)) {
     mTearOff = (XPCWrappedNativeTearOff*)js::GetObjectPrivate(unwrapped);
     mWrapper = XPCWrappedNative::Get(
         &js::GetReservedSlot(unwrapped, XPC_WN_TEAROFF_FLAT_OBJECT_SLOT)
              .toObject());
   }
--- a/js/xpconnect/src/XPCJSID.cpp
+++ b/js/xpconnect/src/XPCJSID.cpp
@@ -30,57 +30,57 @@ namespace xpc {
  */
 static bool ID_Equals(JSContext* aCx, unsigned aArgc, Value* aVp);
 static bool ID_GetNumber(JSContext* aCx, unsigned aArgc, Value* aVp);
 
 // Generic ID objects contain 4 reserved slots, each containing a uint32_t with
 // 1/4 of the representation of the nsID value. This allows us to avoid an extra
 // allocation for the nsID object, and eliminates the need for a finalizer.
 enum { kID_Slot0, kID_Slot1, kID_Slot2, kID_Slot3, kID_SlotCount };
-static const js::Class sID_Class = {
+static const JSClass sID_Class = {
     "nsJSID", JSCLASS_HAS_RESERVED_SLOTS(kID_SlotCount), JS_NULL_CLASS_OPS};
 
 /******************************************************************************
  * # Interface IDs #
  *
  * In addition to the properties exposed by Generic ID objects, IID supports
  * 'instanceof', exposes constant properties defined on the class, and exposes
  * the interface name as the 'name' and 'toString()' values.
  */
 static bool IID_HasInstance(JSContext* aCx, unsigned aArgc, Value* aVp);
 static bool IID_GetName(JSContext* aCx, unsigned aArgc, Value* aVp);
 
 // Interface ID objects use a single reserved slot containing a pointer to the
 // nsXPTInterfaceInfo object for the interface in question.
 enum { kIID_InfoSlot, kIID_SlotCount };
-static const js::Class sIID_Class = {
+static const JSClass sIID_Class = {
     "nsJSIID", JSCLASS_HAS_RESERVED_SLOTS(kIID_SlotCount), JS_NULL_CLASS_OPS};
 
 /******************************************************************************
  * # Contract IDs #
  *
  * In addition to the properties exposed by Generic ID objects, Contract IDs
  * expose 'getService' and 'createInstance' methods, and expose the contractID
  * string as '.name' and '.toString()'.
  */
 static bool CID_CreateInstance(JSContext* aCx, unsigned aArgc, Value* aVp);
 static bool CID_GetService(JSContext* aCx, unsigned aArgc, Value* aVp);
 static bool CID_GetName(JSContext* aCx, unsigned aArgc, Value* aVp);
 
 // ContractID objects use a single reserved slot, containing the ContractID. The
 // nsCID value for this object is looked up when the object is being unwrapped.
 enum { kCID_ContractSlot, kCID_SlotCount };
-static const js::Class sCID_Class = {
+static const JSClass sCID_Class = {
     "nsJSCID", JSCLASS_HAS_RESERVED_SLOTS(kCID_SlotCount), JS_NULL_CLASS_OPS};
 
 /**
  * Ensure that the nsID prototype objects have been created for the current
  * global, and extract the prototype values.
  */
-static JSObject* GetIDPrototype(JSContext* aCx, const js::Class* aClass) {
+static JSObject* GetIDPrototype(JSContext* aCx, const JSClass* aClass) {
   XPCWrappedNativeScope* scope = ObjectScope(CurrentGlobalOrNull(aCx));
   if (NS_WARN_IF(!scope)) {
     return nullptr;
   }
 
   // Create prototype objects for the JSID objects if they haven't been
   // created for this scope yet.
   if (!scope->mIDProto) {
@@ -140,17 +140,17 @@ static JSObject* GetIDPrototype(JSContex
   } else if (aClass == &sCID_Class) {
     return scope->mCIDProto;
   }
 
   MOZ_CRASH("Unrecognized ID Object Class");
 }
 
 // Unwrap the given value to an object with the correct class, or nullptr.
-static JSObject* GetIDObject(HandleValue aVal, const Class* aClass) {
+static JSObject* GetIDObject(HandleValue aVal, const JSClass* aClass) {
   if (aVal.isObject()) {
     // We care only about IID/CID objects here, so CheckedUnwrapStatic is fine.
     JSObject* obj = js::CheckedUnwrapStatic(&aVal.toObject());
     if (obj && js::GetObjectClass(obj) == aClass) {
       return obj;
     }
   }
   return nullptr;
@@ -215,17 +215,17 @@ Maybe<nsID> JSValue2ID(JSContext* aCx, H
     }
   }
   return id;
 }
 
 /**
  * Public ID Object Constructor Methods
  */
-static JSObject* NewIDObjectHelper(JSContext* aCx, const js::Class* aClass) {
+static JSObject* NewIDObjectHelper(JSContext* aCx, const JSClass* aClass) {
   RootedObject proto(aCx, GetIDPrototype(aCx, aClass));
   if (proto) {
     return JS_NewObjectWithGivenProto(aCx, aClass, proto);
   }
   return nullptr;
 }
 
 bool ID2JSValue(JSContext* aCx, const nsID& aId, MutableHandleValue aVal) {
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -222,17 +222,17 @@ void CompartmentPrivate::SystemIsBeingSh
 
 RealmPrivate::RealmPrivate(JS::Realm* realm) : scriptability(realm) {
   mozilla::PodArrayZero(wrapperDenialWarnings);
 }
 
 /* static */
 void RealmPrivate::Init(HandleObject aGlobal, const SiteIdentifier& aSite) {
   MOZ_ASSERT(aGlobal);
-  DebugOnly<const js::Class*> clasp = js::GetObjectClass(aGlobal);
+  DebugOnly<const JSClass*> clasp = js::GetObjectClass(aGlobal);
   MOZ_ASSERT(clasp->flags &
                  (JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_HAS_PRIVATE) ||
              dom::IsDOMClass(clasp));
 
   Realm* realm = GetObjectRealmOrNull(aGlobal);
 
   // Create the realm private.
   RealmPrivate* realmPriv = new RealmPrivate(realm);
@@ -3147,17 +3147,17 @@ bool XPCJSRuntime::InitializeStrings(JSC
     if (!mozilla::dom::DefineStaticJSVals(cx)) {
       return false;
     }
   }
 
   return true;
 }
 
-bool XPCJSRuntime::DescribeCustomObjects(JSObject* obj, const js::Class* clasp,
+bool XPCJSRuntime::DescribeCustomObjects(JSObject* obj, const JSClass* clasp,
                                          char (&name)[72]) const {
   if (clasp != &XPC_WN_Proto_JSClass) {
     return false;
   }
 
   XPCWrappedNativeProto* p =
       static_cast<XPCWrappedNativeProto*>(xpc_GetJSPrivate(obj));
   nsCOMPtr<nsIXPCScriptable> scr = p->GetScriptable();
@@ -3166,17 +3166,17 @@ bool XPCJSRuntime::DescribeCustomObjects
   }
 
   SprintfLiteral(name, "JS Object (%s - %s)", clasp->name,
                  scr->GetJSClass()->name);
   return true;
 }
 
 bool XPCJSRuntime::NoteCustomGCThingXPCOMChildren(
-    const js::Class* clasp, JSObject* obj,
+    const JSClass* clasp, JSObject* obj,
     nsCycleCollectionTraversalCallback& cb) const {
   if (clasp != &XPC_WN_Tearoff_JSClass) {
     return false;
   }
 
   // A tearoff holds a strong reference to its native object
   // (see XPCWrappedNative::FlatJSObjectFinalized). Its XPCWrappedNative
   // will be held alive through tearoff's XPC_WN_TEAROFF_FLAT_OBJECT_SLOT,
--- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
@@ -560,17 +560,17 @@ bool XPC_WN_Shared_Enumerate(JSContext* 
 }
 
 /***************************************************************************/
 
 enum WNHelperType { WN_NOHELPER, WN_HELPER };
 
 static void WrappedNativeFinalize(JSFreeOp* fop, JSObject* obj,
                                   WNHelperType helperType) {
-  const js::Class* clazz = js::GetObjectClass(obj);
+  const JSClass* clazz = js::GetObjectClass(obj);
   if (clazz->flags & JSCLASS_DOM_GLOBAL) {
     mozilla::dom::DestroyProtoAndIfaceCache(obj);
   }
   nsISupports* p = static_cast<nsISupports*>(xpc_GetJSPrivate(obj));
   if (!p) {
     return;
   }
 
@@ -601,17 +601,17 @@ void XPC_WN_NoHelper_Finalize(JSFreeOp* 
  * corresponding JS object |obj|, calling |wrapper->TraceSelf| will ask the JS
  * engine to mark |obj|. Eventually, this will lead to the trace hook being
  * called for |obj|. The trace hook should call |wrapper->TraceInside|, which
  * should mark any JS objects held by |wrapper| as members.
  */
 
 /* static */
 void XPCWrappedNative::Trace(JSTracer* trc, JSObject* obj) {
-  const js::Class* clazz = js::GetObjectClass(obj);
+  const JSClass* clazz = js::GetObjectClass(obj);
   if (clazz->flags & JSCLASS_DOM_GLOBAL) {
     mozilla::dom::TraceProtoAndIfaceCache(trc, obj);
   }
   MOZ_ASSERT(IS_WN_CLASS(clazz));
 
   XPCWrappedNative* wrapper = XPCWrappedNative::Get(obj);
   if (wrapper && wrapper->IsValid()) {
     wrapper->TraceInside(trc);
@@ -655,17 +655,17 @@ static const JSClassOps XPC_WN_NoHelper_
     nullptr,                            // call
     nullptr,                            // construct
     nullptr,                            // hasInstance
     XPCWrappedNative::Trace,            // trace
 };
 
 const js::ClassExtension XPC_WN_JSClassExtension = {WrappedNativeObjectMoved};
 
-const js::Class XPC_WN_NoHelper_JSClass = {
+const JSClass XPC_WN_NoHelper_JSClass = {
     "XPCWrappedNative_NoHelper",
     XPC_WRAPPER_FLAGS | JSCLASS_IS_WRAPPED_NATIVE |
         JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_FOREGROUND_FINALIZE,
     &XPC_WN_NoHelper_JSClassOps,
     JS_NULL_CLASS_SPEC,
     &XPC_WN_JSClassExtension,
     JS_NULL_OBJECT_OPS};
 
@@ -901,17 +901,17 @@ bool XPC_WN_NewEnumerate(JSContext* cx, 
 #define IS_CU_CLASS(clasp) \
   (clasp->name[0] == 'n' && !strcmp(clasp->name, "nsXPCComponents_Utils"))
 
 MOZ_ALWAYS_INLINE JSObject* FixUpThisIfBroken(JSObject* obj, JSObject* funobj) {
   if (funobj) {
     JSObject* parentObj =
         &js::GetFunctionNativeReserved(funobj, XPC_FUNCTION_PARENT_OBJECT_SLOT)
              .toObject();
-    const js::Class* parentClass = js::GetObjectClass(parentObj);
+    const JSClass* parentClass = js::GetObjectClass(parentObj);
     if (MOZ_UNLIKELY(
             (IS_NOHELPER_CLASS(parentClass) || IS_CU_CLASS(parentClass)) &&
             (js::GetObjectClass(obj) != parentClass))) {
       return parentObj;
     }
   }
   return obj;
 }
@@ -1098,17 +1098,17 @@ static const JSClassOps XPC_WN_Proto_JSC
     nullptr,                                  // construct
     nullptr,                                  // hasInstance
     nullptr,                                  // trace
 };
 
 static const js::ClassExtension XPC_WN_Proto_ClassExtension = {
     XPC_WN_Proto_ObjectMoved};
 
-const js::Class XPC_WN_Proto_JSClass = {
+const JSClass XPC_WN_Proto_JSClass = {
     "XPC_WN_Proto_JSClass",       XPC_WRAPPER_FLAGS,
     &XPC_WN_Proto_JSClassOps,     JS_NULL_CLASS_SPEC,
     &XPC_WN_Proto_ClassExtension, JS_NULL_OBJECT_OPS};
 
 /***************************************************************************/
 
 static bool XPC_WN_TearOff_Enumerate(JSContext* cx, HandleObject obj) {
   XPCCallContext ccx(cx, obj);
@@ -1187,14 +1187,14 @@ static const JSClassOps XPC_WN_Tearoff_J
     nullptr,                            // construct
     nullptr,                            // hasInstance
     nullptr,                            // trace
 };
 
 static const js::ClassExtension XPC_WN_Tearoff_JSClassExtension = {
     XPC_WN_TearOff_ObjectMoved};
 
-const js::Class XPC_WN_Tearoff_JSClass = {
+const JSClass XPC_WN_Tearoff_JSClass = {
     "WrappedNative_TearOff",
     XPC_WRAPPER_FLAGS |
         JSCLASS_HAS_RESERVED_SLOTS(XPC_WN_TEAROFF_RESERVED_SLOTS),
     &XPC_WN_Tearoff_JSClassOps, JS_NULL_CLASS_SPEC,
     &XPC_WN_Tearoff_JSClassExtension};
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -454,17 +454,17 @@ JSObject* CreateGlobalObject(JSContext* 
   if (clasp->flags & JSCLASS_DOM_GLOBAL) {
 #ifdef DEBUG
     // Verify that the right trace hook is called. Note that this doesn't
     // work right for wrapped globals, since the tracing situation there is
     // more complicated. Manual inspection shows that they do the right
     // thing.  Also note that we only check this for JSCLASS_DOM_GLOBAL
     // classes because xpc::TraceXPCGlobal won't call
     // TraceProtoAndIfaceCache unless that flag is set.
-    if (!((const js::Class*)clasp)->isWrappedNative()) {
+    if (!((const JSClass*)clasp)->isWrappedNative()) {
       VerifyTraceProtoAndIfaceCacheCalledTracer trc(cx);
       TraceChildren(&trc, GCCellPtr(global.get()));
       MOZ_ASSERT(trc.ok,
                  "Trace hook on global needs to call TraceXPCGlobal for "
                  "XPConnect compartments.");
     }
 #endif
 
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -191,17 +191,17 @@ extern const char XPC_XPCONNECT_CONTRACT
 
 #define XPC_STRING_GETTER_BODY(dest, src)   \
   NS_ENSURE_ARG_POINTER(dest);              \
   *dest = src ? moz_xstrdup(src) : nullptr; \
   return NS_OK
 
 // If IS_WN_CLASS for the JSClass of an object is true, the object is a
 // wrappednative wrapper, holding the XPCWrappedNative in its private slot.
-static inline bool IS_WN_CLASS(const js::Class* clazz) {
+static inline bool IS_WN_CLASS(const JSClass* clazz) {
   return clazz->isWrappedNative();
 }
 
 static inline bool IS_WN_REFLECTOR(JSObject* obj) {
   return IS_WN_CLASS(js::GetObjectClass(obj));
 }
 
 /***************************************************************************
@@ -502,20 +502,20 @@ class XPCJSRuntime final : public mozill
   }
 
   XPCWrappedNativeScopeList& GetWrappedNativeScopes() {
     return mWrappedNativeScopes;
   }
 
   bool InitializeStrings(JSContext* cx);
 
-  virtual bool DescribeCustomObjects(JSObject* aObject, const js::Class* aClasp,
+  virtual bool DescribeCustomObjects(JSObject* aObject, const JSClass* aClasp,
                                      char (&aName)[72]) const override;
   virtual bool NoteCustomGCThingXPCOMChildren(
-      const js::Class* aClasp, JSObject* aObj,
+      const JSClass* aClasp, JSObject* aObj,
       nsCycleCollectionTraversalCallback& aCb) const override;
 
   /**
    * Infrastructure for classes that need to defer part of the finalization
    * until after the GC has run, for example for objects that we don't want to
    * destroy during the GC.
    */
 
@@ -788,22 +788,22 @@ class MOZ_STACK_CLASS XPCCallContext fin
 * Core classes for wrapped native objects for use from JavaScript...
 *
 ****************************************************************************
 ***************************************************************************/
 
 // These are the various JSClasses and callbacks whose use that required
 // visibility from more than one .cpp file.
 
-extern const js::Class XPC_WN_NoHelper_JSClass;
-extern const js::Class XPC_WN_Proto_JSClass;
-extern const js::Class XPC_WN_Tearoff_JSClass;
+extern const JSClass XPC_WN_NoHelper_JSClass;
+extern const JSClass XPC_WN_Proto_JSClass;
+extern const JSClass XPC_WN_Tearoff_JSClass;
 #define XPC_WN_TEAROFF_RESERVED_SLOTS 1
 #define XPC_WN_TEAROFF_FLAT_OBJECT_SLOT 0
-extern const js::Class XPC_WN_NoHelper_Proto_JSClass;
+extern const JSClass XPC_WN_NoHelper_Proto_JSClass;
 
 extern bool XPC_WN_CallMethod(JSContext* cx, unsigned argc, JS::Value* vp);
 
 extern bool XPC_WN_GetterSetter(JSContext* cx, unsigned argc, JS::Value* vp);
 
 /***************************************************************************/
 // XPCWrappedNativeScope is one-to-one with a JS compartment.
 
--- a/js/xpconnect/wrappers/AccessCheck.cpp
+++ b/js/xpconnect/wrappers/AccessCheck.cpp
@@ -76,17 +76,17 @@ bool AccessCheck::isChrome(JS::Realm* re
 }
 
 bool AccessCheck::isChrome(JSObject* obj) {
   return isChrome(js::GetObjectCompartment(obj));
 }
 
 bool IsCrossOriginAccessibleObject(JSObject* obj) {
   obj = js::UncheckedUnwrap(obj, /* stopAtWindowProxy = */ false);
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
 
   return (clasp->name[0] == 'L' && !strcmp(clasp->name, "Location")) ||
          (clasp->name[0] == 'W' && !strcmp(clasp->name, "Window"));
 }
 
 bool AccessCheck::checkPassToPrivilegedCode(JSContext* cx, HandleObject wrapper,
                                             HandleValue v) {
   // Primitives are fine.
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -612,17 +612,17 @@ bool JSXrayTraits::resolveOwnProperty(JS
             }
             FillPropertyDescriptor(desc, wrapper,
                                    JSPROP_PERMANENT | JSPROP_READONLY,
                                    ObjectValue(*standardProto));
             return true;
           }
 
           if (ShouldResolveStaticProperties(standardConstructor)) {
-            const js::Class* clasp = js::ProtoKeyToClass(standardConstructor);
+            const JSClass* clasp = js::ProtoKeyToClass(standardConstructor);
             MOZ_ASSERT(clasp->specDefined());
 
             if (!TryResolvePropertyFromSpecs(
                     cx, id, holder, clasp->specConstructorFunctions(),
                     clasp->specConstructorProperties(), desc)) {
               return false;
             }
 
@@ -695,17 +695,17 @@ bool JSXrayTraits::resolveOwnProperty(JS
   }
 
   if (ShouldIgnorePropertyDefinition(cx, key, id)) {
     MOZ_ASSERT(!desc.object());
     return true;
   }
 
   // Grab the JSClass. We require all Xrayable classes to have a ClassSpec.
-  const js::Class* clasp = js::GetObjectClass(target);
+  const JSClass* clasp = js::GetObjectClass(target);
   MOZ_ASSERT(clasp->specDefined());
 
   // Indexed array properties are handled above, so we can just work with the
   // class spec here.
   if (!TryResolvePropertyFromSpecs(cx, id, holder,
                                    clasp->specPrototypeFunctions(),
                                    clasp->specPrototypeProperties(), desc)) {
     return false;
@@ -944,17 +944,17 @@ bool JSXrayTraits::enumerateNames(JSCont
       if (standardConstructor != JSProto_Null) {
         if (ShouldResolvePrototypeProperty(standardConstructor)) {
           if (!props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_PROTOTYPE))) {
             return false;
           }
         }
 
         if (ShouldResolveStaticProperties(standardConstructor)) {
-          const js::Class* clasp = js::ProtoKeyToClass(standardConstructor);
+          const JSClass* clasp = js::ProtoKeyToClass(standardConstructor);
           MOZ_ASSERT(clasp->specDefined());
 
           if (!AppendNamesFromFunctionAndPropertySpecs(
                   cx, key, clasp->specConstructorFunctions(),
                   clasp->specConstructorProperties(), flags, props)) {
             return false;
           }
         }
@@ -978,17 +978,17 @@ bool JSXrayTraits::enumerateNames(JSCont
   }
 
   // Add the 'constructor' property.
   if (!props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_CONSTRUCTOR))) {
     return false;
   }
 
   // Grab the JSClass. We require all Xrayable classes to have a ClassSpec.
-  const js::Class* clasp = js::GetObjectClass(target);
+  const JSClass* clasp = js::GetObjectClass(target);
   MOZ_ASSERT(clasp->specDefined());
 
   return AppendNamesFromFunctionAndPropertySpecs(
       cx, key, clasp->specPrototypeFunctions(),
       clasp->specPrototypeProperties(), flags, props);
 }
 
 bool JSXrayTraits::construct(JSContext* cx, HandleObject wrapper,
@@ -1001,17 +1001,17 @@ bool JSXrayTraits::construct(JSContext* 
   }
 
   if (xpc::JSXrayTraits::getProtoKey(holder) == JSProto_Function) {
     JSProtoKey standardConstructor = constructorFor(holder);
     if (standardConstructor == JSProto_Null) {
       return baseInstance.construct(cx, wrapper, args);
     }
 
-    const js::Class* clasp = js::ProtoKeyToClass(standardConstructor);
+    const JSClass* clasp = js::ProtoKeyToClass(standardConstructor);
     MOZ_ASSERT(clasp);
     if (!(clasp->flags & JSCLASS_HAS_XRAYED_CONSTRUCTOR)) {
       return baseInstance.construct(cx, wrapper, args);
     }
 
     // If the JSCLASS_HAS_XRAYED_CONSTRUCTOR flag is set on the Class,
     // we don't use the constructor at hand. Instead, we retrieve the
     // equivalent standard constructor in the xray compartment and run
@@ -1739,17 +1739,17 @@ bool DOMXrayTraits::enumerateNames(JSCon
   }
   return XrayOwnPropertyKeys(cx, wrapper, obj, flags, props);
 }
 
 bool DOMXrayTraits::call(JSContext* cx, HandleObject wrapper,
                          const JS::CallArgs& args,
                          const js::Wrapper& baseInstance) {
   RootedObject obj(cx, getTargetObject(wrapper));
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   // What we have is either a WebIDL interface object, a WebIDL prototype
   // object, or a WebIDL instance object.  WebIDL prototype objects never have
   // a clasp->call.  WebIDL interface objects we want to invoke on the xray
   // compartment.  WebIDL instance objects either don't have a clasp->call or
   // are using "legacycaller".  At this time for all the legacycaller users it
   // makes more sense to invoke on the xray compartment, so we just go ahead
   // and do that for everything.
   if (JSNative call = clasp->getCall()) {
@@ -1762,17 +1762,17 @@ bool DOMXrayTraits::call(JSContext* cx, 
   return false;
 }
 
 bool DOMXrayTraits::construct(JSContext* cx, HandleObject wrapper,
                               const JS::CallArgs& args,
                               const js::Wrapper& baseInstance) {
   RootedObject obj(cx, getTargetObject(wrapper));
   MOZ_ASSERT(mozilla::dom::HasConstructor(obj));
-  const js::Class* clasp = js::GetObjectClass(obj);
+  const JSClass* clasp = js::GetObjectClass(obj);
   // See comments in DOMXrayTraits::call() explaining what's going on here.
   if (clasp->flags & JSCLASS_IS_DOMIFACEANDPROTOJSCLASS) {
     if (JSNative construct = clasp->getConstruct()) {
       if (!construct(cx, args.length(), args.base())) {
         return false;
       }
     } else {
       RootedValue v(cx, ObjectValue(*wrapper));
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -615,17 +615,17 @@ void CycleCollectedJSRuntime::DescribeGC
     return;
   }
 
   char name[72];
   uint64_t compartmentAddress = 0;
   if (aThing.is<JSObject>()) {
     JSObject* obj = &aThing.as<JSObject>();
     compartmentAddress = (uint64_t)js::GetObjectCompartment(obj);
-    const js::Class* clasp = js::GetObjectClass(obj);
+    const JSClass* clasp = js::GetObjectClass(obj);
 
     // Give the subclass a chance to do something
     if (DescribeCustomObjects(obj, clasp, name)) {
       // Nothing else to do!
     } else if (js::IsFunctionObject(obj)) {
       JSFunction* fun = JS_GetObjectFunction(obj);
       JSString* str = JS_GetFunctionDisplayId(fun);
       if (str) {
@@ -650,17 +650,17 @@ void CycleCollectedJSRuntime::DescribeGC
 
 void CycleCollectedJSRuntime::NoteGCThingJSChildren(
     JS::GCCellPtr aThing, nsCycleCollectionTraversalCallback& aCb) const {
   TraversalTracer trc(mJSRuntime, aCb);
   JS::TraceChildren(&trc, aThing);
 }
 
 void CycleCollectedJSRuntime::NoteGCThingXPCOMChildren(
-    const js::Class* aClasp, JSObject* aObj,
+    const JSClass* aClasp, JSObject* aObj,
     nsCycleCollectionTraversalCallback& aCb) const {
   MOZ_ASSERT(aClasp);
   MOZ_ASSERT(aClasp == js::GetObjectClass(aObj));
 
   if (NoteCustomGCThingXPCOMChildren(aClasp, aObj, aCb)) {
     // Nothing else to do!
     return;
   }
--- a/xpcom/base/CycleCollectedJSRuntime.h
+++ b/xpcom/base/CycleCollectedJSRuntime.h
@@ -113,29 +113,29 @@ class CycleCollectedJSRuntime {
   virtual void CustomOutOfMemoryCallback() {}
 
   LinkedList<CycleCollectedJSContext>& Contexts() { return mContexts; }
 
  private:
   void DescribeGCThing(bool aIsMarked, JS::GCCellPtr aThing,
                        nsCycleCollectionTraversalCallback& aCb) const;
 
-  virtual bool DescribeCustomObjects(JSObject* aObject, const js::Class* aClasp,
+  virtual bool DescribeCustomObjects(JSObject* aObject, const JSClass* aClasp,
                                      char (&aName)[72]) const {
     return false;  // We did nothing.
   }
 
   void NoteGCThingJSChildren(JS::GCCellPtr aThing,
                              nsCycleCollectionTraversalCallback& aCb) const;
 
-  void NoteGCThingXPCOMChildren(const js::Class* aClasp, JSObject* aObj,
+  void NoteGCThingXPCOMChildren(const JSClass* aClasp, JSObject* aObj,
                                 nsCycleCollectionTraversalCallback& aCb) const;
 
   virtual bool NoteCustomGCThingXPCOMChildren(
-      const js::Class* aClasp, JSObject* aObj,
+      const JSClass* aClasp, JSObject* aObj,
       nsCycleCollectionTraversalCallback& aCb) const {
     return false;  // We did nothing.
   }
 
   enum TraverseSelect { TRAVERSE_CPP, TRAVERSE_FULL };
 
   void TraverseGCThing(TraverseSelect aTs, JS::GCCellPtr aThing,
                        nsCycleCollectionTraversalCallback& aCb);