Bug 909499 part 2 - Rename jit::IsEnabled to jit::IsIonEnabled. r=njn
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 27 Aug 2013 12:50:53 +0200
changeset 144497 492fdffa7ab783084abb80248f60cf3e6e6a5cf7
parent 144496 77280a2a30b4b84328a3717591e9650a60d0e76b
child 144498 1b90b1ac58a8417ef204d1c7703da1a5a64fdb91
push id25166
push userryanvm@gmail.com
push dateWed, 28 Aug 2013 00:36:30 +0000
treeherderautoland@57fa024dfc5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs909499
milestone26.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 909499 part 2 - Rename jit::IsEnabled to jit::IsIonEnabled. r=njn
js/src/jit/BaselineIC.cpp
js/src/jit/Ion.cpp
js/src/jit/Ion.h
js/src/jit/shared/BaselineCompiler-shared.cpp
js/src/vm/ForkJoin.cpp
js/src/vm/Interpreter-inl.h
js/src/vm/Interpreter.cpp
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -852,17 +852,17 @@ PrepareOsrTempData(JSContext *cx, ICUseC
 static bool
 DoUseCountFallback(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *frame,
                    IonOsrTempData **infoPtr)
 {
     JS_ASSERT(infoPtr);
     *infoPtr = NULL;
 
     // A TI OOM will disable TI and Ion.
-    if (!jit::IsEnabled(cx))
+    if (!jit::IsIonEnabled(cx))
         return true;
 
     RootedScript script(cx, frame->script());
     jsbytecode *pc = stub->icEntry()->pc(script);
     bool isLoopEntry = JSOp(*pc) == JSOP_LOOPENTRY;
 
     FallbackICSpew(cx, stub, "UseCount(%d)", isLoopEntry ? int(pc - script->code) : int(-1));
 
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1803,17 +1803,17 @@ CanIonCompileScript(JSContext *cx, Handl
 
     return CheckScriptSize(cx, script) == Method_Compiled;
 }
 
 static MethodStatus
 Compile(JSContext *cx, HandleScript script, BaselineFrame *osrFrame, jsbytecode *osrPc,
         bool constructing, ExecutionMode executionMode)
 {
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
     JS_ASSERT(jit::IsBaselineEnabled(cx));
     JS_ASSERT_IF(osrPc != NULL, (JSOp)*osrPc == JSOP_LOOPENTRY);
 
     if (executionMode == SequentialExecution && !script->hasBaselineScript())
         return Method_Skipped;
 
     if (cx->compartment()->debugMode()) {
         IonSpew(IonSpew_Abort, "debugging");
@@ -1857,17 +1857,17 @@ Compile(JSContext *cx, HandleScript scri
 } // namespace js
 
 // Decide if a transition from interpreter execution to Ion code should occur.
 // May compile or recompile the target JSScript.
 MethodStatus
 jit::CanEnterAtBranch(JSContext *cx, JSScript *script, BaselineFrame *osrFrame,
                       jsbytecode *pc, bool isConstructing)
 {
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
     JS_ASSERT((JSOp)*pc == JSOP_LOOPENTRY);
 
     // Skip if the script has been disabled.
     if (!script->canIonCompile())
         return Method_Skipped;
 
     // Skip if the script is being compiled off thread.
     if (script->isIonCompilingOffThread())
@@ -1911,17 +1911,17 @@ jit::CanEnterAtBranch(JSContext *cx, JSS
     script->ionScript()->resetOsrPcMismatchCounter();
 
     return Method_Compiled;
 }
 
 MethodStatus
 jit::CanEnter(JSContext *cx, RunState &state)
 {
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
 
     JSScript *script = state.script();
 
     // Skip if the script has been disabled.
     if (!script->canIonCompile())
         return Method_Skipped;
 
     // Skip if the script is being compiled off thread.
@@ -1943,17 +1943,17 @@ jit::CanEnter(JSContext *cx, RunState &s
             ForbidCompilation(cx, script);
             return Method_CantCompile;
         }
 
         if (invoke.constructing() && invoke.args().thisv().isPrimitive()) {
             RootedScript scriptRoot(cx, script);
             RootedObject callee(cx, &invoke.args().callee());
             RootedObject obj(cx, CreateThisForFunction(cx, callee, invoke.useNewType()));
-            if (!obj || !jit::IsEnabled(cx)) // Note: OOM under CreateThis can disable TI.
+            if (!obj || !jit::IsIonEnabled(cx)) // Note: OOM under CreateThis can disable TI.
                 return Method_Skipped;
             invoke.args().setThis(ObjectValue(*obj));
             script = scriptRoot;
         }
     } else if (state.isGenerator()) {
         IonSpew(IonSpew_Abort, "generator frame");
         ForbidCompilation(cx, script);
         return Method_CantCompile;
@@ -1979,17 +1979,17 @@ jit::CanEnter(JSContext *cx, RunState &s
 
     return Method_Compiled;
 }
 
 MethodStatus
 jit::CompileFunctionForBaseline(JSContext *cx, HandleScript script, BaselineFrame *frame,
                                 bool isConstructing)
 {
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
     JS_ASSERT(frame->fun()->nonLazyScript()->canIonCompile());
     JS_ASSERT(!frame->fun()->nonLazyScript()->isIonCompilingOffThread());
     JS_ASSERT(!frame->fun()->nonLazyScript()->hasIonScript());
     JS_ASSERT(frame->isFunctionFrame());
 
     // Mark as forbidden if frame can't be handled.
     if (!CheckFrame(frame)) {
         ForbidCompilation(cx, script);
@@ -2048,17 +2048,17 @@ jit::CanEnterInParallel(JSContext *cx, H
     }
 
     return Method_Compiled;
 }
 
 MethodStatus
 jit::CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numActualArgs)
 {
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
 
     // Skip if the code is expected to result in a bailout.
     if (!script->hasIonScript() || script->ionScript()->bailoutExpected())
         return Method_Skipped;
 
     // Don't handle arguments underflow, to make this work we would have to pad
     // missing arguments with |undefined|.
     if (numActualArgs < script->function()->nargs)
@@ -2076,17 +2076,17 @@ jit::CanEnterUsingFastInvoke(JSContext *
 
     return Method_Compiled;
 }
 
 static IonExecStatus
 EnterIon(JSContext *cx, EnterJitData &data)
 {
     JS_CHECK_RECURSION(cx, return IonExec_Aborted);
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
     JS_ASSERT(!data.osrFrame);
 
     EnterIonCode enter = cx->runtime()->ionRuntime()->enterIon();
 
     // Caller must construct |this| before invoking the Ion function.
     JS_ASSERT_IF(data.constructing, data.maxArgv[0].isObject());
 
     data.result.setInt32(data.numActualArgs);
@@ -2191,17 +2191,17 @@ IonExecStatus
 jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
 {
     JS_CHECK_RECURSION(cx, return IonExec_Error);
 
     IonScript *ion = fun->nonLazyScript()->ionScript();
     IonCode *code = ion->method();
     void *jitcode = code->raw();
 
-    JS_ASSERT(jit::IsEnabled(cx));
+    JS_ASSERT(jit::IsIonEnabled(cx));
     JS_ASSERT(!ion->bailoutExpected());
 
     JitActivation activation(cx, /* firstFrameIsConstructing = */false);
 
     EnterIonCode enter = cx->runtime()->ionRuntime()->enterIon();
     void *calleeToken = CalleeToToken(fun);
 
     RootedValue result(cx, Int32Value(args.length()));
--- a/js/src/jit/Ion.h
+++ b/js/src/jit/Ion.h
@@ -354,17 +354,17 @@ bool OptimizeMIR(MIRGenerator *mir);
 LIRGraph *GenerateLIR(MIRGenerator *mir);
 CodeGenerator *GenerateCode(MIRGenerator *mir, LIRGraph *lir, MacroAssembler *maybeMasm = NULL);
 CodeGenerator *CompileBackEnd(MIRGenerator *mir, MacroAssembler *maybeMasm = NULL);
 
 void AttachFinishedCompilations(JSContext *cx);
 void FinishOffThreadBuilder(IonBuilder *builder);
 
 static inline bool
-IsEnabled(JSContext *cx)
+IsIonEnabled(JSContext *cx)
 {
     return cx->hasOption(JSOPTION_ION) &&
         cx->hasOption(JSOPTION_BASELINE) &&
         cx->typeInferenceEnabled();
 }
 
 inline bool
 IsIonInlinablePC(jsbytecode *pc) {
--- a/js/src/jit/shared/BaselineCompiler-shared.cpp
+++ b/js/src/jit/shared/BaselineCompiler-shared.cpp
@@ -11,18 +11,18 @@
 
 using namespace js;
 using namespace js::jit;
 
 BaselineCompilerShared::BaselineCompilerShared(JSContext *cx, HandleScript script)
   : cx(cx),
     script(cx, script),
     pc(script->code),
-    ionCompileable_(jit::IsEnabled(cx) && CanIonCompileScript(cx, script, false)),
-    ionOSRCompileable_(jit::IsEnabled(cx) && CanIonCompileScript(cx, script, true)),
+    ionCompileable_(jit::IsIonEnabled(cx) && CanIonCompileScript(cx, script, false)),
+    ionOSRCompileable_(jit::IsIonEnabled(cx) && CanIonCompileScript(cx, script, true)),
     debugMode_(cx->compartment()->debugMode()),
     analysis_(script),
     frame(cx, script, masm),
     stubSpace_(),
     icEntries_(),
     pcMappingEntries_(),
     icLoadLabels_(),
     pushedBeforeCall_(0),
--- a/js/src/vm/ForkJoin.cpp
+++ b/js/src/vm/ForkJoin.cpp
@@ -554,18 +554,18 @@ js::ParallelDo::apply()
     //   - Attempt parallel execution
     //     - If successful: return happily
     //     - If error: abort sadly
     //     - If bailout:
     //       - Invalidate any scripts that may need to be invalidated
     //       - Re-enqueue main script and any uncompiled scripts that were called
     // - Too many bailouts: Fallback to sequential
 
-    JS_ASSERT_IF(!jit::IsBaselineEnabled(cx_), !jit::IsEnabled(cx_));
-    if (!jit::IsBaselineEnabled(cx_) || !jit::IsEnabled(cx_))
+    JS_ASSERT_IF(!jit::IsBaselineEnabled(cx_), !jit::IsIonEnabled(cx_));
+    if (!jit::IsBaselineEnabled(cx_) || !jit::IsIonEnabled(cx_))
         return sequentialExecution(true);
 
     SpewBeginOp(cx_, "ParallelDo");
 
     uint32_t slices = ForkJoinSlices(cx_);
 
     if (!bailoutRecords_.resize(slices))
         return SpewEndOp(ExecutionFatal);
@@ -2146,16 +2146,16 @@ bool
 js::InExclusiveParallelSection()
 {
     return InParallelSection() && ForkJoinSlice::Current()->hasAcquiredContext();
 }
 
 bool
 js::ParallelTestsShouldPass(JSContext *cx)
 {
-    return jit::IsEnabled(cx) &&
+    return jit::IsIonEnabled(cx) &&
            jit::IsBaselineEnabled(cx) &&
            !jit::js_IonOptions.eagerCompilation &&
            jit::js_IonOptions.baselineUsesBeforeCompile != 0 &&
            cx->runtime()->gcZeal() == 0;
 }
 
 #endif // JS_THREADSAFE && JS_ION
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.h
@@ -676,17 +676,17 @@ class FastInvokeGuard
 #endif
 
   public:
     FastInvokeGuard(JSContext *cx, const Value &fval)
       : args_(cx)
       , fun_(cx)
       , script_(cx)
 #ifdef JS_ION
-      , useIon_(jit::IsEnabled(cx))
+      , useIon_(jit::IsIonEnabled(cx))
 #endif
     {
         JS_ASSERT(!InParallelSection());
         initFunction(fval);
     }
 
     void initFunction(const Value &fval) {
         if (fval.isObject() && fval.toObject().is<JSFunction>()) {
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -412,17 +412,17 @@ ExecuteState::pushInterpreterFrame(JSCon
 bool
 js::RunScript(JSContext *cx, RunState &state)
 {
     JS_CHECK_RECURSION(cx, return false);
 
     SPSEntryMarker marker(cx->runtime());
 
 #ifdef JS_ION
-    if (jit::IsEnabled(cx)) {
+    if (jit::IsIonEnabled(cx)) {
         jit::MethodStatus status = jit::CanEnter(cx, state);
         if (status == jit::Method_Error)
             return false;
         if (status == jit::Method_Compiled) {
             jit::IonExecStatus status = jit::Cannon(cx, state);
             return !IsErrorStatus(status);
         }
     }
@@ -2496,17 +2496,17 @@ BEGIN_CASE(JSOP_FUNCALL)
 
     TypeMonitorCall(cx, args, construct);
 
 #ifdef JS_ION
     InvokeState state(cx, args, initial);
     if (newType)
         state.setUseNewType();
 
-    if (!newType && jit::IsEnabled(cx)) {
+    if (!newType && jit::IsIonEnabled(cx)) {
         jit::MethodStatus status = jit::CanEnter(cx, state);
         if (status == jit::Method_Error)
             goto error;
         if (status == jit::Method_Compiled) {
             jit::IonExecStatus exec = jit::Cannon(cx, state);
             CHECK_BRANCH();
             regs.sp = args.spAfterCall();
             interpReturnOK = !IsErrorStatus(exec);