15using namespace compiler::turboshaft;
17#define IGNITION_HANDLER_TS(Name, BaseAssembler) \
18 class Name##AssemblerTS : public BaseAssembler { \
20 using Base = BaseAssembler; \
21 Name##AssemblerTS(compiler::turboshaft::PipelineData* data, \
22 Isolate* isolate, compiler::turboshaft::Graph& graph, \
24 : Base(data, graph, phase_zone) {} \
25 Name##AssemblerTS(const Name##AssemblerTS&) = delete; \
26 Name##AssemblerTS& operator=(const Name##AssemblerTS&) = delete; \
27 void Generate##Name##Impl(); \
29 void Name##AssemblerTS_Generate( \
30 compiler::turboshaft::PipelineData* data, Isolate* isolate, \
31 compiler::turboshaft::Graph& graph, Zone* zone) { \
32 Name##AssemblerTS assembler(data, isolate, graph, zone); \
33 assembler.EmitBytecodeHandlerProlog(); \
34 compiler::turboshaft::Block* catch_block = assembler.NewBlock(); \
35 Name##AssemblerTS::CatchScope catch_scope(assembler, catch_block); \
36 assembler.Generate##Name##Impl(); \
37 assembler.EmitEpilog(catch_block); \
39 void Name##AssemblerTS::Generate##Name##Impl()
41template <
typename Next>
81 __ CodeComment(
"========= Dispatch");
98#ifdef V8_IGNITION_DISPATCH_COUNTING
99 TraceBytecodeDispatch(target_bytecode);
120 template <
typename... Args>
126 auto ts_call_descriptor =
130 std::initializer_list<const OpIndex> arguments{
args...};
178 int additional_offset = 0) {
188 return __ ChangeUint32ToUintPtr(bytecode);
195#if V8_TARGET_LITTLE_ENDIAN
198 return __ ChangeInt32ToIntPtr(
201 return __ ChangeInt32ToIntPtr(
__ UntagSmi(
211 ExternalReference::interpreter_dispatch_table_address(
isolate_));
244 switch (operand_size) {
285 template <
typename T>
294template <
template <
typename>
typename Reducer>
297 Reducer, BytecodeHandlerReducer, BuiltinsReducer,
298 FeedbackCollectorReducer,
299 compiler::turboshaft::MachineLoweringReducer,
300 compiler::turboshaft::VariableReducer> {
318 InterpreterDispatchDescriptor::kAccumulator);
320 InterpreterDispatchDescriptor::kBytecodeOffset);
322 InterpreterDispatchDescriptor::kBytecodeArray);
324 InterpreterDispatchDescriptor::kDispatchTable);
325 __ InitializeParameters(acc, bytecode_array, bytecode_offset,
337 constexpr int kSlotIndex = 0;
339 __ ChangeUint32ToUintPtr(
__ BytecodeOperandIdxInt32(kSlotIndex)));
340 LoadFeedbackVectorOrUndefinedIfJitless();
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
int GetStackParameterCount() const
int GetParameterCount() const
static CallDescriptor * GetBytecodeDispatchCallDescriptor(Zone *zone, const CallInterfaceDescriptor &descriptor, int stack_parameter_count)
V8_INLINE bool Bind(Block *block)
static constexpr MemoryRepresentation AnyTagged()
static constexpr MemoryRepresentation Uint32()
static constexpr MemoryRepresentation TaggedSigned()
static constexpr MemoryRepresentation Int32()
constexpr uint8_t SizeInBytesLog2() const
static constexpr MemoryRepresentation Uint16()
static constexpr MemoryRepresentation UintPtr()
static constexpr MemoryRepresentation Uint8()
constexpr bool valid() const
OpIndex Parameter(int index, RegisterRepresentation rep, const char *debug_name=nullptr)
static V< T > Cast(V< U > index)
V< WordPtr > LoadBytecode(V< WordPtr > bytecode_offset)
Var< WordPtr > bytecode_offset_
V< WordPtr > BytecodeOffset()
Var< Object > bytecode_array_
V< Word32 > BytecodeOperand(int operand_index, OperandSize operand_size)
V< Word32 > BytecodeOperandIdxInt32(int operand_index)
V< Word32 > LoadFromBytecodeArrayAt(MemoryRepresentation loaded_rep, V< WordPtr > bytecode_offset, int additional_offset=0)
void StarDispatchLookahead(V< WordPtr > target_bytecode)
void SetAccumulator(V< Object > value)
V< BytecodeArray > BytecodeArrayTaggedPointer()
V< WordPtr > GetInterpretedFramePointer()
void DispatchToBytecodeHandlerEntry(V< WordPtr > handler_entry, V< WordPtr > bytecode_offset)
V< WordPtr > Advance(ConstOrV< WordPtr > delta)
V< Object > GetAccumulator()
Var< Object > accumulator_
Bytecode bytecode() const
OpIndex bytecode_offset_parameter_
OpIndex dispatch_table_parameter_
V< Object > LoadRegister(Register reg)
V< Word32 > BytecodeUnsignedOperand(int operand_index, OperandSize operand_size)
ZoneWithName< compiler::kGraphZoneName > & graph_zone_
void DispatchToBytecodeWithOptionalStarLookahead(V< WordPtr > target_bytecode)
V< WordPtr > DispatchTablePointer()
OperandScale operand_scale() const
int OperandOffset(int operand_index) const
BytecodeHandlerData & data_
void DispatchToBytecode(V< WordPtr > target_bytecode, V< WordPtr > new_bytecode_offset)
void InitializeParameters(V< Object > accumulator, V< BytecodeArray > bytecode_array, V< WordPtr > bytecode_offset, V< WordPtr > dispatch_table)
V< WordPtr > LoadAndUntagRegister(Register reg)
Var< WordPtr > dispatch_table_
void TrackRegisterUse(ImplicitRegisterUse use)
V< WordPtr > ReloadBytecodeOffset()
V< Context > GetContext()
int CurrentBytecodeSize() const
~BytecodeHandlerReducer()
Var< WordPtr > interpreted_frame_pointer_
void TailCallBytecodeDispatch(const CallInterfaceDescriptor &descriptor, V< WordPtr > target, Args... args)
static ImplicitRegisterUse GetImplicitRegisterUse(Bytecode bytecode)
static OperandSize GetOperandSize(Bytecode bytecode, int i, OperandScale operand_scale)
static bool WritesAccumulator(Bytecode bytecode)
static bool MakesCallAlongCriticalPath(Bytecode bytecode)
static int GetOperandOffset(Bytecode bytecode, int i, OperandScale operand_scale)
static bool ReadsAccumulator(Bytecode bytecode)
static OperandType GetOperandType(Bytecode bytecode, int i)
static int Size(Bytecode bytecode, OperandScale operand_scale)
static int NumberOfOperands(Bytecode bytecode)
static bool IsStarLookahead(Bytecode bytecode, OperandScale operand_scale)
static constexpr Register bytecode_array()
static constexpr Register current_context()
static constexpr Register bytecode_offset()
void EmitBytecodeHandlerProlog()
TurboshaftBytecodeHandlerAssembler(compiler::turboshaft::PipelineData *data, compiler::turboshaft::Graph &graph, Zone *phase_zone)
base::Vector< const DirectHandle< Object > > args
#define IGNITION_HANDLER_TS(Name, BaseAssembler)
ZoneVector< RpoNumber > & result
constexpr Vector< T > VectorOf(T *start, size_t size)
constexpr int kSystemPointerSizeLog2
constexpr int kSystemPointerSize
other heap size generate builtins concurrently on separate threads in mksnapshot track concurrent recompilation artificial compilation delay in ms max number of threads that concurrent Turbofan can use(0 for unbounded)") DEFINE_BOOL( stress_concurrent_inlining
constexpr bool SmiValuesAre32Bits()
i::Address Load(i::Address address)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
interpreter::ImplicitRegisterUse implicit_register_use
interpreter::Bytecode bytecode
bool bytecode_array_valid
interpreter::OperandScale operand_scale
static constexpr Kind TaggedBase()
static const TSCallDescriptor * Create(const CallDescriptor *descriptor, CanThrow can_throw, LazyDeoptOnThrow lazy_deopt_on_throw, Zone *graph_zone, const JSWasmCallParameters *js_wasm_call_parameters=nullptr)
#define BUILTIN_REDUCER(name)