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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 | 209 |
210 inline TreeResult BuildTFGraph(base::AccountingAllocator* allocator, | 210 inline TreeResult BuildTFGraph(base::AccountingAllocator* allocator, |
211 TFBuilder* builder, ModuleEnv* module, | 211 TFBuilder* builder, ModuleEnv* module, |
212 FunctionSig* sig, const byte* start, | 212 FunctionSig* sig, const byte* start, |
213 const byte* end) { | 213 const byte* end) { |
214 FunctionBody body = {module, sig, nullptr, start, end}; | 214 FunctionBody body = {module, sig, nullptr, start, end}; |
215 return BuildTFGraph(allocator, builder, body); | 215 return BuildTFGraph(allocator, builder, body); |
216 } | 216 } |
217 | 217 |
218 enum ReadUnsignedLEB128ErrorCode { kNoError, kInvalidLEB128, kMissingLEB128 }; | |
219 | |
220 ReadUnsignedLEB128ErrorCode ReadUnsignedLEB128Operand(const byte*, const byte*, | |
221 int*, uint32_t*); | |
222 | |
223 struct AstLocalDecls { | 218 struct AstLocalDecls { |
224 // The size of the encoded declarations. | 219 // The size of the encoded declarations. |
225 uint32_t decls_encoded_size; // size of encoded declarations | 220 uint32_t decls_encoded_size; // size of encoded declarations |
226 | 221 |
227 // Total number of locals. | 222 // Total number of locals. |
228 uint32_t total_local_count; | 223 uint32_t total_local_count; |
229 | 224 |
230 // List of {local type, count} pairs. | 225 // List of {local type, count} pairs. |
231 ZoneVector<std::pair<LocalType, uint32_t>> local_types; | 226 ZoneVector<std::pair<LocalType, uint32_t>> local_types; |
232 | 227 |
(...skipping 10 matching lines...) Expand all Loading... |
243 int OpcodeLength(const byte* pc, const byte* end); | 238 int OpcodeLength(const byte* pc, const byte* end); |
244 | 239 |
245 // Computes the arity (number of sub-nodes) of the opcode at the given address. | 240 // Computes the arity (number of sub-nodes) of the opcode at the given address. |
246 int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc, | 241 int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc, |
247 const byte* end); | 242 const byte* end); |
248 } // namespace wasm | 243 } // namespace wasm |
249 } // namespace internal | 244 } // namespace internal |
250 } // namespace v8 | 245 } // namespace v8 |
251 | 246 |
252 #endif // V8_WASM_AST_DECODER_H_ | 247 #endif // V8_WASM_AST_DECODER_H_ |
OLD | NEW |