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