5#ifndef V8_BASELINE_BASELINE_COMPILER_H_
6#define V8_BASELINE_BASELINE_COMPILER_H_
35 DCHECK_LE(pc_diff, std::numeric_limits<uint32_t>::max());
40 template <
typename IsolateT>
78 template <
typename Type>
81 template <
typename Type>
85 uint32_t
Uint(
int operand_index);
86 int32_t
Int(
int operand_index);
87 uint32_t
Index(
int operand_index);
88 uint32_t
Flag8(
int operand_index);
89 uint32_t
Flag16(
int operand_index);
133 template <
Builtin kBuiltin,
typename... Args>
135 template <
typename... Args>
138 template <
Builtin kBuiltin,
typename... Args>
142 void BuildCall(uint32_t slot, uint32_t arg_count, Args...
args);
144#ifdef V8_TRACE_UNOPTIMIZED
149#define DECLARE_VISITOR(name, ...) void Visit##name();
151#undef DECLARE_VISITOR
154#define DECLARE_VISITOR(name, ...) \
155 void VisitIntrinsic##name(interpreter::RegisterList args);
157#undef DECLARE_VISITOR
203 bool may_have_deopted =
false;
204 bool accumulator_on_stack =
false;
205 bool safe_to_skip =
false;
210 DCHECK(!accumulator_on_stack);
211 may_have_deopted =
true;
214 void CheckEffect() {
DCHECK(!may_have_deopted || safe_to_skip); }
217 DCHECK(!accumulator_on_stack);
218 *
this = EffectState();
#define DECLARE_VISITOR(name,...)
#define BYTECODE_LIST(V, V_TSA)
bool Contains(int i) const
void CallBuiltin(Args... args)
Tagged< TaggedIndex > IndexAsTagged(int operand_index)
bool IsIndirectJumpTarget(int offset) const
Handle< Type > Constant(int operand_index)
void BuildCall(uint32_t slot, uint32_t arg_count, Args... args)
void LoadFeedbackVector(Register output)
void LoadRegister(Register output, int operand_index)
void JumpIfToBoolean(bool do_jump_if_true, Label *label, Label::Distance distance=Label::kFar)
const interpreter::BytecodeArrayIterator & iterator()
int32_t Int(int operand_index)
void StoreRegister(int operand_index, Register value)
Handle< SharedFunctionInfo > shared_function_info_
Tagged< Smi > IntAsSmi(int operand_index)
BytecodeOffsetTableBuilder bytecode_offset_table_builder_
Handle< HeapObject > interpreter_data_
void VisitSingleBytecode()
Tagged< Smi > Flag8AsSmi(int operand_index)
uint32_t Flag16(int operand_index)
void JumpIfRoot(RootIndex root)
Tagged< Smi > UintAsSmi(int operand_index)
void LoadClosureFeedbackArray(Register output)
BaselineCompiler(LocalIsolate *local_isolate, Handle< SharedFunctionInfo > shared_function_info, Handle< BytecodeArray > bytecode)
void PrologueHandleOptimizationState(Register feedback_vector)
uint32_t Uint(int operand_index)
Label * BuildForwardJumpLabel()
void SelectBooleanConstant(Register output, std::function< void(Label *, Label::Distance)> jump_func)
static int EstimateInstructionSize(Tagged< BytecodeArray > bytecode)
interpreter::BytecodeArrayIterator iterator_
uint32_t Index(int operand_index)
uint32_t Flag8(int operand_index)
void StoreRegisterPair(int operand_index, Register val0, Register val1)
RuntimeCallStats * stats_
bool IsJumpTarget(int offset) const
MaybeHandle< Code > Build()
void PreVisitSingleBytecode()
Label * EnsureLabel(int offset, MarkAsIndirectJumpTarget mark=MarkAsIndirectJumpTarget::kNo)
void JumpIfNotRoot(RootIndex root)
void UpdateInterruptBudgetAndJumpToLabel(int weight, Label *label, Label *skip_interrupt_label, StackCheckBehavior stack_check_behavior)
Handle< BytecodeArray > bytecode_
void CallRuntime(Runtime::FunctionId function, Args... args)
Tagged< Smi > IndexAsSmi(int operand_index)
void LoadConstant(Register output, int operand_index)
Tagged< Smi > Flag16AsSmi(int operand_index)
Tagged< Smi > ConstantSmi(int operand_index)
void TailCallBuiltin(Args... args)
Tagged< TaggedIndex > UintAsTagged(int operand_index)
LocalIsolate * local_isolate_
void MarkIndirectJumpTarget(int offset)
uint32_t RegisterCount(int operand_index)
interpreter::Register RegisterOperand(int operand_index)
MemOperand FeedbackVector()
void AddPosition(size_t pc_offset)
std::vector< uint8_t > bytes_
void Reserve(size_t size)
Handle< TrustedByteArray > ToBytecodeOffsetTable(IsolateT *isolate)
BaselineAssembler * assembler_
SaveAccumulatorScope(BaselineCompiler *compiler, BaselineAssembler *assembler)
base::Vector< const DirectHandle< Object > > args
#define INTRINSICS_LIST(V)
void VLQEncodeUnsigned(Function &&process_byte, uint32_t value)
RegExpCompiler * compiler_
#define DCHECK_LE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)