14namespace interpreter {
18 : bytecode_array_(bytecode_array),
19 start_(reinterpret_cast<uint8_t*>(
20 bytecode_array_->GetFirstBytecodeAddress())),
27 :
Isolate::Current()->main_thread_local_heap()) {
30 if (initial_offset != 0) {
38 : bytecode_array_(bytecode_array),
39 start_(reinterpret_cast<uint8_t*>(
40 bytecode_array_->GetFirstBytecodeAddress())),
45 local_heap_(nullptr) {
48 if (initial_offset != 0) {
94 if (it.current_offset() ==
offset)
return true;
95 if (it.current_offset() >
offset)
break;
104 return it.CurrentBytecodeIsValidOSREntry();
124 int operand_index,
OperandType operand_type)
const {
139 int operand_index,
OperandType operand_type)
const {
155 OperandType::kFlag8);
161 OperandType::kFlag16);
166 int operand_index)
const {
179 int operand_index)
const {
181 OperandType::kRegCount);
188 DCHECK_EQ(operand_type, OperandType::kIdx);
229 int operand_index)
const {
232 return std::make_pair(first,
second);
236 int operand_index)
const {
246 OperandType operand_type = operand_types[operand_index];
248 if (operand_type == OperandType::kRegList ||
249 operand_type == OperandType::kRegOutList) {
257 int operand_index)
const {
260 DCHECK_EQ(operand_type, OperandType::kRuntimeId);
266 int operand_index)
const {
269 DCHECK_EQ(operand_type, OperandType::kNativeContextIndex);
274 int operand_index)
const {
277 DCHECK_EQ(operand_type, OperandType::kIntrinsicId);
283template <
typename IsolateT>
285 int index, IsolateT* isolate)
const {
297template <
typename IsolateT>
299 int operand_index, IsolateT* isolate)
const {
305 int operand_index,
Isolate* isolate)
const;
313 if (bytecode == Bytecode::kJumpLoop) {
314 relative_offset = -relative_offset;
316 return relative_offset;
331 uint32_t table_start, table_size;
332 int32_t case_value_base;
357 reinterpret_cast<uint8_t*
>(
bytecode_array_->GetFirstBytecodeAddress());
371 table_start_(table_start),
372 table_size_(table_size),
373 case_value_base_(case_value_base) {}
394 int case_value,
int table_offset,
int table_end,
399 table_offset_(table_offset),
400 table_end_(table_end) {
414 UpdateAndAdvanceToValid();
423 return index_ != other.index_;
427 while (table_offset_ < table_end_ &&
428 !
iterator_->IsConstantAtIndexSmi(table_offset_)) {
434 if (table_offset_ < table_end_) {
static FeedbackSlot ToSlot(intptr_t index)
void RemoveGCEpilogueCallback(GCEpilogueCallback *callback, void *data)
void AddGCEpilogueCallback(GCEpilogueCallback *callback, void *data, GCCallbacksInSafepoint::GCType gc_type=GCCallbacksInSafepoint::GCType::kAll)
static constexpr int ToInt(const Tagged< Object > object)
bool CurrentBytecodeIsValidOSREntry() const
Register GetStarTargetRegister() const
static bool IsValidOffset(Handle< BytecodeArray > bytecode_array, int offset)
Bytecode current_bytecode() const
Register GetParameter(int parameter_index) const
FeedbackSlot GetSlotOperand(int operand_index) const
Register GetRegisterOperand(int operand_index) const
int GetJumpTargetOffset() const
int GetAbsoluteOffset(int relative_offset) const
std::ostream & PrintTo(std::ostream &os) const
uint32_t GetUnsignedOperand(int operand_index, OperandType operand_type) const
OperandScale current_operand_scale() const
uint32_t GetFlag8Operand(int operand_index) const
uint32_t GetUnsignedImmediateOperand(int operand_index) const
int32_t GetImmediateOperand(int operand_index) const
DirectHandle< BytecodeArray > bytecode_array() const
BytecodeArrayIterator(Handle< BytecodeArray > bytecode_array, int initial_offset=0)
void UpdateOperandScale()
Handle< Object > GetConstantForIndexOperand(int operand_index, IsolateT *isolate) const
int current_offset() const
std::pair< Register, Register > GetRegisterPairOperand(int operand_index) const
Handle< Object > GetConstantAtIndex(int offset, IsolateT *isolate) const
uint32_t GetFlag16Operand(int operand_index) const
void SetOffsetUnchecked(int offset)
static void UpdatePointersCallback(void *iterator)
void AdvanceTo(int offset)
uint32_t GetRegisterCountOperand(int operand_index) const
int GetRegisterOperandRange(int operand_index) const
int GetRelativeJumpTargetOffset() const
RegisterList GetRegisterListOperand(int operand_index) const
Tagged< Smi > GetConstantAtIndexAsSmi(int offset) const
uint32_t GetNativeContextIndexOperand(int operand_index) const
Handle< BytecodeArray > bytecode_array_
JumpTableTargetOffsets GetJumpTableTargetOffsets() const
LocalHeap *const local_heap_
static bool IsValidOSREntryOffset(Handle< BytecodeArray > bytecode_array, int offset)
bool IsConstantAtIndexSmi(int offset) const
int32_t GetSignedOperand(int operand_index, OperandType operand_type) const
void SetOffset(int offset)
Runtime::FunctionId GetIntrinsicIdOperand(int operand_index) const
uint32_t GetIndexOperand(int operand_index) const
Runtime::FunctionId GetRuntimeIdOperand(int operand_index) const
static int32_t DecodeSignedOperand(Address operand_start, OperandType operand_type, OperandScale operand_scale)
static uint32_t DecodeUnsignedOperand(Address operand_start, OperandType operand_type, OperandScale operand_scale)
static Register DecodeRegisterOperand(Address operand_start, OperandType operand_type, OperandScale operand_scale)
static std::ostream & Decode(std::ostream &os, const uint8_t *bytecode_start, bool with_hex=true)
static const OperandType * GetOperandTypes(Bytecode bytecode)
static Bytecode FromByte(uint8_t value)
static constexpr bool IsAnyStar(Bytecode bytecode)
static int GetNumberOfRegistersRepresentedBy(OperandType operand_type)
static constexpr bool IsJumpImmediate(Bytecode bytecode)
static int GetOperandOffset(Bytecode bytecode, int i, OperandScale operand_scale)
static Bytecode GetDebugBreak(Bytecode bytecode)
static bool IsDebugBreak(Bytecode bytecode)
static bool IsRegisterOperandType(OperandType operand_type)
static uint8_t ToByte(Bytecode bytecode)
static OperandType GetOperandType(Bytecode bytecode, int i)
static constexpr bool IsJumpConstant(Bytecode bytecode)
static int NumberOfOperands(Bytecode bytecode)
static bool IsUnsignedOperandType(OperandType operand_type)
static constexpr bool IsShortStar(Bytecode bytecode)
static Runtime::FunctionId ToRuntimeId(IntrinsicId intrinsic_id)
iterator(int case_value, int table_offset, int table_end, const BytecodeArrayIterator *iterator)
void UpdateAndAdvanceToValid()
bool operator!=(const iterator &other)
JumpTableTargetOffset operator*()
JumpTableTargetOffsets(const BytecodeArrayIterator *iterator, int table_start, int table_size, int case_value_base)
const BytecodeArrayIterator * iterator_
static constexpr Register FromParameterIndex(int index)
static constexpr Register FromShortStar(Bytecode bytecode)
const v8::base::TimeTicks end_
#define EXPORT_TEMPLATE_DEFINE(export)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK_LE(v1, v2)
#define DCHECK_GE(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
#define V8_EXPORT_PRIVATE