Bug 877444: Remove new 'inline function used but not defined' warnings for ScriptSourceObject-related functions. r=terrence
authorJim Blandy <jimb@mozilla.com>
Thu, 06 Jun 2013 14:47:12 -0700
changeset 134308 072142c689395a82ff7de705e746c860197485ef
parent 134307 fab0b456189c2d89b40f03363b120349e0d5d1a6
child 134309 1e50dde140bc0f1325b4b11d34aff0e578b4f8b5
push id24791
push userryanvm@gmail.com
push dateFri, 07 Jun 2013 15:11:44 +0000
treeherdermozilla-central@6f32011a27ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs877444
milestone24.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 877444: Remove new 'inline function used but not defined' warnings for ScriptSourceObject-related functions. r=terrence
js/src/jsscript.h
js/src/jsscriptinlines.h
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -630,19 +630,17 @@ class JSScript : public js::gc::Cell
     void setOriginalFunctionObject(JSObject *fun);
 
     JSFlatString *sourceData(JSContext *cx);
 
     static bool loadSource(JSContext *cx, js::HandleScript scr, bool *worked);
 
     js::ScriptSource *scriptSource() const;
 
-    js::ScriptSourceObject *sourceObject() const {
-        return &sourceObject_->asScriptSource();;
-    }
+    js::ScriptSourceObject *sourceObject() const;
 
     void setSourceObject(js::ScriptSourceObject *sourceObject);
 
     inline const char *filename() const;
 
   public:
 
     /* Return whether this script was compiled for 'eval' */
@@ -1093,20 +1091,17 @@ class ScriptSourceHolder
     }
 };
 
 class ScriptSourceObject : public JSObject {
   public:
     static void finalize(FreeOp *fop, JSObject *obj);
     static ScriptSourceObject *create(JSContext *cx, ScriptSource *source);
 
-    ScriptSource *source() {
-        return static_cast<ScriptSource *>(getReservedSlot(SOURCE_SLOT).toPrivate());
-    }
-
+    inline ScriptSource *source();
     void setSource(ScriptSource *source);
 
   private:
     static const uint32_t SOURCE_SLOT = 0;
 };
 
 // Information about a script which may be (or has been) lazily compiled to
 // bytecode from its source.
@@ -1429,23 +1424,16 @@ struct ScriptAndCounts
 
     ion::IonScriptCounts *getIonCounts() const {
         return scriptCounts.ionCounts;
     }
 };
 
 } /* namespace js */
 
-inline js::ScriptSourceObject &
-JSObject::asScriptSource()
-{
-    JS_ASSERT(isScriptSource());
-    return *static_cast<js::ScriptSourceObject *>(this);
-}
-
 extern jssrcnote *
 js_GetSrcNote(JSContext *cx, JSScript *script, jsbytecode *pc);
 
 extern jsbytecode *
 js_LineNumberToPC(JSScript *script, unsigned lineno);
 
 extern JS_FRIEND_API(unsigned)
 js_GetScriptLineExtent(JSScript *script);
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -97,16 +97,21 @@ JSScript::setFunction(JSFunction *fun)
 }
 
 inline js::ScriptSource *
 JSScript::scriptSource() const
 {
     return sourceObject()->source();
 }
 
+inline js::ScriptSourceObject *
+JSScript::sourceObject() const {
+    return &sourceObject_->asScriptSource();
+}
+
 inline JSFunction *
 JSScript::getFunction(size_t index)
 {
     JSObject *funobj = getObject(index);
 #ifdef DEBUG
     JSFunction *fun = funobj->toFunction();
     JS_ASSERT_IF(fun->isNative(), IsAsmJSModuleNative(fun->native()));
 #endif
@@ -216,9 +221,21 @@ JSScript::originalFunction() const {
 
 inline void
 JSScript::setOriginalFunctionObject(JSObject *fun) {
     JS_ASSERT(isCallsiteClone);
     JS_ASSERT(fun->isFunction());
     enclosingScopeOrOriginalFunction_ = fun;
 }
 
+inline js::ScriptSource *
+js::ScriptSourceObject::source() {
+    return static_cast<ScriptSource *>(getReservedSlot(SOURCE_SLOT).toPrivate());
+}
+
+inline js::ScriptSourceObject &
+JSObject::asScriptSource()
+{
+    JS_ASSERT(isScriptSource());
+    return *static_cast<js::ScriptSourceObject *>(this);
+}
+
 #endif /* jsscriptinlines_h___ */