| 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/wasm-opcodes.h" | 9 #include "src/wasm/wasm-opcodes.h" |
| 10 #include "src/wasm/wasm-result.h" | 10 #include "src/wasm/wasm-result.h" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 class BitVector; // forward declaration |
| 16 |
| 15 namespace compiler { // external declarations from compiler. | 17 namespace compiler { // external declarations from compiler. |
| 16 class WasmGraphBuilder; | 18 class WasmGraphBuilder; |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace wasm { | 21 namespace wasm { |
| 20 | 22 |
| 21 typedef compiler::WasmGraphBuilder TFBuilder; | 23 typedef compiler::WasmGraphBuilder TFBuilder; |
| 22 struct ModuleEnv; // forward declaration of module interface. | 24 struct ModuleEnv; // forward declaration of module interface. |
| 23 | 25 |
| 24 // Interface the function environment during decoding, include the signature | 26 // Interface the function environment during decoding, include the signature |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 inline TreeResult BuildTFGraph(TFBuilder* builder, FunctionEnv* env, | 101 inline TreeResult BuildTFGraph(TFBuilder* builder, FunctionEnv* env, |
| 100 const byte* start, const byte* end) { | 102 const byte* start, const byte* end) { |
| 101 return BuildTFGraph(builder, env, nullptr, start, end); | 103 return BuildTFGraph(builder, env, nullptr, start, end); |
| 102 } | 104 } |
| 103 | 105 |
| 104 enum ReadUnsignedLEB128ErrorCode { kNoError, kInvalidLEB128, kMissingLEB128 }; | 106 enum ReadUnsignedLEB128ErrorCode { kNoError, kInvalidLEB128, kMissingLEB128 }; |
| 105 | 107 |
| 106 ReadUnsignedLEB128ErrorCode ReadUnsignedLEB128Operand(const byte*, const byte*, | 108 ReadUnsignedLEB128ErrorCode ReadUnsignedLEB128Operand(const byte*, const byte*, |
| 107 int*, uint32_t*); | 109 int*, uint32_t*); |
| 108 | 110 |
| 111 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, FunctionEnv* env, |
| 112 const byte* start, const byte* end); |
| 113 |
| 109 // Computes the length of the opcode at the given address. | 114 // Computes the length of the opcode at the given address. |
| 110 int OpcodeLength(const byte* pc); | 115 int OpcodeLength(const byte* pc); |
| 111 | 116 |
| 112 // Computes the arity (number of sub-nodes) of the opcode at the given address. | 117 // Computes the arity (number of sub-nodes) of the opcode at the given address. |
| 113 int OpcodeArity(FunctionEnv* env, const byte* pc); | 118 int OpcodeArity(FunctionEnv* env, const byte* pc); |
| 114 } // namespace wasm | 119 } // namespace wasm |
| 115 } // namespace internal | 120 } // namespace internal |
| 116 } // namespace v8 | 121 } // namespace v8 |
| 117 | 122 |
| 118 #endif // V8_WASM_AST_DECODER_H_ | 123 #endif // V8_WASM_AST_DECODER_H_ |
| OLD | NEW |