Index: src/wasm/function-body-decoder.cc |
diff --git a/src/wasm/function-body-decoder.cc b/src/wasm/function-body-decoder.cc |
index 71605d0d784732f14742c7a06b00f02d9c173506..ba86133155b3c705e41ea4841c6f0f6bb37f4159 100644 |
--- a/src/wasm/function-body-decoder.cc |
+++ b/src/wasm/function-body-decoder.cc |
@@ -35,13 +35,13 @@ namespace wasm { |
#define TRACE(...) |
#endif |
-#define CHECK_PROTOTYPE_OPCODE(flag) \ |
- if (module_ != nullptr && module_->origin == kAsmJsOrigin) { \ |
- error("Opcode not supported for asmjs modules"); \ |
- } \ |
- if (!FLAG_##flag) { \ |
- error("Invalid opcode (enable with --" #flag ")"); \ |
- break; \ |
+#define CHECK_PROTOTYPE_OPCODE(flag) \ |
+ if (module_ != nullptr && module_->is_asm_js()) { \ |
+ error("Opcode not supported for asmjs modules"); \ |
+ } \ |
+ if (!FLAG_##flag) { \ |
+ error("Invalid opcode (enable with --" #flag ")"); \ |
+ break; \ |
} |
// An SsaEnv environment carries the current local variable renaming |
@@ -1194,7 +1194,7 @@ class WasmFullDecoder : public WasmDecoder { |
if (!CheckHasMemory()) break; |
MemoryIndexOperand operand(this, pc_); |
DCHECK_NOT_NULL(module_); |
- if (module_->origin != kAsmJsOrigin) { |
+ if (module_->is_wasm()) { |
Value val = Pop(0, kWasmI32); |
Push(kWasmI32, BUILD(GrowMemory, val.node)); |
} else { |
@@ -1245,7 +1245,7 @@ class WasmFullDecoder : public WasmDecoder { |
break; |
} |
case kAtomicPrefix: { |
- if (module_ == nullptr || module_->origin != kAsmJsOrigin) { |
+ if (module_ == nullptr || !module_->is_asm_js()) { |
error("Atomics are allowed only in AsmJs modules"); |
break; |
} |
@@ -1264,7 +1264,7 @@ class WasmFullDecoder : public WasmDecoder { |
} |
default: { |
// Deal with special asmjs opcodes. |
- if (module_ != nullptr && module_->origin == kAsmJsOrigin) { |
+ if (module_ != nullptr && module_->is_asm_js()) { |
sig = WasmOpcodes::AsmjsSignature(opcode); |
if (sig) { |
BuildSimpleOperator(opcode, sig); |