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

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

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.h
diff --git a/src/wasm/ast-decoder.h b/src/wasm/ast-decoder.h
index feafa2618fa52990afea9178a54a6a780ac3d877..4ac6793a85c637969444dfaadf67cd80776c5890 100644
--- a/src/wasm/ast-decoder.h
+++ b/src/wasm/ast-decoder.h
@@ -186,12 +186,18 @@ struct BreakDepthOperand {
};
struct CallIndirectOperand {
+ uint32_t table_index;
uint32_t index;
FunctionSig* sig;
unsigned length;
inline CallIndirectOperand(Decoder* decoder, const byte* pc) {
- unsigned len1 = 0;
+ unsigned len1 = 1;
unsigned len2 = 0;
+ table_index = decoder->checked_read_u8(pc, 1, "table index");
+ if (table_index != 0) {
+ decoder->error(pc, pc + 1, "expected table index 0, found %u",
+ table_index);
+ }
index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "signature index");
length = len1 + len2;
sig = nullptr;
@@ -211,6 +217,18 @@ struct CallFunctionOperand {
}
};
+struct MemoryIndexOperand {
+ uint32_t index;
+ unsigned length;
+ inline MemoryIndexOperand(Decoder* decoder, const byte* pc) {
+ index = decoder->checked_read_u8(pc, 1, "memory index");
+ if (index != 0) {
+ decoder->error(pc, pc + 1, "expected memory index 0, found %u", index);
+ }
+ length = 1;
+ }
+};
+
struct BranchTableOperand {
uint32_t table_count;
const byte* start;
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | src/wasm/ast-decoder.cc » ('j') | src/wasm/wasm-opcodes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698