12#ifndef RUNTIME_VM_SIMULATOR_ARM_H_
13#define RUNTIME_VM_SIMULATOR_ARM_H_
15#ifndef RUNTIME_VM_SIMULATOR_H_
16#error Do not include simulator_arm.h directly; use simulator.h.
25class SimulatorSetjmpBuffer;
60 DART_FORCE_INLINE int32_t
get_pc()
const {
return registers_[
PC]; }
97 int64_t
Call(int32_t entry,
102 bool fp_return =
false,
103 bool fp_args =
false);
123 static constexpr uword kBadLR = -1;
128 static constexpr uword kEndSimulatingPC = -2;
151 uword overflow_stack_limit_;
155 static int32_t flag_stop_sim_at_;
160 int32_t break_instr_;
163 static bool IsIllegalAddress(
uword addr) {
return addr < 64 * 1024; }
164 void HandleIllegalAccess(
uword addr, Instr* instr);
167 void UnimplementedInstruction(Instr* instr);
170 void Format(Instr* instr,
const char*
format);
174 bool ConditionallyExecute(Instr* instr);
177 void SetNZFlags(int32_t val);
178 void SetCFlag(
bool val);
179 void SetVFlag(
bool val);
180 bool CarryFrom(int32_t
left, int32_t
right, int32_t carry);
181 bool OverflowFrom(int32_t
left, int32_t
right, int32_t carry);
184 int32_t GetShiftRm(Instr* instr,
bool* carry_out);
185 int32_t GetImm(Instr* instr,
bool* carry_out);
186 void HandleRList(Instr* instr,
bool load);
187 void SupervisorCall(Instr* instr);
190 void UnalignedAccess(
const char* msg,
uword addr, Instr* instr);
193 void DoDivision(Instr* instr);
195 inline uint8_t ReadBU(
uword addr);
196 inline int8_t ReadB(
uword addr);
197 inline void WriteB(
uword addr, uint8_t value);
199 inline uint16_t ReadHU(
uword addr, Instr* instr);
200 inline int16_t ReadH(
uword addr, Instr* instr);
201 inline void WriteH(
uword addr, uint16_t value, Instr* instr);
203 inline intptr_t ReadW(
uword addr, Instr* instr);
204 inline void WriteW(
uword addr, intptr_t value, Instr* instr);
207 void ClearExclusive();
208 intptr_t ReadExclusiveW(
uword addr, Instr* instr);
209 intptr_t WriteExclusiveW(
uword addr, intptr_t value, Instr* instr);
216 uword exclusive_access_addr_;
217 uword exclusive_access_value_;
220 void DecodeType01(Instr* instr);
221 void DecodeType2(Instr* instr);
222 void DecodeType3(Instr* instr);
223 void DecodeType4(Instr* instr);
224 void DecodeType5(Instr* instr);
225 void DecodeType6(Instr* instr);
226 void DecodeType7(Instr* instr);
227 void DecodeSIMDDataProcessing(Instr* instr);
230 void InstructionDecode(Instr* instr);
231 void InstructionDecodeImpl(Instr* instr);
235 void ExecuteNoTrace();
238 void ClobberVolatileRegisters();
241 bool IsTracingExecution()
const;
246 last_setjmp_buffer_ =
buffer;
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
int64_t dregisters_[kNumberOfDRegisters]
void set_register(Register reg, int32_t value)
simd_value_t qregisters_[kNumberOfQRegisters]
void set_pc(int32_t value)
void set_dregister(DRegister reg, double value)
DART_FORCE_INLINE int32_t get_pc() 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
void set_dregister_bits(DRegister reg, int64_t value)
static Simulator * Current()
void set_qregister(QRegister reg, const simd_value_t &value)
uint64_t get_icount() const
float get_sregister(SRegister reg) const
uword overflow_stack_limit() const
int64_t get_dregister_bits(DRegister reg) const
void set_sregister_bits(SRegister reg, int32_t value)
uword stack_limit() const
friend class SimulatorDebugger
static constexpr uword kSimulatorStackUnderflowSize
DART_FORCE_INLINE int32_t get_register(Register reg) const
void set_sregister(SRegister reg, float value)
double get_dregister(DRegister reg) const
void get_qregister(QRegister reg, simd_value_t *value) const
int32_t get_sregister_bits(SRegister reg) const
int32_t sregisters_[kNumberOfSRegisters]
int64_t Call(int32_t entry, int32_t parameter0, int32_t parameter1, int32_t parameter2, int32_t parameter3, bool fp_return=false, bool fp_args=false)
static uword FunctionForRedirect(uword redirect)
static const uint8_t buffer[]
uint32_t uint32_t * format
Dart_NativeFunction function