Bug 839212 - Remove TestIonCompile. r=bhackett
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 07 Feb 2013 22:12:46 +0100
changeset 131092 01a6b7b12470fcb796d844181f6cafac51e32def
parent 131091 25de4a425e883e00307e8d122dad457a85cad69f
child 131093 5d4df96a52cd09b892a3502774df5d98285629cb
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs839212
milestone21.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 839212 - Remove TestIonCompile. r=bhackett
js/src/ion/Ion.cpp
js/src/ion/Ion.h
js/src/methodjit/StubCalls.cpp
--- a/js/src/ion/Ion.cpp
+++ b/js/src/ion/Ion.cpp
@@ -1253,39 +1253,16 @@ SequentialCompileContext::compile(IonBui
 
     bool success = codegen->link();
 
     IonSpewEndFunction();
 
     return success ? AbortReason_NoAbort : AbortReason_Disable;
 }
 
-MethodStatus
-TestIonCompile(JSContext *cx, HandleScript script, HandleFunction fun, jsbytecode *osrPc, bool constructing)
-{
-    SequentialCompileContext compileContext;
-
-    AbortReason reason = IonCompile(cx, script, fun, osrPc, constructing, compileContext);
-
-    if (reason == AbortReason_Alloc)
-        return Method_Skipped;
-
-    if (reason == AbortReason_Inlining)
-        return Method_Skipped;
-
-    if (reason == AbortReason_Disable) {
-        if (!cx->isExceptionPending())
-            ForbidCompilation(cx, script);
-        return Method_CantCompile;
-    }
-
-    JS_ASSERT(reason == AbortReason_NoAbort);
-    return Method_Compiled;
-}
-
 static bool
 CheckFrame(AbstractFramePtr fp)
 {
     if (fp.isEvalFrame()) {
         // Eval frames are not yet supported. Supporting this will require new
         // logic in pushBailoutFrame to deal with linking prev.
         // Additionally, JSOP_DEFVAR support will require baking in isEvalFrame().
         IonSpew(IonSpew_Abort, "eval frame");
--- a/js/src/ion/Ion.h
+++ b/js/src/ion/Ion.h
@@ -319,17 +319,16 @@ void ToggleBarriers(JSCompartment *comp,
 
 class IonBuilder;
 class MIRGenerator;
 class CodeGenerator;
 
 CodeGenerator *CompileBackEnd(MIRGenerator *mir);
 void AttachFinishedCompilations(JSContext *cx);
 void FinishOffThreadBuilder(IonBuilder *builder);
-MethodStatus TestIonCompile(JSContext *cx, HandleScript script, HandleFunction fun, jsbytecode *osrPc, bool constructing);
 
 static inline bool IsEnabled(JSContext *cx)
 {
     return cx->hasRunOption(JSOPTION_ION) && cx->typeInferenceEnabled();
 }
 
 void ForbidCompilation(JSContext *cx, UnrootedScript script);
 void ForbidCompilation(JSContext *cx, UnrootedScript script, ExecutionMode mode);
--- a/js/src/methodjit/StubCalls.cpp
+++ b/js/src/methodjit/StubCalls.cpp
@@ -807,19 +807,24 @@ stubs::TriggerIonCompile(VMFrame &f)
          */
         if (!script->canIonCompile() || script->isIonCompilingOffThread())
             return;
 
         jsbytecode *osrPC = f.regs.pc;
         if (*osrPC != JSOP_LOOPENTRY)
             osrPC = NULL;
 
-        RootedFunction scriptFunction(f.cx, script->function());
-        ion::MethodStatus compileStatus =
-            ion::TestIonCompile(f.cx, script, scriptFunction, osrPC, f.fp()->isConstructing());
+        ion::MethodStatus compileStatus;
+        if (osrPC) {
+            compileStatus = ion::CanEnterAtBranch(f.cx, script, f.cx->fp(), osrPC,
+                                                  f.fp()->isConstructing());
+        } else {
+            compileStatus = ion::CanEnter(f.cx, script, f.cx->fp(), f.fp()->isConstructing(),
+                                          /* newType = */ false);
+        }
 
         if (compileStatus != ion::Method_Compiled) {
             if (f.cx->isExceptionPending())
                 THROW();
         }
 
         return;
     }