Bug 891215 (part 8) - Slim down CompileInfo-inl.h. r=terrence.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 08 Jul 2013 21:40:19 -0700
changeset 137844 2fea433d4a88829b2aea8260e86b103336ad7414
parent 137843 defc6801c431ca073e5fecf33dc00203b146a2d7
child 137845 f15355fab6b4fb5a6b30fd6a98c92fee798284d8
push id30739
push usernnethercote@mozilla.com
push dateWed, 10 Jul 2013 00:08:47 +0000
treeherdermozilla-inbound@79d75a5b45cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs891215
milestone25.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 891215 (part 8) - Slim down CompileInfo-inl.h. r=terrence.
js/src/ion/CompileInfo-inl.h
js/src/ion/CompileInfo.h
--- a/js/src/ion/CompileInfo-inl.h
+++ b/js/src/ion/CompileInfo-inl.h
@@ -3,85 +3,26 @@
  * 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 ion_CompileInfo_inl_h
 #define ion_CompileInfo_inl_h
 
 #include "ion/CompileInfo.h"
-#include "jsgcinlines.h"
 #include "jsscriptinlines.h"
 
 using namespace js;
 using namespace ion;
 
-CompileInfo::CompileInfo(JSScript *script, JSFunction *fun, jsbytecode *osrPc, bool constructing,
-                         ExecutionMode executionMode)
-  : script_(script), fun_(fun), osrPc_(osrPc), constructing_(constructing),
-    executionMode_(executionMode)
-{
-    JS_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOP_LOOPENTRY);
-
-    // The function here can flow in from anywhere so look up the canonical function to ensure that
-    // we do not try to embed a nursery pointer in jit-code.
-    if (fun_) {
-        fun_ = fun_->nonLazyScript()->function();
-        JS_ASSERT(fun_->isTenured());
-    }
-
-    nimplicit_ = StartArgSlot(script, fun)              /* scope chain and argument obj */
-               + (fun ? 1 : 0);                         /* this */
-    nargs_ = fun ? fun->nargs : 0;
-    nlocals_ = script->nfixed;
-    nstack_ = script->nslots - script->nfixed;
-    nslots_ = nimplicit_ + nargs_ + nlocals_ + nstack_;
-}
-
-const char *
-CompileInfo::filename() const
-{
-    return script_->filename();
-}
-
-JSAtom *
-CompileInfo::getAtom(jsbytecode *pc) const
-{
-    return script_->getAtom(GET_UINT32_INDEX(pc));
-}
-
-PropertyName *
-CompileInfo::getName(jsbytecode *pc) const
-{
-    return script_->getName(GET_UINT32_INDEX(pc));
-}
-
-RegExpObject *
+inline RegExpObject *
 CompileInfo::getRegExp(jsbytecode *pc) const
 {
     return script_->getRegExp(GET_UINT32_INDEX(pc));
 }
 
-JSFunction *
+inline JSFunction *
 CompileInfo::getFunction(jsbytecode *pc) const
 {
     return script_->getFunction(GET_UINT32_INDEX(pc));
 }
 
-JSObject *
-CompileInfo::getObject(jsbytecode *pc) const
-{
-    return script_->getObject(GET_UINT32_INDEX(pc));
-}
-
-const Value &
-CompileInfo::getConst(jsbytecode *pc) const
-{
-    return script_->getConst(GET_UINT32_INDEX(pc));
-}
-
-jssrcnote *
-CompileInfo::getNote(JSContext *cx, jsbytecode *pc) const
-{
-    return js_GetSrcNote(cx, script(), pc);
-}
-
 #endif /* ion_CompileInfo_inl_h */
--- a/js/src/ion/CompileInfo.h
+++ b/js/src/ion/CompileInfo.h
@@ -35,17 +35,36 @@ enum ExecutionMode {
     ParallelExecution
 };
 
 // Contains information about the compilation source for IR being generated.
 class CompileInfo
 {
   public:
     CompileInfo(JSScript *script, JSFunction *fun, jsbytecode *osrPc, bool constructing,
-                ExecutionMode executionMode);
+                ExecutionMode executionMode)
+      : script_(script), fun_(fun), osrPc_(osrPc), constructing_(constructing),
+        executionMode_(executionMode)
+    {
+        JS_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOP_LOOPENTRY);
+
+        // The function here can flow in from anywhere so look up the canonical function to ensure that
+        // we do not try to embed a nursery pointer in jit-code.
+        if (fun_) {
+            fun_ = fun_->nonLazyScript()->function();
+            JS_ASSERT(fun_->isTenured());
+        }
+
+        nimplicit_ = StartArgSlot(script, fun)              /* scope chain and argument obj */
+                   + (fun ? 1 : 0);                         /* this */
+        nargs_ = fun ? fun->nargs : 0;
+        nlocals_ = script->nfixed;
+        nstack_ = script->nslots - script->nfixed;
+        nslots_ = nimplicit_ + nargs_ + nlocals_ + nstack_;
+    }
 
     CompileInfo(unsigned nlocals, ExecutionMode executionMode)
       : script_(NULL), fun_(NULL), osrPc_(NULL), constructing_(false),
         executionMode_(executionMode)
     {
         nimplicit_ = 0;
         nargs_ = 0;
         nlocals_ = nlocals;
@@ -73,34 +92,52 @@ class CompileInfo
 
     jsbytecode *startPC() const {
         return script_->code;
     }
     jsbytecode *limitPC() const {
         return script_->code + script_->length;
     }
 
-    inline const char *filename() const;
+    const char *filename() const {
+        return script_->filename();
+    }
 
     unsigned lineno() const {
         return script_->lineno;
     }
     unsigned lineno(JSContext *cx, jsbytecode *pc) const {
         return PCToLineNumber(script_, pc);
     }
 
     // Script accessors based on PC.
 
-    inline JSAtom *getAtom(jsbytecode *pc) const;
-    inline PropertyName *getName(jsbytecode *pc) const;
+    JSAtom *getAtom(jsbytecode *pc) const {
+        return script_->getAtom(GET_UINT32_INDEX(pc));
+    }
+
+    PropertyName *getName(jsbytecode *pc) const {
+        return script_->getName(GET_UINT32_INDEX(pc));
+    }
+
     inline RegExpObject *getRegExp(jsbytecode *pc) const;
-    inline JSObject *getObject(jsbytecode *pc) const;
+
+    JSObject *getObject(jsbytecode *pc) const {
+        return script_->getObject(GET_UINT32_INDEX(pc));
+    }
+
     inline JSFunction *getFunction(jsbytecode *pc) const;
-    inline const Value &getConst(jsbytecode *pc) const;
-    inline jssrcnote *getNote(JSContext *cx, jsbytecode *pc) const;
+
+    const Value &getConst(jsbytecode *pc) const {
+        return script_->getConst(GET_UINT32_INDEX(pc));
+    }
+
+    jssrcnote *getNote(JSContext *cx, jsbytecode *pc) const {
+        return js_GetSrcNote(cx, script(), pc);
+    }
 
     // Total number of slots: args, locals, and stack.
     unsigned nslots() const {
         return nslots_;
     }
 
     unsigned nargs() const {
         return nargs_;