Bug 881366 - Simplify CheckOverrecursed sequences. r=sstangl
authorDan Gohman <sunfish@google.com>
Mon, 10 Jun 2013 15:48:10 -0700
changeset 134576 773df082bd35fca7b8ca9f19920f2bd2880659e1
parent 134575 7ef0e47cddd4d3df5f86d1e4a8617d3eba7a1a9d
child 134577 ca991d0bb5eadbc965412d810029880283ab56df
push id29280
push usersunfish@google.com
push dateMon, 10 Jun 2013 22:50:29 +0000
treeherdermozilla-inbound@ca991d0bb5ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs881366
milestone24.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 881366 - Simplify CheckOverrecursed sequences. r=sstangl
js/src/ion/CodeGenerator.cpp
js/src/ion/LIR-Common.h
js/src/ion/Lowering.cpp
js/src/jscntxt.cpp
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -2125,29 +2125,27 @@ CodeGenerator::visitCheckOverRecursed(LC
     // be some distance away from the actual limit, since if the limit is
     // crossed, an error must be thrown, which requires more frames.
     //
     // It must always be possible to trespass past the stack limit.
     // Ion may legally place frames very close to the limit. Calling additional
     // C functions may then violate the limit without any checking.
 
     JSRuntime *rt = gen->compartment->rt;
-    Register limitReg = ToRegister(lir->limitTemp());
 
     // Since Ion frames exist on the C stack, the stack limit may be
     // dynamically set by JS_SetThreadStackLimit() and JS_SetNativeStackQuota().
     uintptr_t *limitAddr = &rt->mainThread.ionStackLimit;
-    masm.loadPtr(AbsoluteAddress(limitAddr), limitReg);
 
     CheckOverRecursedFailure *ool = new CheckOverRecursedFailure(lir);
     if (!addOutOfLineCode(ool))
         return false;
 
     // Conditional forward (unlikely) branch to failure.
-    masm.branchPtr(Assembler::BelowOrEqual, StackPointer, limitReg, ool->entry());
+    masm.branchPtr(Assembler::AboveOrEqual, AbsoluteAddress(limitAddr), StackPointer, ool->entry());
     masm.bind(ool->rejoin());
 
     return true;
 }
 
 typedef bool (*DefVarOrConstFn)(JSContext *, HandlePropertyName, unsigned, HandleObject);
 static const VMFunction DefVarOrConstInfo =
     FunctionInfo<DefVarOrConstFn>(DefVarOrConst);
--- a/js/src/ion/LIR-Common.h
+++ b/js/src/ion/LIR-Common.h
@@ -539,28 +539,23 @@ class LInitProp : public LCallInstructio
         return getOperand(1);
     }
 
     MInitProp *mir() const {
         return mir_->toInitProp();
     }
 };
 
-class LCheckOverRecursed : public LInstructionHelper<0, 0, 1>
+class LCheckOverRecursed : public LInstructionHelper<0, 0, 0>
 {
   public:
     LIR_HEADER(CheckOverRecursed)
 
-    LCheckOverRecursed(const LDefinition &limitreg) {
-        setTemp(0, limitreg);
-    }
-
-    const LAllocation *limitTemp() {
-        return getTemp(0)->output();
-    }
+    LCheckOverRecursed()
+    { }
 };
 
 class LParCheckOverRecursed : public LInstructionHelper<0, 1, 1>
 {
   public:
     LIR_HEADER(ParCheckOverRecursed);
 
     LParCheckOverRecursed(const LAllocation &parSlice,
--- a/js/src/ion/Lowering.cpp
+++ b/js/src/ion/Lowering.cpp
@@ -97,17 +97,17 @@ LIRGenerator::visitTableSwitch(MTableSwi
         tempInt = temp(LDefinition::GENERAL);
     }
     return add(newLTableSwitch(index, tempInt, tableswitch));
 }
 
 bool
 LIRGenerator::visitCheckOverRecursed(MCheckOverRecursed *ins)
 {
-    LCheckOverRecursed *lir = new LCheckOverRecursed(temp());
+    LCheckOverRecursed *lir = new LCheckOverRecursed();
 
     if (!add(lir))
         return false;
     if (!assignSafepoint(lir, ins))
         return false;
 
     return true;
 }
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -1076,17 +1076,17 @@ js_InvokeOperationCallback(JSContext *cx
 
     /*
      * Reset the callback counter first, then run GC and yield. If another
      * thread is racing us here we will accumulate another callback request
      * which will be serviced at the next opportunity.
      */
     JS_ATOMIC_SET(&rt->interrupt, 0);
 
-    /* IonMonkey sets its stack limit to NULL to trigger operaton callbacks. */
+    /* IonMonkey sets its stack limit to UINTPTR_MAX to trigger operaton callbacks. */
     rt->resetIonStackLimit();
 
     if (rt->gcIsNeeded)
         GCSlice(rt, GC_NORMAL, rt->gcTriggerReason);
 
 #ifdef JSGC_GENERATIONAL
     if (rt->gcStoreBuffer.isAboutToOverflow())
         MinorGC(rt, JS::gcreason::FULL_STORE_BUFFER);