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

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

Issue 1775123003: [wasm] Encode immediates to Load and Store as varint. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/wasm/asm-wasm-builder.cc ('k') | src/wasm/encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.h
diff --git a/src/wasm/ast-decoder.h b/src/wasm/ast-decoder.h
index 5c0e0f3b83a8d0babe9cf2b356bd387a5e7e625b..c2e93311a494c4c42e449375a4538b204dfacde7 100644
--- a/src/wasm/ast-decoder.h
+++ b/src/wasm/ast-decoder.h
@@ -165,19 +165,17 @@ struct BranchTableOperand {
};
struct MemoryAccessOperand {
- bool aligned;
+ uint32_t alignment;
uint32_t offset;
int length;
inline MemoryAccessOperand(Decoder* decoder, const byte* pc) {
- byte bitfield = decoder->checked_read_u8(pc, 1, "memory access byte");
- aligned = MemoryAccess::AlignmentField::decode(bitfield);
- if (MemoryAccess::OffsetField::decode(bitfield)) {
- offset = decoder->checked_read_u32v(pc, 2, &length, "memory offset");
- length++;
- } else {
- offset = 0;
- length = 1;
- }
+ int alignment_length;
+ alignment =
+ decoder->checked_read_u32v(pc, 1, &alignment_length, "alignment");
+ int offset_length;
+ offset = decoder->checked_read_u32v(pc, 1 + alignment_length,
+ &offset_length, "offset");
+ length = alignment_length + offset_length;
}
};
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | src/wasm/encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698