Bug 851459 - Don't use ScriptFrameIter in EnsureCanEnterIon. r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 15 Mar 2013 20:29:44 +0100
changeset 127423 3d370087403ac2bbf528bb029c47b9ff885cbc91
parent 127422 1821ba8e3afce73f9150a85cb833d1013f1fb4fc
child 127424 ae738d911ded004d800287f06a3e7e87c2b9e6ef
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdjvj
bugs851459
milestone22.0a1
Bug 851459 - Don't use ScriptFrameIter in EnsureCanEnterIon. r=djvj
js/src/ion/BaselineIC.cpp
--- a/js/src/ion/BaselineIC.cpp
+++ b/js/src/ion/BaselineIC.cpp
@@ -574,27 +574,41 @@ ICStackCheck_Fallback::Compiler::generat
     masm.push(BaselineStubReg);
 
     return tailCallVM(DoStackCheckFallbackInfo, masm);
 }
 
 //
 // UseCount_Fallback
 //
+static bool
+IsTopFrameConstructing(JSContext *cx)
+{
+    IonFrameIterator iter(cx);
+    JS_ASSERT(iter.type() == IonFrame_Exit);
+
+    ++iter;
+    JS_ASSERT(iter.type() == IonFrame_BaselineStub);
+
+    ++iter;
+    JS_ASSERT(iter.isBaselineJS());
+
+    return iter.isConstructing();
+}
 
 static bool
 EnsureCanEnterIon(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *frame,
                   HandleScript script, jsbytecode *pc, void **jitcodePtr)
 {
     JS_ASSERT(jitcodePtr);
     JS_ASSERT(!*jitcodePtr);
 
     bool isLoopEntry = (JSOp(*pc) == JSOP_LOOPENTRY);
 
-    bool isConstructing = ScriptFrameIter(cx).isConstructing();
+    bool isConstructing = IsTopFrameConstructing(cx);
     MethodStatus stat;
     if (isLoopEntry) {
         IonSpew(IonSpew_BaselineOSR, "  Compile at loop entry!");
         stat = CanEnterAtBranch(cx, script, frame, pc, isConstructing);
     } else if (frame->isFunctionFrame()) {
         IonSpew(IonSpew_BaselineOSR, "  Compile function from top for later entry!");
         stat = CompileFunctionForBaseline(cx, script, frame, isConstructing);
     } else {