11cb0ef41Sopenharmony_ci// Copyright 2018 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#if !V8_ENABLE_WEBASSEMBLY
61cb0ef41Sopenharmony_ci#error This header should only be included if WebAssembly is enabled.
71cb0ef41Sopenharmony_ci#endif  // !V8_ENABLE_WEBASSEMBLY
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci#ifndef V8_WASM_GRAPH_BUILDER_INTERFACE_H_
101cb0ef41Sopenharmony_ci#define V8_WASM_GRAPH_BUILDER_INTERFACE_H_
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci#include "src/wasm/decoder.h"
131cb0ef41Sopenharmony_ci#include "src/wasm/wasm-result.h"
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cinamespace v8 {
161cb0ef41Sopenharmony_cinamespace internal {
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_cinamespace compiler {  // external declarations from compiler.
191cb0ef41Sopenharmony_ciclass NodeOriginTable;
201cb0ef41Sopenharmony_ciclass WasmGraphBuilder;
211cb0ef41Sopenharmony_cistruct WasmLoopInfo;
221cb0ef41Sopenharmony_ci}  // namespace compiler
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_cinamespace wasm {
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_cistruct FunctionBody;
271cb0ef41Sopenharmony_ciclass WasmFeatures;
281cb0ef41Sopenharmony_cistruct WasmModule;
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_cienum InlinedStatus {
311cb0ef41Sopenharmony_ci  // Inlined function whose call node has IfSuccess/IfException outputs.
321cb0ef41Sopenharmony_ci  kInlinedHandledCall,
331cb0ef41Sopenharmony_ci  // Inlined function whose call node does not have IfSuccess/IfException
341cb0ef41Sopenharmony_ci  // outputs.
351cb0ef41Sopenharmony_ci  kInlinedNonHandledCall,
361cb0ef41Sopenharmony_ci  // Not an inlined call.
371cb0ef41Sopenharmony_ci  kRegularFunction
381cb0ef41Sopenharmony_ci};
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_ciV8_EXPORT_PRIVATE DecodeResult
411cb0ef41Sopenharmony_ciBuildTFGraph(AccountingAllocator* allocator, const WasmFeatures& enabled,
421cb0ef41Sopenharmony_ci             const WasmModule* module, compiler::WasmGraphBuilder* builder,
431cb0ef41Sopenharmony_ci             WasmFeatures* detected, const FunctionBody& body,
441cb0ef41Sopenharmony_ci             std::vector<compiler::WasmLoopInfo>* loop_infos,
451cb0ef41Sopenharmony_ci             compiler::NodeOriginTable* node_origins, int func_index,
461cb0ef41Sopenharmony_ci             InlinedStatus inlined_status);
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ci}  // namespace wasm
491cb0ef41Sopenharmony_ci}  // namespace internal
501cb0ef41Sopenharmony_ci}  // namespace v8
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ci#endif  // V8_WASM_GRAPH_BUILDER_INTERFACE_H_
53