Bug 1286517: Rename {Load/Store}Global to {Get,Set}Global in wasm bytecode; r=luke
authorBenjamin Bouvier <benj@benj.me>
Fri, 22 Jul 2016 14:29:17 +0200
changeset 346751 d504768f3183ab17001e1167bbee36822c159f2e
parent 346750 39784b9cd9262a7ed15d31dc1f5b8f2cbf8ab412
child 346752 45243283a2cd099101d975d66485d32a093ba3ea
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1286517
milestone50.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 1286517: Rename {Load/Store}Global to {Get,Set}Global in wasm bytecode; r=luke MozReview-Commit-ID: 5BGgPC487xm
js/src/asmjs/AsmJS.cpp
js/src/asmjs/WasmBaselineCompile.cpp
js/src/asmjs/WasmBinary.h
js/src/asmjs/WasmBinaryIterator.cpp
js/src/asmjs/WasmIonCompile.cpp
--- a/js/src/asmjs/AsmJS.cpp
+++ b/js/src/asmjs/AsmJS.cpp
@@ -3900,17 +3900,17 @@ CheckVarRef(FunctionValidator& f, ParseN
     if (const ModuleValidator::Global* global = f.lookupGlobal(name)) {
         switch (global->which()) {
           case ModuleValidator::Global::ConstantLiteral:
             *type = global->varOrConstType();
             return f.writeConstExpr(global->constLiteralValue());
           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:
           case ModuleValidator::Global::FFI:
           case ModuleValidator::Global::MathBuiltinFunction:
           case ModuleValidator::Global::AtomicsBuiltinFunction:
           case ModuleValidator::Global::FuncPtrTable:
           case ModuleValidator::Global::ArrayView:
@@ -4192,17 +4192,17 @@ CheckAssignName(FunctionValidator& f, Pa
 
         Type rhsType;
         if (!CheckExpr(f, rhs, &rhsType))
             return false;
 
         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;
 
         *type = rhsType;
         return true;
     }
 
--- a/js/src/asmjs/WasmBaselineCompile.cpp
+++ b/js/src/asmjs/WasmBaselineCompile.cpp
@@ -6031,19 +6031,19 @@ BaseCompiler::emitBody()
           case Expr::CallImport:
             CHECK_NEXT(emitCallImport(exprOffset));
 
           // Locals and globals
           case Expr::GetLocal:
             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
           case Expr::Select:
             CHECK_NEXT(emitSelect());
 
           // I32
           case Expr::I32Const: {
--- a/js/src/asmjs/WasmBinary.h
+++ b/js/src/asmjs/WasmBinary.h
@@ -266,23 +266,25 @@ enum class Expr
     I32Rotr                              = 0xb6,
     I32Rotl                              = 0xb7,
     I64Rotr                              = 0xb8,
     I64Rotl                              = 0xb9,
 
     // 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,
     I32BitNot,
     I32Abs,
     F32StoreF64,
     F64StoreF32,
     F64Mod,
--- a/js/src/asmjs/WasmBinaryIterator.cpp
+++ b/js/src/asmjs/WasmBinaryIterator.cpp
@@ -324,20 +324,20 @@ wasm::Classify(Expr expr)
       case Expr::F32x4store:
       case Expr::F32x4store1:
       case Expr::F32x4store2:
       case Expr::F32x4store3:
         return ExprKind::Store;
       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;
       case Expr::CallIndirect:
         return ExprKind::CallIndirect;
       case Expr::CallImport:
         return ExprKind::CallImport;
       case Expr::Return:
--- a/js/src/asmjs/WasmIonCompile.cpp
+++ b/js/src/asmjs/WasmIonCompile.cpp
@@ -2824,19 +2824,19 @@ EmitExpr(FunctionCompiler& f)
       case Expr::CallImport:
         return EmitCallImport(f, exprOffset);
 
       // Locals and globals
       case Expr::GetLocal:
         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
       case Expr::Select:
         return EmitSelect(f);
 
       // I32
       case Expr::I32Const: {