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_FUNCTION_BODY_DECODER_H_ | 5 #ifndef V8_WASM_FUNCTION_BODY_DECODER_H_ |
6 #define V8_WASM_FUNCTION_BODY_DECODER_H_ | 6 #define V8_WASM_FUNCTION_BODY_DECODER_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 typedef Result<DecodeStruct*> DecodeResult; | 333 typedef Result<DecodeStruct*> DecodeResult; |
334 inline std::ostream& operator<<(std::ostream& os, const DecodeStruct& tree) { | 334 inline std::ostream& operator<<(std::ostream& os, const DecodeStruct& tree) { |
335 return os; | 335 return os; |
336 } | 336 } |
337 | 337 |
338 V8_EXPORT_PRIVATE DecodeResult VerifyWasmCode(AccountingAllocator* allocator, | 338 V8_EXPORT_PRIVATE DecodeResult VerifyWasmCode(AccountingAllocator* allocator, |
339 const wasm::WasmModule* module, | 339 const wasm::WasmModule* module, |
340 FunctionBody& body); | 340 FunctionBody& body); |
341 DecodeResult BuildTFGraph(AccountingAllocator* allocator, TFBuilder* builder, | 341 DecodeResult BuildTFGraph(AccountingAllocator* allocator, TFBuilder* builder, |
342 FunctionBody& body); | 342 FunctionBody& body); |
343 bool PrintWasmCode(AccountingAllocator* allocator, const FunctionBody& body, | 343 bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body, |
344 const wasm::WasmModule* module, std::ostream& os, | 344 const wasm::WasmModule* module); |
345 std::vector<std::tuple<uint32_t, int, int>>* offset_table); | |
346 | 345 |
347 // A simplified form of AST printing, e.g. from a debugger. | 346 // A simplified form of AST printing, e.g. from a debugger. |
348 void PrintWasmCodeForDebugging(const byte* start, const byte* end); | 347 void PrintRawWasmCode(const byte* start, const byte* end); |
349 | 348 |
350 inline DecodeResult VerifyWasmCode(AccountingAllocator* allocator, | 349 inline DecodeResult VerifyWasmCode(AccountingAllocator* allocator, |
351 const WasmModule* module, FunctionSig* sig, | 350 const WasmModule* module, FunctionSig* sig, |
352 const byte* start, const byte* end) { | 351 const byte* start, const byte* end) { |
353 FunctionBody body = {sig, nullptr, start, end}; | 352 FunctionBody body = {sig, nullptr, start, end}; |
354 return VerifyWasmCode(allocator, module, body); | 353 return VerifyWasmCode(allocator, module, body); |
355 } | 354 } |
356 | 355 |
357 inline DecodeResult BuildTFGraph(AccountingAllocator* allocator, | 356 inline DecodeResult BuildTFGraph(AccountingAllocator* allocator, |
358 TFBuilder* builder, FunctionSig* sig, | 357 TFBuilder* builder, FunctionSig* sig, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 } | 467 } |
469 | 468 |
470 bool has_next() { return pc_ < end_; } | 469 bool has_next() { return pc_ < end_; } |
471 }; | 470 }; |
472 | 471 |
473 } // namespace wasm | 472 } // namespace wasm |
474 } // namespace internal | 473 } // namespace internal |
475 } // namespace v8 | 474 } // namespace v8 |
476 | 475 |
477 #endif // V8_WASM_FUNCTION_BODY_DECODER_H_ | 476 #endif // V8_WASM_FUNCTION_BODY_DECODER_H_ |
OLD | NEW |