Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: src/wasm/function-body-decoder.cc

Issue 2771803005: Hide WasmModule.origin field behind readable accessors. (Closed)
Patch Set: Use boolean accessors instead of get_origin. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698