зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248860 - Odin: remove Expr::InterruptCheck (r=bbouvier)
MozReview-Commit-ID: CJqowKeSKmR
This commit is contained in:
Родитель
87b398ddda
Коммит
a6f672d070
|
@ -6082,26 +6082,6 @@ enum class InterruptCheckPosition {
|
|||
Loop
|
||||
};
|
||||
|
||||
static bool
|
||||
MaybeAddInterruptCheck(FunctionValidator& f, InterruptCheckPosition pos, ParseNode* pn)
|
||||
{
|
||||
if (f.m().mg().args().useSignalHandlersForInterrupt)
|
||||
return true;
|
||||
|
||||
switch (pos) {
|
||||
case InterruptCheckPosition::Head:
|
||||
if (!f.encoder().writeExpr(Expr::InterruptCheckHead))
|
||||
return false;
|
||||
break;
|
||||
case InterruptCheckPosition::Loop:
|
||||
if (!f.encoder().writeExpr(Expr::InterruptCheckLoop))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
CheckWhile(FunctionValidator& f, ParseNode* whileStmt)
|
||||
{
|
||||
|
@ -6118,8 +6098,7 @@ CheckWhile(FunctionValidator& f, ParseNode* whileStmt)
|
|||
if (!condType.isInt())
|
||||
return f.failf(cond, "%s is not a subtype of int", condType.toChars());
|
||||
|
||||
return MaybeAddInterruptCheck(f, InterruptCheckPosition::Loop, whileStmt) &&
|
||||
CheckStatement(f, body);
|
||||
return CheckStatement(f, body);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -6154,9 +6133,6 @@ CheckFor(FunctionValidator& f, ParseNode* forStmt)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!MaybeAddInterruptCheck(f, InterruptCheckPosition::Loop, forStmt))
|
||||
return false;
|
||||
|
||||
if (!CheckStatement(f, body))
|
||||
return false;
|
||||
|
||||
|
@ -6176,9 +6152,6 @@ CheckDoWhile(FunctionValidator& f, ParseNode* whileStmt)
|
|||
if (!f.encoder().writeExpr(Expr::DoWhile))
|
||||
return false;
|
||||
|
||||
if (!MaybeAddInterruptCheck(f, InterruptCheckPosition::Loop, cond))
|
||||
return false;
|
||||
|
||||
if (!CheckStatement(f, body))
|
||||
return false;
|
||||
|
||||
|
@ -6626,9 +6599,6 @@ CheckFunction(ModuleValidator& m)
|
|||
if (!CheckArguments(f, &stmtIter, &args))
|
||||
return false;
|
||||
|
||||
if (!MaybeAddInterruptCheck(f, InterruptCheckPosition::Head, fn))
|
||||
return false;
|
||||
|
||||
if (!CheckVariables(f, &stmtIter))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -255,9 +255,6 @@ enum class Expr : uint16_t
|
|||
|
||||
Id,
|
||||
|
||||
InterruptCheckHead,
|
||||
InterruptCheckLoop,
|
||||
|
||||
I32Min,
|
||||
I32Max,
|
||||
|
||||
|
|
|
@ -145,6 +145,8 @@ class FunctionCompiler
|
|||
return false;
|
||||
}
|
||||
|
||||
addInterruptCheck();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -589,6 +591,9 @@ class FunctionCompiler
|
|||
|
||||
void addInterruptCheck()
|
||||
{
|
||||
if (mg_.args().useSignalHandlersForInterrupt)
|
||||
return;
|
||||
|
||||
if (inDeadCode())
|
||||
return;
|
||||
|
||||
|
@ -2361,22 +2366,6 @@ EmitSimdOp(FunctionCompiler& f, ExprType type, SimdOperation op, MDefinition** d
|
|||
MOZ_CRASH("unexpected opcode");
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitInterruptCheck(FunctionCompiler& f)
|
||||
{
|
||||
f.addInterruptCheck();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitInterruptCheckLoop(FunctionCompiler& f)
|
||||
{
|
||||
if (!EmitInterruptCheck(f))
|
||||
return false;
|
||||
MDefinition* _;
|
||||
return EmitExprStmt(f, &_);
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitWhile(FunctionCompiler& f, const LabelVector* maybeLabels)
|
||||
{
|
||||
|
@ -2394,6 +2383,8 @@ EmitWhile(FunctionCompiler& f, const LabelVector* maybeLabels)
|
|||
if (!f.branchAndStartLoopBody(condDef, &afterLoop))
|
||||
return false;
|
||||
|
||||
f.addInterruptCheck();
|
||||
|
||||
MDefinition* _;
|
||||
if (!EmitExprStmt(f, &_))
|
||||
return false;
|
||||
|
@ -2429,6 +2420,8 @@ EmitFor(FunctionCompiler& f, Expr expr, const LabelVector* maybeLabels)
|
|||
if (!f.branchAndStartLoopBody(condDef, &afterLoop))
|
||||
return false;
|
||||
|
||||
f.addInterruptCheck();
|
||||
|
||||
MDefinition* _;
|
||||
if (!EmitExprStmt(f, &_))
|
||||
return false;
|
||||
|
@ -2454,6 +2447,8 @@ EmitDoWhile(FunctionCompiler& f, const LabelVector* maybeLabels)
|
|||
if (!f.startPendingLoop(headId, &loopEntry))
|
||||
return false;
|
||||
|
||||
f.addInterruptCheck();
|
||||
|
||||
MDefinition* _;
|
||||
if (!EmitExprStmt(f, &_))
|
||||
return false;
|
||||
|
@ -2706,10 +2701,6 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may
|
|||
case Expr::AtomicsFence:
|
||||
f.memoryBarrier(MembarFull);
|
||||
return true;
|
||||
case Expr::InterruptCheckHead:
|
||||
return EmitInterruptCheck(f);
|
||||
case Expr::InterruptCheckLoop:
|
||||
return EmitInterruptCheckLoop(f);
|
||||
// Common
|
||||
case Expr::GetLocal:
|
||||
return EmitGetLocal(f, type, def);
|
||||
|
|
Загрузка…
Ссылка в новой задаче