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

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

Issue 2440953002: [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. (Closed)
Patch Set: Update after moving copysign 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
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index 4e19d0f6b6a1894851890ffb5bedbac1790f9c99..d867cc843eef15ff6797c01d7e4f0383f274d261 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:
@@ -1101,17 +1106,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/wasm-interpreter.cc » ('j') | src/wasm/wasm-opcodes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698