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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 inline CallImportOperand(Decoder* decoder, const byte* pc) { | 141 inline CallImportOperand(Decoder* decoder, const byte* pc) { |
142 unsigned len1 = 0; | 142 unsigned len1 = 0; |
143 unsigned len2 = 0; | 143 unsigned len2 = 0; |
144 arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count"); | 144 arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count"); |
145 index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "import index"); | 145 index = decoder->checked_read_u32v(pc, 1 + len1, &len2, "import index"); |
146 length = len1 + len2; | 146 length = len1 + len2; |
147 sig = nullptr; | 147 sig = nullptr; |
148 } | 148 } |
149 }; | 149 }; |
150 | 150 |
151 struct JITSingleFunctionOperand { | |
152 uint32_t sig_index; | |
153 FunctionSig* sig; | |
154 unsigned length; | |
155 inline JITSingleFunctionOperand(Decoder* decoder, const byte* pc) { | |
156 sig_index = decoder->checked_read_u32v(pc, 1, &length, "signature index"); | |
157 sig = nullptr; | |
158 } | |
159 }; | |
160 | |
161 struct BranchTableOperand { | 151 struct BranchTableOperand { |
162 uint32_t arity; | 152 uint32_t arity; |
163 uint32_t table_count; | 153 uint32_t table_count; |
164 const byte* table; | 154 const byte* table; |
165 unsigned length; | 155 unsigned length; |
166 inline BranchTableOperand(Decoder* decoder, const byte* pc) { | 156 inline BranchTableOperand(Decoder* decoder, const byte* pc) { |
167 unsigned len1 = 0; | 157 unsigned len1 = 0; |
168 unsigned len2 = 0; | 158 unsigned len2 = 0; |
169 arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count"); | 159 arity = decoder->checked_read_u32v(pc, 1, &len1, "argument count"); |
170 table_count = | 160 table_count = |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 330 } |
341 | 331 |
342 bool has_next() { return pc_ < end_; } | 332 bool has_next() { return pc_ < end_; } |
343 }; | 333 }; |
344 | 334 |
345 } // namespace wasm | 335 } // namespace wasm |
346 } // namespace internal | 336 } // namespace internal |
347 } // namespace v8 | 337 } // namespace v8 |
348 | 338 |
349 #endif // V8_WASM_AST_DECODER_H_ | 339 #endif // V8_WASM_AST_DECODER_H_ |
OLD | NEW |