зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1286517: Rename {Load/Store}Global to {Get,Set}Global in wasm bytecode; r=luke
MozReview-Commit-ID: 5BGgPC487xm --HG-- extra : rebase_source : 3cf3e73a0113a94e11b8ba8f2df0cfd23acfbb10
This commit is contained in:
Родитель
ab3ab6c2aa
Коммит
b4f8b1aae8
|
@ -3905,7 +3905,7 @@ CheckVarRef(FunctionValidator& f, ParseNode* varRef, Type* type)
|
|||
case ModuleValidator::Global::ConstantImport:
|
||||
case ModuleValidator::Global::Variable: {
|
||||
*type = global->varOrConstType();
|
||||
return f.encoder().writeExpr(Expr::LoadGlobal) &&
|
||||
return f.encoder().writeExpr(Expr::GetGlobal) &&
|
||||
f.encoder().writeVarU32(global->varOrConstIndex());
|
||||
}
|
||||
case ModuleValidator::Global::Function:
|
||||
|
@ -4197,7 +4197,7 @@ CheckAssignName(FunctionValidator& f, ParseNode* lhs, ParseNode* rhs, Type* type
|
|||
Type globType = global->varOrConstType();
|
||||
if (!(rhsType <= globType))
|
||||
return f.failf(lhs, "%s is not a subtype of %s", rhsType.toChars(), globType.toChars());
|
||||
if (!f.encoder().writeExpr(Expr::StoreGlobal))
|
||||
if (!f.encoder().writeExpr(Expr::SetGlobal))
|
||||
return false;
|
||||
if (!f.encoder().writeVarU32(global->varOrConstIndex()))
|
||||
return false;
|
||||
|
|
|
@ -6036,9 +6036,9 @@ BaseCompiler::emitBody()
|
|||
CHECK_NEXT(emitGetLocal());
|
||||
case Expr::SetLocal:
|
||||
CHECK_NEXT(emitSetLocal());
|
||||
case Expr::LoadGlobal:
|
||||
case Expr::GetGlobal:
|
||||
CHECK_NEXT(emitGetGlobal());
|
||||
case Expr::StoreGlobal:
|
||||
case Expr::SetGlobal:
|
||||
CHECK_NEXT(emitSetGlobal());
|
||||
|
||||
// Select
|
||||
|
|
|
@ -271,13 +271,15 @@ enum class Expr
|
|||
// i64.eqz.
|
||||
I64Eqz = 0xba,
|
||||
|
||||
// Global access.
|
||||
GetGlobal = 0xc0,
|
||||
SetGlobal = 0xc1,
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// The rest of these operators are currently only emitted internally when
|
||||
// compiling asm.js and are rejected by wasm validation.
|
||||
|
||||
// asm.js-specific operators
|
||||
LoadGlobal = 0xc0,
|
||||
StoreGlobal,
|
||||
I32Min,
|
||||
I32Max,
|
||||
I32Neg,
|
||||
|
|
|
@ -329,10 +329,10 @@ wasm::Classify(Expr expr)
|
|||
case Expr::Select:
|
||||
return ExprKind::Select;
|
||||
case Expr::GetLocal:
|
||||
case Expr::LoadGlobal:
|
||||
case Expr::GetGlobal:
|
||||
return ExprKind::GetVar;
|
||||
case Expr::SetLocal:
|
||||
case Expr::StoreGlobal:
|
||||
case Expr::SetGlobal:
|
||||
return ExprKind::SetVar;
|
||||
case Expr::Call:
|
||||
return ExprKind::Call;
|
||||
|
|
|
@ -2829,9 +2829,9 @@ EmitExpr(FunctionCompiler& f)
|
|||
return EmitGetLocal(f);
|
||||
case Expr::SetLocal:
|
||||
return EmitSetLocal(f);
|
||||
case Expr::LoadGlobal:
|
||||
case Expr::GetGlobal:
|
||||
return EmitGetGlobal(f);
|
||||
case Expr::StoreGlobal:
|
||||
case Expr::SetGlobal:
|
||||
return EmitSetGlobal(f);
|
||||
|
||||
// Select
|
||||
|
|
Загрузка…
Ссылка в новой задаче