| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Declares a Simulator for ARM instructions if we are not generating a native | 5 // Declares a Simulator for ARM instructions if we are not generating a native |
| 6 // ARM binary. This Simulator allows us to run and debug ARM code generation on | 6 // ARM binary. This Simulator allows us to run and debug ARM code generation on |
| 7 // regular desktop machines. | 7 // regular desktop machines. |
| 8 // Dart calls into generated code by "calling" the InvokeDartCode stub, | 8 // Dart calls into generated code by "calling" the InvokeDartCode stub, |
| 9 // which will start execution in the Simulator or forwards to the real entry | 9 // which will start execution in the Simulator or forwards to the real entry |
| 10 // on a ARM HW platform. | 10 // on a ARM HW platform. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // The currently executing Simulator instance, which is associated to the | 45 // The currently executing Simulator instance, which is associated to the |
| 46 // current isolate | 46 // current isolate |
| 47 static Simulator* Current(); | 47 static Simulator* Current(); |
| 48 | 48 |
| 49 // Accessors for register state. Reading the pc value adheres to the ARM | 49 // Accessors for register state. Reading the pc value adheres to the ARM |
| 50 // architecture specification and is off by 8 from the currently executing | 50 // architecture specification and is off by 8 from the currently executing |
| 51 // instruction. | 51 // instruction. |
| 52 void set_register(Register reg, int32_t value); | 52 void set_register(Register reg, int32_t value); |
| 53 int32_t get_register(Register reg) const; | 53 int32_t get_register(Register reg) const; |
| 54 | 54 |
| 55 int32_t get_sp() const { |
| 56 return get_register(SPREG); |
| 57 } |
| 58 |
| 55 // Special case of set_register and get_register to access the raw PC value. | 59 // Special case of set_register and get_register to access the raw PC value. |
| 56 void set_pc(int32_t value); | 60 void set_pc(int32_t value); |
| 57 int32_t get_pc() const; | 61 int32_t get_pc() const; |
| 58 | 62 |
| 59 // Accessors for VFP register state. | 63 // Accessors for VFP register state. |
| 60 void set_sregister(SRegister reg, float value); | 64 void set_sregister(SRegister reg, float value); |
| 61 float get_sregister(SRegister reg) const; | 65 float get_sregister(SRegister reg) const; |
| 62 void set_dregister(DRegister reg, double value); | 66 void set_dregister(DRegister reg, double value); |
| 63 double get_dregister(DRegister reg) const; | 67 double get_dregister(DRegister reg) const; |
| 64 void set_qregister(QRegister reg, const simd_value_t& value); | 68 void set_qregister(QRegister reg, const simd_value_t& value); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 281 } |
| 278 | 282 |
| 279 friend class SimulatorDebugger; | 283 friend class SimulatorDebugger; |
| 280 friend class SimulatorSetjmpBuffer; | 284 friend class SimulatorSetjmpBuffer; |
| 281 DISALLOW_COPY_AND_ASSIGN(Simulator); | 285 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 282 }; | 286 }; |
| 283 | 287 |
| 284 } // namespace dart | 288 } // namespace dart |
| 285 | 289 |
| 286 #endif // VM_SIMULATOR_ARM_H_ | 290 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |