From ecbe902a2d2dd1685168e25c920abccfa3b1e5e7 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 7 Feb 2014 16:50:28 -0800 Subject: [PATCH] Bug 985695 - Rename JSContext::getLazyType to getSingletonType, because that's the only sense in which it's used. r=terrence --HG-- extra : rebase_source : db9807b0c311c334ae38409f0dfee259f968b8d3 --- js/src/jscntxt.h | 2 +- js/src/jsinfer.cpp | 3 ++- js/src/jsobjinlines.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 119d49294eb..747bd80e70e 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -367,7 +367,7 @@ class ExclusiveContext : public ThreadSafeContext // Zone local methods that can be used freely from an ExclusiveContext. types::TypeObject *getNewType(const Class *clasp, TaggedProto proto, JSFunction *fun = nullptr); - types::TypeObject *getLazyType(const Class *clasp, TaggedProto proto); + types::TypeObject *getSingletonType(const Class *clasp, TaggedProto proto); inline js::LifoAlloc &typeLifoAlloc(); // Current global. This is only safe to use within the scope of the diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index 26a3b2b4514..d6b7a5fd947 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -3923,7 +3923,7 @@ JSCompartment::checkNewTypeObjectTableAfterMovingGC() #endif TypeObject * -ExclusiveContext::getLazyType(const Class *clasp, TaggedProto proto) +ExclusiveContext::getSingletonType(const Class *clasp, TaggedProto proto) { JS_ASSERT_IF(proto.isObject(), compartment() == proto.toObject()->compartment()); @@ -3951,6 +3951,7 @@ ExclusiveContext::getLazyType(const Class *clasp, TaggedProto proto) return nullptr; type->initSingleton((JSObject *) TypeObject::LAZY_SINGLETON); + MOZ_ASSERT(type->singleton(), "created type must be a proper singleton"); return type; } diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 9b3e04d7c30..0a20d7f3368 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -376,7 +376,7 @@ JSObject::setSingletonType(js::ExclusiveContext *cx, js::HandleObject obj) JS_ASSERT_IF(cx->isJSContext(), !IsInsideNursery(cx->asJSContext()->runtime(), obj.get())); - js::types::TypeObject *type = cx->getLazyType(obj->getClass(), obj->getTaggedProto()); + js::types::TypeObject *type = cx->getSingletonType(obj->getClass(), obj->getTaggedProto()); if (!type) return false;