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

Unified Diff: src/wasm/ast-decoder.cc

Issue 2440953002: [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. (Closed)
Patch Set: Fix imported table kind. Created 4 years, 2 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/wasm/ast-decoder.h ('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/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index 84b64d6d8ddf3d02306fbe94d6f1c90abbb17aae..ff5211d8fb80dbc2729193db331fd873fb7180fb 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -317,6 +317,11 @@ class WasmDecoder : public Decoder {
ImmI64Operand operand(this, pc);
return 1 + operand.length;
}
+ case kExprGrowMemory:
+ case kExprMemorySize: {
+ MemoryIndexOperand operand(this, pc);
+ return 1 + operand.length;
+ }
case kExprI8Const:
return 2;
case kExprF32Const:
@@ -1102,17 +1107,23 @@ class WasmFullDecoder : public WasmDecoder {
case kExprF64StoreMem:
len = DecodeStoreMem(kAstF64, MachineType::Float64());
break;
- case kExprGrowMemory:
+ case kExprGrowMemory: {
+ MemoryIndexOperand operand(this, pc_);
if (module_->origin != kAsmJsOrigin) {
Value val = Pop(0, kAstI32);
Push(kAstI32, BUILD(GrowMemory, val.node));
} else {
error("grow_memory is not supported for asmjs modules");
}
+ len = 1 + operand.length;
break;
- case kExprMemorySize:
+ }
+ case kExprMemorySize: {
+ MemoryIndexOperand operand(this, pc_);
Push(kAstI32, BUILD(CurrentMemoryPages));
+ len = 1 + operand.length;
break;
+ }
case kExprCallFunction: {
CallFunctionOperand operand(this, pc_);
if (Validate(pc_, operand)) {
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698