5#ifndef V8_COMPILER_WASM_COMPILER_H_
6#define V8_COMPILER_WASM_COMPILER_H_
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
36struct AssemblerOptions;
38class TurbofanCompilationJob;
48class SourcePositionTable;
49struct WasmCompilationData;
51class WasmGraphAssembler;
53struct Int64LoweringSpecialCase;
54template <
size_t VarCount>
62class WireBytesStorage;
77 const wasm::CanonicalSig*);
82 const wasm::CanonicalSig*, DirectHandle<JSReceiver> callable);
86 Isolate* isolate,
const wasm::CanonicalSig*
sig);
165 void Start(
unsigned params);
166 Node*
Param(
int index,
const char* debug_name =
nullptr);
175 template <
typename... Nodes>
177 Node* arr[] = {fst, more...};
188 return effect_and_control;
222 template <
typename T>
225 Node* implicit_first_arg,
bool indirect,
226 Node* frame_state =
nullptr);
248 std::unique_ptr<WasmGraphAssembler>
gasm_;
283 bool set_in_wasm_flag);
#define Assert(condition)
Node * Return(Node *fst, Nodes *... more)
Node * BuildSafeStore(int offset, wasm::ValueTypeBase type, Node *arg_buffer, Node *value, Node *effect, Node *control)
V8_EXPORT_PRIVATE void LowerInt64(Signature< MachineRepresentation > *sig)
SetOncePointer< const Operator > stack_check_call_operator_
Node * Return(base::Vector< Node * > nodes)
static constexpr int kNoCachedMemoryIndex
compiler::WasmDecorator * decorator_
Node * SetType(Node *node, wasm::ValueType type)
Node * SetEffect(Node *node)
void BuildModifyThreadInWasmFlagHelper(Node *thread_in_wasm_flag_address, bool new_value)
bool TryWasmInlining(int fct_index, wasm::NativeModule *native_module, int inlining_id)
std::unique_ptr< WasmGraphAssembler > gasm_
@ kNoSpecialParameterMode
Node * Int32Constant(int32_t value)
const ParameterMode parameter_mode_
Node * BuildCallToRuntime(Runtime::FunctionId f, Node **parameters, int parameter_count)
SetOncePointer< Node > instance_data_node_
V8_EXPORT_PRIVATE ~WasmGraphBuilder()
const wasm::CanonicalSig *const wrapper_sig_
Node * SetControl(Node *node)
Node * TypeGuard(Node *value, wasm::ValueType type)
wasm::CompilationEnv *const env_
wasm::WasmEnabledFeatures enabled_features_
Node * BuildWasmCall(const Signature< T > *sig, base::Vector< Node * > args, base::Vector< Node * > rets, wasm::WasmCodePosition position, Node *implicit_first_arg, bool indirect, Node *frame_state=nullptr)
Node * NoContextConstant()
void SetSourcePosition(Node *node, wasm::WasmCodePosition position)
MachineGraph *const mcgraph_
Node * Param(int index, const char *debug_name=nullptr)
Node * IsNull(Node *object, wasm::ValueType type)
Node * BuildCallNode(size_t param_count, base::Vector< Node * > args, wasm::WasmCodePosition position, Node *instance_node, const Operator *op, Node *frame_state=nullptr)
const Operator * GetSafeLoadOperator(int offset, wasm::ValueTypeBase type)
void SetEffectControl(Node *effect, Node *control)
void TerminateThrow(Node *effect, Node *control)
Node * BuildLoadIsolateRoot()
V8_EXPORT_PRIVATE WasmGraphBuilder(wasm::CompilationEnv *env, Zone *zone, MachineGraph *mcgraph, const wasm::FunctionSig *sig, compiler::SourcePositionTable *spt, ParameterMode parameter_mode, Isolate *isolate, wasm::WasmEnabledFeatures enabled_features, const wasm::CanonicalSig *wrapper_sig=nullptr)
const wasm::FunctionSig *const function_sig_
Node * BuildChangeInt64ToBigInt(Node *input, StubCallMode stub_mode)
TrapId GetTrapIdForTrap(wasm::TrapReason reason)
Node * SetEffectControl(Node *effect_and_control)
compiler::SourcePositionTable *const source_position_table_
void Start(unsigned params)
SetOncePointer< Node > stack_check_code_node_
Node * BuildCallToRuntimeWithContext(Runtime::FunctionId f, Node *js_context, Node **parameters, int parameter_count)
NullCheckStrategy null_check_strategy_
void BuildModifyThreadInWasmFlag(bool new_value)
base::Vector< const DirectHandle< Object > > args
SourcePositionTable * source_positions
constexpr Vector< T > ArrayVector(T(&arr)[N])
AssemblerOptions WasmAssemblerOptions()
AssemblerOptions WasmStubAssemblerOptions()
Signature< MachineRepresentation > * CreateMachineSignature(Zone *zone, const Signature< T > *sig, wasm::CallOrigin origin)
bool IsFastCallSupportedSignature(const v8::CFunctionInfo *sig)
wasm::WasmCompilationResult CompileWasmCapiCallWrapper(const wasm::CanonicalSig *sig)
std::unique_ptr< OptimizedCompilationJob > NewJSToWasmCompilationJob(Isolate *isolate, const wasm::CanonicalSig *sig)
wasm::WasmCompilationResult CompileWasmImportCallWrapper(wasm::ImportCallKind kind, const wasm::CanonicalSig *sig, bool source_positions, int expected_arity, wasm::Suspend suspend)
void BuildInlinedJSToWasmWrapper(Zone *zone, MachineGraph *mcgraph, const wasm::CanonicalSig *signature, Isolate *isolate, compiler::SourcePositionTable *spt, Node *frame_state, bool set_in_wasm_flag)
wasm::WasmCompilationResult CompileWasmJSFastCallWrapper(const wasm::CanonicalSig *sig, DirectHandle< JSReceiver > callable)
Handle< Code > CompileCWasmEntry(Isolate *isolate, const wasm::CanonicalSig *sig)
kWasmInternalFunctionIndirectPointerTag kProtectedInstanceDataOffset sig
#define V8_EXPORT_PRIVATE
const wasm::WireBytesStorage * wire_bytes_storage
WasmCompilationData(const wasm::FunctionBody &func_body)
const wasm::FunctionBody & func_body
SourcePositionTable * source_positions
NodeOriginTable * node_origins
std::unique_ptr< wasm::AssumptionsJournal > assumptions
std::vector< WasmLoopInfo > * loop_infos
WasmLoopInfo(Node *header, uint32_t nesting_depth, bool can_be_innermost)