зеркало из https://github.com/mozilla/gecko-dev.git
Bug 881366 - Simplify CheckOverrecursed sequences. r=sstangl
This commit is contained in:
Родитель
df2cd63abe
Коммит
1ee7d9ff3b
|
@ -2130,19 +2130,17 @@ CodeGenerator::visitCheckOverRecursed(LCheckOverRecursed *lir)
|
|||
// 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;
|
||||
|
|
|
@ -544,18 +544,13 @@ class LInitProp : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0>
|
|||
}
|
||||
};
|
||||
|
||||
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>
|
||||
|
|
|
@ -102,7 +102,7 @@ LIRGenerator::visitTableSwitch(MTableSwitch *tableswitch)
|
|||
bool
|
||||
LIRGenerator::visitCheckOverRecursed(MCheckOverRecursed *ins)
|
||||
{
|
||||
LCheckOverRecursed *lir = new LCheckOverRecursed(temp());
|
||||
LCheckOverRecursed *lir = new LCheckOverRecursed();
|
||||
|
||||
if (!add(lir))
|
||||
return false;
|
||||
|
|
|
@ -1081,7 +1081,7 @@ js_InvokeOperationCallback(JSContext *cx)
|
|||
*/
|
||||
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче