#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif
#ifndef V8_COMPILER_WASM_COMPILER_H_
#define V8_COMPILER_WASM_COMPILER_H_
#include <memory>
#include <utility>
#include "src/base/small-vector.h"
#include "src/codegen/compiler.h"
#include "src/compiler/wasm-compiler-definitions.h"
#include "src/runtime/runtime.h"
#include "src/wasm/function-body-decoder.h"
#include "src/wasm/function-compiler.h"
#include "src/wasm/module-instantiate.h"
#include "src/wasm/wasm-features.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-opcodes.h"
#include "src/wasm/wasm-result.h"
#include "src/zone/zone.h"
namespace v8 {
class CFunctionInfo;
namespace internal {
enum class AbortReason : uint8_t;
struct AssemblerOptions;
enum class BranchHint : uint8_t;
class TurbofanCompilationJob;
namespace compiler {
class CallDescriptor;
class Graph;
class MachineGraph;
class Node;
class NodeOriginTable;
class Operator;
class SourcePositionTable;
struct WasmCompilationData;
class WasmDecorator;
class WasmGraphAssembler;
enum class TrapId : int32_t;
struct Int64LoweringSpecialCase;
template <size_t VarCount>
class GraphAssemblerLabel;
struct WasmTypeCheckConfig;
}
namespace wasm {
struct DecodeStruct;
class WasmCode;
class WireBytesStorage;
enum class LoadTransformationKind : uint8_t;
enum Suspend : int;
enum CallOrigin { … };
}
namespace compiler {
wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
wasm::CompilationEnv*, WasmCompilationData& compilation_data, Counters*,
wasm::WasmDetectedFeatures* detected);
V8_EXPORT_PRIVATE wasm::WasmCompilationResult CompileWasmImportCallWrapper(
wasm::CompilationEnv* env, wasm::ImportCallKind, const wasm::FunctionSig*,
bool source_positions, int expected_arity, wasm::Suspend);
wasm::WasmCompilationResult CompileWasmCapiCallWrapper(
wasm::NativeModule*, const wasm::FunctionSig*);
bool IsFastCallSupportedSignature(const v8::CFunctionInfo*);
wasm::WasmCompilationResult CompileWasmJSFastCallWrapper(
wasm::NativeModule*, const wasm::FunctionSig*, Handle<JSReceiver> callable);
std::unique_ptr<OptimizedCompilationJob> NewJSToWasmCompilationJob(
Isolate* isolate, const wasm::FunctionSig* sig,
const wasm::WasmModule* module, wasm::WasmEnabledFeatures enabled_features);
MaybeHandle<Code> CompileWasmToJSWrapper(Isolate* isolate,
const wasm::WasmModule* module,
const wasm::FunctionSig* sig,
wasm::ImportCallKind kind,
int expected_arity,
wasm::Suspend suspend);
enum CWasmEntryParameters { … };
V8_EXPORT_PRIVATE Handle<Code> CompileCWasmEntry(
Isolate*, const wasm::FunctionSig*, const wasm::WasmModule* module);
struct WasmInstanceCacheNodes { … };
inline constexpr WasmInstanceCacheNodes::FieldPtr
WasmInstanceCacheNodes::kFields[] = …;
struct WasmLoopInfo { … };
struct WasmCompilationData { … };
class WasmGraphBuilder { … };
V8_EXPORT_PRIVATE void BuildInlinedJSToWasmWrapper(
Zone* zone, MachineGraph* mcgraph, const wasm::FunctionSig* signature,
const wasm::WasmModule* module, Isolate* isolate,
compiler::SourcePositionTable* spt, wasm::WasmEnabledFeatures features,
Node* frame_state, bool set_in_wasm_flag);
AssemblerOptions WasmAssemblerOptions();
AssemblerOptions WasmStubAssemblerOptions();
Signature<MachineRepresentation>* CreateMachineSignature(
Zone* zone, const wasm::FunctionSig* sig, wasm::CallOrigin origin);
}
}
}
#endif