1 // Copyright 2018 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #if !V8_ENABLE_WEBASSEMBLY 6 #error This header should only be included if WebAssembly is enabled. 7 #endif // !V8_ENABLE_WEBASSEMBLY 8 9 #ifndef V8_WASM_GRAPH_BUILDER_INTERFACE_H_ 10 #define V8_WASM_GRAPH_BUILDER_INTERFACE_H_ 11 12 #include "src/wasm/decoder.h" 13 #include "src/wasm/wasm-result.h" 14 15 namespace v8 { 16 namespace internal { 17 18 namespace compiler { // external declarations from compiler. 19 class NodeOriginTable; 20 class WasmGraphBuilder; 21 struct WasmLoopInfo; 22 } // namespace compiler 23 24 namespace wasm { 25 26 struct FunctionBody; 27 class WasmFeatures; 28 struct WasmModule; 29 30 enum InlinedStatus { 31 // Inlined function whose call node has IfSuccess/IfException outputs. 32 kInlinedHandledCall, 33 // Inlined function whose call node does not have IfSuccess/IfException 34 // outputs. 35 kInlinedNonHandledCall, 36 // Not an inlined call. 37 kRegularFunction 38 }; 39 40 V8_EXPORT_PRIVATE DecodeResult 41 BuildTFGraph(AccountingAllocator* allocator, const WasmFeatures& enabled, 42 const WasmModule* module, compiler::WasmGraphBuilder* builder, 43 WasmFeatures* detected, const FunctionBody& body, 44 std::vector<compiler::WasmLoopInfo>* loop_infos, 45 compiler::NodeOriginTable* node_origins, int func_index, 46 InlinedStatus inlined_status); 47 48 } // namespace wasm 49 } // namespace internal 50 } // namespace v8 51 52 #endif // V8_WASM_GRAPH_BUILDER_INTERFACE_H_ 53