graph-builder-interface.h 1.53 KB
Newer Older
1 2 3 4
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6 7 8
#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif  // !V8_ENABLE_WEBASSEMBLY

9 10 11 12 13 14 15 16 17
#ifndef V8_WASM_GRAPH_BUILDER_INTERFACE_H_
#define V8_WASM_GRAPH_BUILDER_INTERFACE_H_

#include "src/wasm/decoder.h"
#include "src/wasm/wasm-result.h"

namespace v8 {
namespace internal {

18 19
class AccountingAllocator;

20 21 22
namespace compiler {  // external declarations from compiler.
class NodeOriginTable;
class WasmGraphBuilder;
23
struct WasmLoopInfo;
24 25 26 27 28
}  // namespace compiler

namespace wasm {

struct FunctionBody;
29
class WasmFeatures;
30 31
struct WasmModule;

32 33 34 35 36 37 38 39 40
enum InlinedStatus {
  // Inlined function whose call node has IfSuccess/IfException outputs.
  kInlinedHandledCall,
  // Inlined function whose call node does not have IfSuccess/IfException
  // outputs.
  kInlinedNonHandledCall,
  // Not an inlined call.
  kRegularFunction
};
41

42 43 44 45
V8_EXPORT_PRIVATE DecodeResult
BuildTFGraph(AccountingAllocator* allocator, const WasmFeatures& enabled,
             const WasmModule* module, compiler::WasmGraphBuilder* builder,
             WasmFeatures* detected, const FunctionBody& body,
46
             std::vector<compiler::WasmLoopInfo>* loop_infos,
47
             compiler::NodeOriginTable* node_origins, int func_index,
48
             InlinedStatus inlined_status);
49 50 51 52 53 54

}  // namespace wasm
}  // namespace internal
}  // namespace v8

#endif  // V8_WASM_GRAPH_BUILDER_INTERFACE_H_