5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_ 6 #define V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_ 8 #include "src/globals.h" 9 #include "src/handles.h" 10 #include "src/interpreter/bytecode-register.h" 11 #include "src/interpreter/bytecodes.h" 12 #include "src/objects.h" 13 #include "src/objects/smi.h" 14 #include "src/runtime/runtime.h" 21 namespace interpreter {
23 class BytecodeArrayAccessor;
35 iterator(
int case_value,
int table_offset,
int table_end,
40 bool operator!=(
const iterator& other);
43 void UpdateAndAdvanceToValid();
53 int table_size,
int case_value_base);
72 void SetOffset(
int offset);
74 void ApplyDebugBreak();
76 Bytecode current_bytecode()
const;
77 int current_bytecode_size()
const;
78 int current_offset()
const {
return bytecode_offset_; }
79 OperandScale current_operand_scale()
const {
return operand_scale_; }
80 int current_prefix_offset()
const {
return prefix_offset_; }
82 return bytecode_array_;
85 uint32_t GetFlagOperand(
int operand_index)
const;
86 uint32_t GetUnsignedImmediateOperand(
int operand_index)
const;
87 int32_t GetImmediateOperand(
int operand_index)
const;
88 uint32_t GetIndexOperand(
int operand_index)
const;
90 uint32_t GetRegisterCountOperand(
int operand_index)
const;
91 Register GetRegisterOperand(
int operand_index)
const;
92 int GetRegisterOperandRange(
int operand_index)
const;
93 Runtime::FunctionId GetRuntimeIdOperand(
int operand_index)
const;
94 Runtime::FunctionId GetIntrinsicIdOperand(
int operand_index)
const;
95 uint32_t GetNativeContextIndexOperand(
int operand_index)
const;
96 Object* GetConstantAtIndex(
int offset)
const;
97 Object* GetConstantForIndexOperand(
int operand_index)
const;
102 int GetJumpTargetOffset()
const;
110 int GetAbsoluteOffset(
int relative_offset)
const;
112 bool OffsetWithinBytecode(
int offset)
const;
114 std::ostream& PrintTo(std::ostream& os)
const;
117 bool OffsetInBounds()
const;
119 uint32_t GetUnsignedOperand(
int operand_index,
120 OperandType operand_type)
const;
121 int32_t GetSignedOperand(
int operand_index, OperandType operand_type)
const;
123 void UpdateOperandScale();
126 int bytecode_offset_;
127 OperandScale operand_scale_;
137 #endif // V8_INTERPRETER_BYTECODE_ARRAY_ACCESSOR_H_