OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_WASM_AST_DECODER_H_ | 5 #ifndef V8_WASM_AST_DECODER_H_ |
6 #define V8_WASM_AST_DECODER_H_ | 6 #define V8_WASM_AST_DECODER_H_ |
7 | 7 |
8 #include "src/signature.h" | 8 #include "src/signature.h" |
9 #include "src/wasm/decoder.h" | 9 #include "src/wasm/decoder.h" |
10 #include "src/wasm/wasm-opcodes.h" | 10 #include "src/wasm/wasm-opcodes.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 length = varint_length + (table_count + 1) * sizeof(uint32_t); | 151 length = varint_length + (table_count + 1) * sizeof(uint32_t); |
152 | 152 |
153 uint32_t table_start = 1 + varint_length; | 153 uint32_t table_start = 1 + varint_length; |
154 if (decoder->check(pc, table_start, (table_count + 1) * sizeof(uint32_t), | 154 if (decoder->check(pc, table_start, (table_count + 1) * sizeof(uint32_t), |
155 "expected <table entries>")) { | 155 "expected <table entries>")) { |
156 table = pc + table_start; | 156 table = pc + table_start; |
157 } else { | 157 } else { |
158 table = nullptr; | 158 table = nullptr; |
159 } | 159 } |
160 } | 160 } |
161 inline uint32_t read_entry(Decoder* decoder, int i) { | 161 inline uint16_t read_entry(Decoder* decoder, int i) { |
titzer
2016/03/09 08:18:17
does this need a rebase?
binji
2016/03/09 18:34:17
Done.
| |
162 DCHECK(i >= 0 && static_cast<uint32_t>(i) <= table_count); | 162 DCHECK(i >= 0 && static_cast<uint32_t>(i) <= table_count); |
163 return table ? decoder->read_u32(table + i * sizeof(uint32_t)) : 0; | 163 return table ? decoder->read_u32(table + i * sizeof(uint32_t)) : 0; |
164 } | 164 } |
165 }; | 165 }; |
166 | 166 |
167 struct MemoryAccessOperand { | 167 struct MemoryAccessOperand { |
168 bool aligned; | 168 bool aligned; |
169 uint32_t offset; | 169 uint32_t offset; |
170 int length; | 170 int length; |
171 inline MemoryAccessOperand(Decoder* decoder, const byte* pc) { | 171 inline MemoryAccessOperand(Decoder* decoder, const byte* pc) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 int OpcodeLength(const byte* pc, const byte* end); | 229 int OpcodeLength(const byte* pc, const byte* end); |
230 | 230 |
231 // Computes the arity (number of sub-nodes) of the opcode at the given address. | 231 // Computes the arity (number of sub-nodes) of the opcode at the given address. |
232 int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc, | 232 int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc, |
233 const byte* end); | 233 const byte* end); |
234 } // namespace wasm | 234 } // namespace wasm |
235 } // namespace internal | 235 } // namespace internal |
236 } // namespace v8 | 236 } // namespace v8 |
237 | 237 |
238 #endif // V8_WASM_AST_DECODER_H_ | 238 #endif // V8_WASM_AST_DECODER_H_ |
OLD | NEW |