12#ifndef RUNTIME_VM_SIMULATOR_ARM64_H_
13#define RUNTIME_VM_SIMULATOR_ARM64_H_
15#ifndef RUNTIME_VM_SIMULATOR_H_
16#error Do not include simulator_arm64.h directly; use simulator.h.
25class SimulatorSetjmpBuffer;
93 int64_t
Call(int64_t entry,
98 bool fp_return =
false,
99 bool fp_args =
false);
119 static constexpr uword kBadLR = -1;
124 static constexpr uword kEndSimulatingPC = -2;
140 uword overflow_stack_limit_;
144 static int64_t flag_stop_sim_at_;
149 int64_t break_instr_;
152 static bool IsIllegalAddress(
uword addr) {
return addr < 64 * 1024; }
153 void HandleIllegalAccess(
uword addr,
Instr* instr);
156 void UnalignedAccess(
const char* msg,
uword addr,
Instr* instr);
159 void UnimplementedInstruction(
Instr* instr);
164 inline uint8_t ReadBU(
uword addr);
165 inline int8_t ReadB(
uword addr);
166 inline void WriteB(
uword addr, uint8_t value);
168 inline uint16_t ReadHU(
uword addr,
Instr* instr);
169 inline int16_t ReadH(
uword addr,
Instr* instr);
170 inline void WriteH(
uword addr, uint16_t value,
Instr* instr);
172 inline uint32_t ReadWU(
uword addr,
174 bool must_be_aligned =
false);
175 inline int32_t ReadW(
uword addr,
Instr* instr);
176 inline void WriteW(
uword addr, uint32_t value,
Instr* instr);
178 inline intptr_t ReadX(
uword addr,
Instr* instr,
bool must_be_aligned =
false);
179 inline void WriteX(
uword addr, intptr_t value,
Instr* instr);
182 void ClearExclusive();
183 intptr_t ReadExclusiveX(
uword addr,
Instr* instr);
184 intptr_t WriteExclusiveX(
uword addr, intptr_t value,
Instr* instr);
186 intptr_t ReadExclusiveW(
uword addr,
Instr* instr);
187 intptr_t WriteExclusiveW(
uword addr, intptr_t value,
Instr* instr);
190 intptr_t ReadAcquire(
uword addr,
Instr* instr);
191 uint32_t ReadAcquireW(
uword addr,
Instr* instr);
192 void WriteRelease(
uword addr, intptr_t value,
Instr* instr);
193 void WriteReleaseW(
uword addr, uint32_t value,
Instr* instr);
200 uword exclusive_access_addr_;
201 uword exclusive_access_value_;
204 void SetNZFlagsW(int32_t val);
205 bool CarryFromW(int32_t
left, int32_t
right, int32_t carry);
206 bool OverflowFromW(int32_t
left, int32_t
right, int32_t carry);
208 void SetNZFlagsX(int64_t val);
209 bool CarryFromX(int64_t alu_out, int64_t
left, int64_t
right,
bool addition);
210 bool OverflowFromX(int64_t alu_out,
215 void SetCFlag(
bool val);
216 void SetVFlag(
bool val);
218 int64_t ShiftOperand(uint8_t reg_size,
223 int64_t ExtendOperand(uint8_t reg_size,
228 int64_t DecodeShiftExtendOperand(
Instr* instr);
230 bool ConditionallyExecute(
Instr* instr);
232 void DoRedirectedCall(
Instr* instr);
235 void InstructionDecode(
Instr* instr);
236 void InstructionDecodeImpl(
Instr* instr);
237#define DECODE_OP(op) void Decode##op(Instr* instr);
243 void ExecuteNoTrace();
246 void ClobberVolatileRegisters();
249 bool IsTracingExecution()
const;
254 last_setjmp_buffer_ =
buffer;
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void set_vregisterd(VRegister reg, int idx, int64_t value)
int64_t get_vregisterd(VRegister reg, int idx) const
int64_t get_register(Register reg, R31Type r31t=R31IsSP) const
static uword RedirectExternalReference(uword function, CallKind call_kind, int argument_count)
void JumpToFrame(uword pc, uword sp, uword fp, Thread *thread)
friend class SimulatorSetjmpBuffer
static Simulator * Current()
uint64_t get_icount() const
int32_t get_vregisters(VRegister reg, int idx) const
void get_vregister(VRegister reg, simd_value_t *value) const
uword overflow_stack_limit() const
void set_vregister(VRegister reg, const simd_value_t &value)
void set_vregisters(VRegister reg, int idx, int32_t value)
uword stack_limit() const
friend class SimulatorDebugger
static constexpr uword kSimulatorStackUnderflowSize
uint64_t get_last_pc() const
int64_t Call(int64_t entry, int64_t parameter0, int64_t parameter1, int64_t parameter2, int64_t parameter3, bool fp_return=false, bool fp_args=false)
int32_t get_wregister(Register reg, R31Type r31t=R31IsSP) const
DART_FORCE_INLINE int32_t get_register(Register reg) const
void set_register(Instr *instr, Register reg, int64_t value, R31Type r31t=R31IsSP)
void set_wregister(Register reg, int32_t value, R31Type r31t=R31IsSP)
static uword FunctionForRedirect(uword redirect)
#define APPLY_OP_LIST(_V)
static const uint8_t buffer[]
uint32_t uint32_t * format
Dart_NativeFunction function