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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 depth = decoder->checked_read_u8(pc, 1, "break depth"); | 100 depth = decoder->checked_read_u8(pc, 1, "break depth"); |
101 length = 1; | 101 length = 1; |
102 target = nullptr; | 102 target = nullptr; |
103 } | 103 } |
104 }; | 104 }; |
105 | 105 |
106 struct BlockCountOperand { | 106 struct BlockCountOperand { |
107 uint32_t count; | 107 uint32_t count; |
108 int length; | 108 int length; |
109 inline BlockCountOperand(Decoder* decoder, const byte* pc) { | 109 inline BlockCountOperand(Decoder* decoder, const byte* pc) { |
| 110 count = decoder->checked_read_u32(pc, 1, "block count"); |
| 111 length = 4; |
| 112 } |
| 113 }; |
| 114 |
| 115 struct LoopCountOperand { |
| 116 uint32_t count; |
| 117 int length; |
| 118 inline LoopCountOperand(Decoder* decoder, const byte* pc) { |
110 count = decoder->checked_read_u8(pc, 1, "block count"); | 119 count = decoder->checked_read_u8(pc, 1, "block count"); |
111 length = 1; | 120 length = 1; |
112 } | 121 } |
113 }; | 122 }; |
114 | 123 |
115 struct SignatureIndexOperand { | 124 struct SignatureIndexOperand { |
116 uint32_t index; | 125 uint32_t index; |
117 FunctionSig* sig; | 126 FunctionSig* sig; |
118 int length; | 127 int length; |
119 inline SignatureIndexOperand(Decoder* decoder, const byte* pc) { | 128 inline SignatureIndexOperand(Decoder* decoder, const byte* pc) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // Computes the length of the opcode at the given address. | 273 // Computes the length of the opcode at the given address. |
265 int OpcodeLength(const byte* pc, const byte* end); | 274 int OpcodeLength(const byte* pc, const byte* end); |
266 | 275 |
267 // Computes the arity (number of sub-nodes) of the opcode at the given address. | 276 // Computes the arity (number of sub-nodes) of the opcode at the given address. |
268 int OpcodeArity(FunctionEnv* env, const byte* pc, const byte* end); | 277 int OpcodeArity(FunctionEnv* env, const byte* pc, const byte* end); |
269 } // namespace wasm | 278 } // namespace wasm |
270 } // namespace internal | 279 } // namespace internal |
271 } // namespace v8 | 280 } // namespace v8 |
272 | 281 |
273 #endif // V8_WASM_AST_DECODER_H_ | 282 #endif // V8_WASM_AST_DECODER_H_ |
OLD | NEW |