73 int initial_offset = 0);
82 cursor_ += current_bytecode_size_without_prefix();
87 void AdvanceTo(
int offset);
88 void SetOffset(
int offset);
96 bool CurrentBytecodeIsValidOSREntry()
const;
98 void ApplyDebugBreak();
102 uint8_t current_byte = *
cursor_;
103 Bytecode current_bytecode = Bytecodes::FromByte(current_byte);
104 DCHECK(!Bytecodes::IsPrefixScalingBytecode(current_bytecode));
105 return current_bytecode;
108 return prefix_size_ + current_bytecode_size_without_prefix();
111 return Bytecodes::Size(current_bytecode(), current_operand_scale());
117 int next_offset()
const {
return current_offset() + current_bytecode_size(); }
119 uint8_t* next_cursor =
cursor_ + current_bytecode_size_without_prefix();
120 if (next_cursor ==
end_)
return Bytecode::kIllegal;
121 Bytecode next_bytecode = Bytecodes::FromByte(*next_cursor);
122 if (Bytecodes::IsPrefixScalingBytecode(next_bytecode)) {
123 next_bytecode = Bytecodes::FromByte(*(next_cursor + 1));
125 return next_bytecode;
130 uint32_t GetFlag8Operand(
int operand_index)
const;
131 uint32_t GetFlag16Operand(
int operand_index)
const;
132 uint32_t GetUnsignedImmediateOperand(
int operand_index)
const;
133 int32_t GetImmediateOperand(
int operand_index)
const;
134 uint32_t GetIndexOperand(
int operand_index)
const;
136 Register GetParameter(
int parameter_index)
const;
137 uint32_t GetRegisterCountOperand(
int operand_index)
const;
138 Register GetRegisterOperand(
int operand_index)
const;
139 Register GetStarTargetRegister()
const;
140 std::pair<Register, Register> GetRegisterPairOperand(
int operand_index)
const;
141 RegisterList GetRegisterListOperand(
int operand_index)
const;
142 int GetRegisterOperandRange(
int operand_index)
const;
145 uint32_t GetNativeContextIndexOperand(
int operand_index)
const;
146 template <
typename IsolateT>
148 bool IsConstantAtIndexSmi(
int offset)
const;
150 template <
typename IsolateT>
152 IsolateT* isolate)
const;
157 int GetRelativeJumpTargetOffset()
const;
161 int GetJumpTargetOffset()
const;
169 int GetAbsoluteOffset(
int relative_offset)
const;
171 std::ostream& PrintTo(std::ostream& os)
const;
177 void UpdatePointers();
182 return cursor_ == other.cursor_;
185 return cursor_ != other.cursor_;
189 void SetOffsetUnchecked(
int offset);
192 uint32_t GetUnsignedOperand(
int operand_index,
194 int32_t GetSignedOperand(
int operand_index,
OperandType operand_type)
const;
198 uint8_t current_byte = *
cursor_;
199 Bytecode current_bytecode = Bytecodes::FromByte(current_byte);
200 if (Bytecodes::IsPrefixScalingBytecode(current_bytecode)) {
202 Bytecodes::PrefixBytecodeToOperandScale(current_bytecode);
206 operand_scale_ = OperandScale::kSingle;