Bug 747288 - Reland renaming jitinfo to MJITinfo. (r=bhackett)
authorEric Faust <efaust@mozilla.com>
Fri, 27 Jul 2012 16:20:48 -0700
changeset 100788 b921323fa99efe38aade2f7fe3d4f161c851fae6
parent 100787 4b197ffb4dcc2561df68c2488d109be04da8edd9
child 100789 3109caaca43f51e51668946f2e2ecddbc378a3d6
push id23193
push userryanvm@gmail.com
push dateSat, 28 Jul 2012 21:54:39 +0000
treeherdermozilla-central@29bff59d3bbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs747288
milestone17.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 747288 - Reland renaming jitinfo to MJITinfo. (r=bhackett)
js/src/jsinferinlines.h
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsscriptinlines.h
js/src/methodjit/Compiler.cpp
js/src/methodjit/MethodJIT.cpp
js/src/methodjit/MethodJIT.h
js/src/methodjit/MonoIC.cpp
js/src/methodjit/Retcon.cpp
js/src/vm/Debugger.cpp
js/src/vm/GlobalObject.cpp
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -278,17 +278,17 @@ struct AutoEnterCompilation
             return false;
         return true;
     }
 
     ~AutoEnterCompilation()
     {
         CompilerOutput *co = info.compilerOutput(cx);
 #ifdef JS_METHODJIT
-        if (co->script->hasJITInfo())
+        if (co->script->hasMJITInfo())
             co->mjit = co->script->getJIT(co->constructing, co->barriers);
 #endif
         info.outputIndex = RecompileInfo::NoCompilerRunning;
     }
 };
 
 /////////////////////////////////////////////////////////////////////
 // Interface functions
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -2425,17 +2425,17 @@ JSScript::ensureHasDebugScript(JSContext
 
     return true;
 }
 
 void
 JSScript::recompileForStepMode(FreeOp *fop)
 {
 #ifdef JS_METHODJIT
-    if (hasJITInfo()) {
+    if (hasMJITInfo()) {
         mjit::Recompiler::clearStackReferences(fop, this);
         mjit::ReleaseScriptCode(fop, this);
     }
 #endif
 }
 
 bool
 JSScript::tryNewStepMode(JSContext *cx, uint32_t newValue)
@@ -2688,17 +2688,17 @@ JSScript::argumentsOptimizationFailed(JS
 
             /* Note: 'arguments' may have already been overwritten. */
             if (fp->unaliasedLocal(var).isMagic(JS_OPTIMIZED_ARGUMENTS))
                 fp->unaliasedLocal(var) = ObjectValue(*argsobj);
         }
     }
 
 #ifdef JS_METHODJIT
-    if (script->hasJITInfo()) {
+    if (script->hasMJITInfo()) {
         mjit::ExpandInlineFrames(cx->compartment);
         mjit::Recompiler::clearStackReferences(cx->runtime->defaultFreeOp(), script);
         mjit::ReleaseScriptCode(cx->runtime->defaultFreeOp(), script);
     }
 #endif
 
     if (script->hasAnalysis() && script->analysis()->ranInference()) {
         types::AutoEnterTypeInference enter(cx);
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -436,17 +436,17 @@ struct JSScript : public js::gc::Cell
 
     /* Persistent type information retained across GCs. */
     js::types::TypeScript *types;
 
     js::ScriptSource *source; /* source code */
 
   private:
 #ifdef JS_METHODJIT
-    JITScriptSet *jitInfo;
+    JITScriptSet *mJITInfo;
 #endif
     js::HeapPtrFunction function_;
     js::HeapPtrObject   enclosingScope_;
 
     // 32-bit fields.
 
   public:
     uint32_t        length;     /* length of code vector */
@@ -675,34 +675,34 @@ struct JSScript : public js::gc::Cell
 
 #ifdef JS_METHODJIT
   private:
     // CallCompiler must be a friend because it generates code that directly
     // accesses jitHandleNormal/jitHandleCtor, via jitHandleOffset().
     friend class js::mjit::CallCompiler;
 
   public:
-    bool hasJITInfo() {
-        return jitInfo != NULL;
+    bool hasMJITInfo() {
+        return mJITInfo != NULL;
     }
 
-    static size_t offsetOfJITInfo() { return offsetof(JSScript, jitInfo); }
+    static size_t offsetOfMJITInfo() { return offsetof(JSScript, mJITInfo); }
 
-    inline bool ensureHasJITInfo(JSContext *cx);
-    inline void destroyJITInfo(js::FreeOp *fop);
+    inline bool ensureHasMJITInfo(JSContext *cx);
+    inline void destroyMJITInfo(js::FreeOp *fop);
 
     JITScriptHandle *jitHandle(bool constructing, bool barriers) {
-        JS_ASSERT(jitInfo);
+        JS_ASSERT(mJITInfo);
         return constructing
-               ? (barriers ? &jitInfo->jitHandleCtorBarriered : &jitInfo->jitHandleCtor)
-               : (barriers ? &jitInfo->jitHandleNormalBarriered : &jitInfo->jitHandleNormal);
+               ? (barriers ? &mJITInfo->jitHandleCtorBarriered : &mJITInfo->jitHandleCtor)
+               : (barriers ? &mJITInfo->jitHandleNormalBarriered : &mJITInfo->jitHandleNormal);
     }
 
     js::mjit::JITScript *getJIT(bool constructing, bool barriers) {
-        if (!jitInfo)
+        if (!mJITInfo)
             return NULL;
         JITScriptHandle *jith = jitHandle(constructing, barriers);
         return jith->isValid() ? jith->getValid() : NULL;
     }
 
     static void ReleaseCode(js::FreeOp *fop, JITScriptHandle *jith);
 
     // These methods are implemented in MethodJIT.h.
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -189,29 +189,29 @@ inline bool
 JSScript::hasClearedGlobal() const
 {
     JS_ASSERT(types);
     return global().isCleared();
 }
 
 #ifdef JS_METHODJIT
 inline bool
-JSScript::ensureHasJITInfo(JSContext *cx)
+JSScript::ensureHasMJITInfo(JSContext *cx)
 {
-    if (jitInfo)
+    if (mJITInfo)
         return true;
-    jitInfo = cx->new_<JITScriptSet>();
-    return jitInfo != NULL;
+    mJITInfo = cx->new_<JITScriptSet>();
+    return mJITInfo != NULL;
 }
 
 inline void
-JSScript::destroyJITInfo(js::FreeOp *fop)
+JSScript::destroyMJITInfo(js::FreeOp *fop)
 {
-    fop->delete_(jitInfo);
-    jitInfo = NULL;
+    fop->delete_(mJITInfo);
+    mJITInfo = NULL;
 }
 #endif /* JS_METHODJIT */
 
 inline void
 JSScript::writeBarrierPre(JSScript *script)
 {
 #ifdef JSGC_INCREMENTAL
     if (!script)
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -106,17 +106,17 @@ mjit::Compiler::Compiler(JSContext *cx, 
 
 CompileStatus
 mjit::Compiler::compile()
 {
     JS_ASSERT(!outerChunkRef().chunk);
 
     CompileStatus status = performCompilation();
     if (status != Compile_Okay && status != Compile_Retry) {
-        if (!outerScript->ensureHasJITInfo(cx))
+        if (!outerScript->ensureHasMJITInfo(cx))
             return Compile_Error;
         JSScript::JITScriptHandle *jith = outerScript->jitHandle(isConstructing, cx->compartment->needsBarrier());
         JSScript::ReleaseCode(cx->runtime->defaultFreeOp(), jith);
         jith->setUnjittable();
 
         if (outerScript->function()) {
             outerScript->uninlineable = true;
             types::MarkTypeObjectFlags(cx, outerScript->function(),
@@ -925,17 +925,17 @@ mjit::CanMethodJIT(JSContext *cx, JSScri
      * If an SPS frame has already been pushed and profiling has since been
      * turned off, then we can't enter the jit because the epilogue of a pop
      * will not be emitted. Otherwise, we're safe with respect to balancing the
      * push/pops to the SPS sampling stack.
      */
     if (frame->hasPushedSPSFrame() && !cx->runtime->spsProfiler.enabled())
         return Compile_Skipped;
 
-    if (script->hasJITInfo()) {
+    if (script->hasMJITInfo()) {
         JSScript::JITScriptHandle *jith = script->jitHandle(construct, cx->compartment->needsBarrier());
         if (jith->isUnjittable())
             return Compile_Abort;
     }
 
     if (!cx->hasRunOption(JSOPTION_METHODJIT_ALWAYS) &&
         (cx->typeInferenceEnabled()
          ? script->incUseCount() <= INFER_USES_BEFORE_COMPILE
@@ -948,17 +948,17 @@ mjit::CanMethodJIT(JSContext *cx, JSScri
         return Compile_Error;
 
     // Ensure that constructors have at least one slot.
     if (construct && !script->nslots)
         script->nslots++;
 
     uint64_t gcNumber = cx->runtime->gcNumber;
 
-    if (!script->ensureHasJITInfo(cx))
+    if (!script->ensureHasMJITInfo(cx))
         return Compile_Error;
 
     JSScript::JITScriptHandle *jith = script->jitHandle(construct, cx->compartment->needsBarrier());
 
     JITScript *jit;
     if (jith->isEmpty()) {
         jit = MakeJITScript(cx, script);
         if (!jit)
--- a/js/src/methodjit/MethodJIT.cpp
+++ b/js/src/methodjit/MethodJIT.cpp
@@ -1357,20 +1357,20 @@ JSScript::JITScriptHandle::staticAsserts
     JS_STATIC_ASSERT(JS_ALIGNMENT_OF(JSScript::JITScriptHandle) ==
                      JS_ALIGNMENT_OF(js::mjit::JITScript *));
     JS_STATIC_ASSERT(offsetof(JSScript::JITScriptHandle, value) == 0);
 }
 
 size_t
 JSScript::sizeOfJitScripts(JSMallocSizeOfFun mallocSizeOf)
 {
-    if (!hasJITInfo())
+    if (!hasMJITInfo())
         return 0;
 
-    size_t n = mallocSizeOf(jitInfo);
+    size_t n = mallocSizeOf(mJITInfo);
     for (int constructing = 0; constructing <= 1; constructing++) {
         for (int barriers = 0; barriers <= 1; barriers++) {
             JITScript *jit = getJIT((bool) constructing, (bool) barriers);
             if (jit)
                 n += jit->sizeOfIncludingThis(mallocSizeOf);
         }
     }
     return n;
--- a/js/src/methodjit/MethodJIT.h
+++ b/js/src/methodjit/MethodJIT.h
@@ -865,28 +865,28 @@ enum CompileRequest
 
 CompileStatus
 CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
              bool construct, CompileRequest request, StackFrame *sp);
 
 inline void
 ReleaseScriptCode(FreeOp *fop, JSScript *script)
 {
-    if (!script->hasJITInfo())
+    if (!script->hasMJITInfo())
         return;
 
     for (int constructing = 0; constructing <= 1; constructing++) {
         for (int barriers = 0; barriers <= 1; barriers++) {
             JSScript::JITScriptHandle *jith = script->jitHandle((bool) constructing, (bool) barriers);
             if (jith && jith->isValid())
                 JSScript::ReleaseCode(fop, jith);
         }
     }
 
-    script->destroyJITInfo(fop);
+    script->destroyMJITInfo(fop);
 }
 
 // Expand all stack frames inlined by the JIT within a compartment.
 void
 ExpandInlineFrames(JSCompartment *compartment);
 
 // Return all VMFrames in a compartment to the interpreter. This must be
 // followed by destroying all JIT code in the compartment.
--- a/js/src/methodjit/MonoIC.cpp
+++ b/js/src/methodjit/MonoIC.cpp
@@ -568,20 +568,20 @@ class CallCompiler : public BaseCompiler
         void *ncode = ic.funGuard.labelAtOffset(ic.joinPointOffset).executableAddress();
         inlFrame.assemble(ncode, f.pc());
 
         /* funObjReg is still valid. Check if a compilation is needed. */
         Address scriptAddr(ic.funObjReg, JSFunction::offsetOfNativeOrScript());
         masm.loadPtr(scriptAddr, t0);
 
         // Test that:
-        // - script->jitInfo is not NULL
-        // - script->jitInfo->jitHandle{Ctor,Normal}->value is neither NULL nor UNJITTABLE, and
-        // - script->jitInfo->jitHandle{Ctor,Normal}->value->arityCheckEntry is not NULL.
-        masm.loadPtr(Address(t0, JSScript::offsetOfJITInfo()), t0);
+        // - script->mJITInfo is not NULL
+        // - script->mJITInfo->jitHandle{Ctor,Normal}->value is neither NULL nor UNJITTABLE, and
+        // - script->mJITInfo->jitHandle{Ctor,Normal}->value->arityCheckEntry is not NULL.
+        masm.loadPtr(Address(t0, JSScript::offsetOfMJITInfo()), t0);
         Jump hasNoJitInfo = masm.branchPtr(Assembler::Equal, t0, ImmPtr(NULL));
         size_t offset = JSScript::JITScriptSet::jitHandleOffset(callingNew,
                                                                 f.cx->compartment->needsBarrier());
         masm.loadPtr(Address(t0, offset), t0);
         Jump hasNoJitCode = masm.branchPtr(Assembler::BelowOrEqual, t0,
                                            ImmPtr(JSScript::JITScriptHandle::UNJITTABLE));
 
         masm.loadPtr(Address(t0, offsetof(JITScript, arityCheckEntry)), t0);
--- a/js/src/methodjit/Retcon.cpp
+++ b/js/src/methodjit/Retcon.cpp
@@ -389,17 +389,17 @@ ClearAllFrames(JSCompartment *compartmen
  *
  * - For VMFrames whose entryncode address (the value of entryfp->ncode before
  *   being clobbered with JaegerTrampolineReturn) is in the original script,
  *   redirect that entryncode to the interpoline.
  */
 void
 Recompiler::clearStackReferences(FreeOp *fop, JSScript *script)
 {
-    JS_ASSERT(script->hasJITInfo());
+    JS_ASSERT(script->hasMJITInfo());
 
     JaegerSpew(JSpew_Recompile, "recompiling script (file \"%s\") (line \"%d\") (length \"%d\")\n",
                script->filename, script->lineno, script->length);
 
     JSCompartment *comp = script->compartment();
     types::AutoEnterTypeInference enter(fop, comp);
 
     /*
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -228,17 +228,17 @@ BreakpointSite::BreakpointSite(JSScript 
     JS_ASSERT(!script->hasBreakpointsAt(pc));
     JS_INIT_CLIST(&breakpoints);
 }
 
 void
 BreakpointSite::recompile(FreeOp *fop)
 {
 #ifdef JS_METHODJIT
-    if (script->hasJITInfo()) {
+    if (script->hasMJITInfo()) {
         mjit::Recompiler::clearStackReferences(fop, script);
         mjit::ReleaseScriptCode(fop, script);
     }
 #endif
 }
 
 void
 BreakpointSite::inc(FreeOp *fop)
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -499,17 +499,17 @@ GlobalObject::clear(JSContext *cx)
 #ifdef JS_METHODJIT
     /*
      * Destroy compiled code for any scripts parented to this global. Call ICs
      * can directly call scripts which have associated JIT code, and do so
      * without checking whether the script's global has been cleared.
      */
     for (gc::CellIter i(cx->compartment, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
         JSScript *script = i.get<JSScript>();
-        if (script->compileAndGo && script->hasJITInfo() && script->hasClearedGlobal()) {
+        if (script->compileAndGo && script->hasMJITInfo() && script->hasClearedGlobal()) {
             mjit::Recompiler::clearStackReferences(cx->runtime->defaultFreeOp(), script);
             mjit::ReleaseScriptCode(cx->runtime->defaultFreeOp(), script);
         }
     }
 #endif
 }
 
 bool