Fix inline methods for debug builds, bug 690133.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 05 Oct 2011 09:23:36 -0700
changeset 81241 a76a92adb275f09ce025460bffa109b9fd2d7ad7
parent 81240 b5c201771aeaf62a4f86369d4d9d2840f783fe5c
child 81242 17bce205714e3ae1533c151c75a189b8b5a66af4
push id21565
push userbhackett@mozilla.com
push dateSat, 03 Dec 2011 20:25:52 +0000
treeherdermozilla-central@13afcd4c097c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs690133
milestone10.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
Fix inline methods for debug builds, bug 690133.
js/src/jsobjinlines.h
js/src/jsscope.h
js/src/shell/jsheaptools.cpp
js/src/vm/GlobalObject.h
js/src/vm/Stack-inl.h
js/src/vm/Stack.h
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -69,40 +69,16 @@
 #include "vm/GlobalObject.h"
 
 #include "jsatominlines.h"
 #include "jsfuninlines.h"
 #include "jsgcinlines.h"
 #include "jsprobes.h"
 #include "jsscopeinlines.h"
 
-inline js::Class *
-JSObject::getClass() const
-{
-    return lastProp->getClass();
-}
-
-inline JSClass *
-JSObject::getJSClass() const
-{
-    return Jsvalify(getClass());
-}
-
-inline bool
-JSObject::hasClass(const js::Class *c) const
-{
-    return getClass() == c;
-}
-
-inline const js::ObjectOps *
-JSObject::getOps() const
-{
-    return &getClass()->ops;
-}
-
 inline void
 JSObject::assertSpecialEqualitySynced() const
 {
     JS_ASSERT(!!getClass()->ext.equality == hasSpecialEquality());
 }
 
 inline bool
 JSObject::isGlobal() const
@@ -1322,32 +1298,16 @@ IsXML(const js::Value &v)
 }
 
 static inline bool
 IsStopIteration(const js::Value &v)
 {
     return v.isObject() && v.toObject().isStopIteration();
 }
 
-/*
- * We cache name lookup results only for the global object or for native
- * non-global objects without prototype or with prototype that never mutates,
- * see bug 462734 and bug 487039.
- */
-static inline bool
-IsCacheableNonGlobalScope(JSObject *obj)
-{
-    JS_ASSERT(obj->getParent());
-
-    bool cacheable = (obj->isCall() || obj->isBlock() || obj->isDeclEnv());
-
-    JS_ASSERT_IF(cacheable, !obj->getOps()->lookupProperty);
-    return cacheable;
-}
-
 /* ES5 9.1 ToPrimitive(input). */
 static JS_ALWAYS_INLINE bool
 ToPrimitive(JSContext *cx, Value *vp)
 {
     if (vp->isPrimitive())
         return true;
     return vp->toObject().defaultValue(cx, JSTYPE_VOID, vp);
 }
--- a/js/src/jsscope.h
+++ b/js/src/jsscope.h
@@ -871,9 +871,33 @@ Shape::search(JSContext *cx, js::Shape *
 
 } // namespace js
 
 #ifdef _MSC_VER
 #pragma warning(pop)
 #pragma warning(pop)
 #endif
 
+inline js::Class *
+JSObject::getClass() const
+{
+    return lastProp->getClass();
+}
+
+inline JSClass *
+JSObject::getJSClass() const
+{
+    return Jsvalify(getClass());
+}
+
+inline bool
+JSObject::hasClass(const js::Class *c) const
+{
+    return getClass() == c;
+}
+
+inline const js::ObjectOps *
+JSObject::getOps() const
+{
+    return &getClass()->ops;
+}
+
 #endif /* jsscope_h___ */
--- a/js/src/shell/jsheaptools.cpp
+++ b/js/src/shell/jsheaptools.cpp
@@ -47,16 +47,18 @@
 #include "jscompartment.h"
 #include "jsfun.h"
 #include "jshashtable.h"
 #include "jsobj.h"
 #include "jsprf.h"
 #include "jsutil.h"
 #include "jsvector.h"
 
+#include "jsobjinlines.h"
+
 using namespace js;
 
 #ifdef DEBUG
 
 
 /*** class HeapReverser **************************************************************************/
 
 /*
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -206,17 +206,16 @@ class GlobalObject : public ::JSObject {
         JS_ASSERT(functionObjectClassesInitialized());
         return &getSlot(THROWTYPEERROR).toObject();
     }
 
     JSObject *getOrCreateGeneratorPrototype(JSContext *cx) {
         Value &v = getSlotRef(GENERATOR_PROTO);
         if (!v.isObject() && !js_InitIteratorClasses(cx, this))
             return NULL;
-        JS_ASSERT(v.toObject().isGenerator());
         return &v.toObject();
     }
 
     Value getRegExpStatics() const {
         return getSlot(REGEXP_STATICS);
     }
 
     void clear(JSContext *cx);
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -49,16 +49,32 @@
 #include "jsscriptinlines.h"
 #include "ArgumentsObject-inl.h"
 #include "CallObject-inl.h"
 
 #include "methodjit/MethodJIT.h"
 
 namespace js {
 
+/*
+ * We cache name lookup results only for the global object or for native
+ * non-global objects without prototype or with prototype that never mutates,
+ * see bug 462734 and bug 487039.
+ */
+static inline bool
+IsCacheableNonGlobalScope(JSObject *obj)
+{
+    JS_ASSERT(obj->getParent());
+
+    bool cacheable = (obj->isCall() || obj->isBlock() || obj->isDeclEnv());
+
+    JS_ASSERT_IF(cacheable, !obj->getOps()->lookupProperty);
+    return cacheable;
+}
+
 inline void
 StackFrame::initPrev(JSContext *cx)
 {
     JS_ASSERT(flags_ & HAS_PREVPC);
     if (FrameRegs *regs = cx->maybeRegs()) {
         prev_ = regs->fp();
         prevpc_ = regs->pc;
         prevInline_ = regs->inlined();
@@ -198,16 +214,23 @@ StackFrame::initJitFrameLatePrologue(JSC
         return false;
     }
 
     scopeChain();
     SetValueRangeToUndefined(slots(), script()->nfixed);
     return true;
 }
 
+inline void
+StackFrame::overwriteCallee(JSObject &newCallee)
+{
+    JS_ASSERT(callee().getFunctionPrivate() == newCallee.getFunctionPrivate());
+    mutableCalleev().setObject(newCallee);
+}
+
 inline Value &
 StackFrame::canonicalActualArg(uintN i) const
 {
     if (i < numFormalArgs())
         return formalArg(i);
     JS_ASSERT(i < numActualArgs());
     return actualArgs()[i];
 }
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -762,20 +762,17 @@ class StackFrame
         return calleev;
     }
 
     /*
      * Beware! Ad hoc changes can corrupt the stack layout; the callee should
      * only be changed to something that is equivalent to the current callee in
      * terms of numFormalArgs etc. Prefer overwriteCallee since it checks.
      */
-    void overwriteCallee(JSObject &newCallee) {
-        JS_ASSERT(callee().getFunctionPrivate() == newCallee.getFunctionPrivate());
-        mutableCalleev().setObject(newCallee);
-    }
+    inline void overwriteCallee(JSObject &newCallee);
 
     Value &mutableCalleev() const {
         JS_ASSERT(isFunctionFrame());
         if (isEvalFrame())
             return ((Value *)this)[-2];
         return formalArgs()[-2];
     }