From fe6d3a4b70d5636775fc1ccabf23ee9b68fbdf20 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Sat, 7 Jun 2014 10:34:57 +0100 Subject: [PATCH] Bug 1021114 - Remove GCMethods::kind() in favour or RootKind::rootKind() r=terrence --- dom/xbl/nsXBLMaybeCompiled.h | 8 +++----- js/public/Id.h | 1 - js/public/RootingAPI.h | 4 +--- js/public/Value.h | 2 -- js/src/jsapi.h | 1 - js/src/jsinfer.h | 2 -- js/src/jsinferinlines.h | 2 -- js/src/jsscript.h | 1 - js/src/vm/PropDesc.h | 1 - 9 files changed, 4 insertions(+), 18 deletions(-) diff --git a/dom/xbl/nsXBLMaybeCompiled.h b/dom/xbl/nsXBLMaybeCompiled.h index 23b1f610f56..e1a2e9c7e5d 100644 --- a/dom/xbl/nsXBLMaybeCompiled.h +++ b/dom/xbl/nsXBLMaybeCompiled.h @@ -16,6 +16,9 @@ * The purpose of abstracting this as a separate class is to allow it to be * wrapped in a JS::Heap to correctly handle post-barriering of the JSObject * pointer, when present. + * + * No implementation of rootKind() is provided, which prevents + * Root> from being used. */ template class nsXBLMaybeCompiled @@ -88,11 +91,6 @@ struct GCMethods > static nsXBLMaybeCompiled initial() { return nsXBLMaybeCompiled(); } - /* - * No implementation of kind() is provided to prevent - * Root> from being used. - */ - static bool poisoned(nsXBLMaybeCompiled function) { return function.IsCompiled() && Base::poisoned(function.GetJSFunction()); diff --git a/js/public/Id.h b/js/public/Id.h index 8d362bcf9a0..c0a612395f0 100644 --- a/js/public/Id.h +++ b/js/public/Id.h @@ -171,7 +171,6 @@ IsPoisonedId(jsid iden) template <> struct GCMethods { static jsid initial() { return JSID_VOID; } - static ThingRootKind kind() { return THING_ROOT_ID; } static bool poisoned(jsid id) { return IsPoisonedId(id); } static bool needsPostBarrier(jsid id) { return false; } #ifdef JSGC_GENERATIONAL diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index cd95a5e400b..47396394ba0 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -654,7 +654,6 @@ template struct GCMethods { static T *initial() { return nullptr; } - static ThingRootKind kind() { return RootKind::rootKind(); } static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); } static bool needsPostBarrier(T *v) { return false; } #ifdef JSGC_GENERATIONAL @@ -667,7 +666,6 @@ template <> struct GCMethods { static JSObject *initial() { return nullptr; } - static ThingRootKind kind() { return RootKind::rootKind(); } static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); } static bool needsPostBarrier(JSObject *v) { return v != nullptr && gc::IsInsideNursery(reinterpret_cast(v)); @@ -707,7 +705,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase template void init(CX *cx) { #ifdef JSGC_TRACK_EXACT_ROOTS - js::ThingRootKind kind = js::GCMethods::kind(); + js::ThingRootKind kind = js::RootKind::rootKind(); this->stack = &cx->thingGCRooters[kind]; this->prev = *stack; *stack = reinterpret_cast*>(this); diff --git a/js/public/Value.h b/js/public/Value.h index bbaa40d224d..1952f795114 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1550,14 +1550,12 @@ namespace js { template <> struct GCMethods { static JS::Value initial() { return JS::UndefinedValue(); } - static ThingRootKind kind() { return THING_ROOT_VALUE; } static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); } }; template <> struct GCMethods { static JS::Value initial() { return JS::UndefinedValue(); } - static ThingRootKind kind() { return THING_ROOT_VALUE; } static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); } static bool needsPostBarrier(const JS::Value &v) { return v.isObject() && gc::IsInsideNursery(reinterpret_cast(&v.toObject())); diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 250fb292c26..6f8dd7933f9 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3009,7 +3009,6 @@ namespace js { template <> struct GCMethods { static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); } - static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; } static bool poisoned(const JSPropertyDescriptor &desc) { return (desc.obj && JS::IsPoisonedPtr(desc.obj)) || (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) || diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index 034063fce1b..627de935578 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -71,14 +71,12 @@ struct RootKind template <> struct GCMethods { static TaggedProto initial() { return TaggedProto(); } - static ThingRootKind kind() { return THING_ROOT_OBJECT; } static bool poisoned(const TaggedProto &v) { return IsPoisonedPtr(v.raw()); } }; template <> struct GCMethods { static TaggedProto initial() { return TaggedProto(); } - static ThingRootKind kind() { return THING_ROOT_OBJECT; } static bool poisoned(const TaggedProto &v) { return IsPoisonedPtr(v.raw()); } }; diff --git a/js/src/jsinferinlines.h b/js/src/jsinferinlines.h index 39cd6752358..b3791f802f6 100644 --- a/js/src/jsinferinlines.h +++ b/js/src/jsinferinlines.h @@ -1271,7 +1271,6 @@ template <> struct GCMethods { static types::Type initial() { return types::Type::UnknownType(); } - static ThingRootKind kind() { return THING_ROOT_TYPE; } static bool poisoned(const types::Type &v) { return (v.isTypeObject() && IsPoisonedPtr(v.typeObject())) || (v.isSingleObject() && IsPoisonedPtr(v.singleObject())); @@ -1282,7 +1281,6 @@ template <> struct GCMethods { static types::Type initial() { return types::Type::UnknownType(); } - static ThingRootKind kind() { return THING_ROOT_TYPE; } static bool poisoned(const types::Type &v) { return (v.isTypeObject() && IsPoisonedPtr(v.typeObject())) || (v.isSingleObject() && IsPoisonedPtr(v.singleObject())); diff --git a/js/src/jsscript.h b/js/src/jsscript.h index b71fbaea8fe..550f280b6aa 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -273,7 +273,6 @@ class Bindings template <> struct GCMethods { static Bindings initial(); - static ThingRootKind kind() { return THING_ROOT_BINDINGS; } static bool poisoned(const Bindings &bindings) { return IsPoisonedPtr(static_cast(bindings.callObjShape())); } diff --git a/js/src/vm/PropDesc.h b/js/src/vm/PropDesc.h index 3b45df56a42..f0f46758752 100644 --- a/js/src/vm/PropDesc.h +++ b/js/src/vm/PropDesc.h @@ -336,7 +336,6 @@ namespace js { template <> struct GCMethods { static PropDesc initial() { return PropDesc(); } - static ThingRootKind kind() { return THING_ROOT_PROP_DESC; } static bool poisoned(const PropDesc &desc) { return JS::IsPoisonedPtr(desc.descObj_) || (desc.value_.isGCThing() &&