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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Special case of set_register and get_register to access the raw PC value. | 44 // Special case of set_register and get_register to access the raw PC value. |
45 void set_pc(int32_t value); | 45 void set_pc(int32_t value); |
46 int32_t get_pc() const; | 46 int32_t get_pc() const; |
47 | 47 |
48 // Accessors for VFP register state. | 48 // Accessors for VFP register state. |
49 void set_sregister(SRegister reg, float value); | 49 void set_sregister(SRegister reg, float value); |
50 float get_sregister(SRegister reg) const; | 50 float get_sregister(SRegister reg) const; |
51 void set_dregister(DRegister reg, double value); | 51 void set_dregister(DRegister reg, double value); |
52 double get_dregister(DRegister reg) const; | 52 double get_dregister(DRegister reg) const; |
53 | 53 |
| 54 // When moving integer (rather than floating point) values to/from |
| 55 // the FPU registers, use the _bits calls to avoid gcc taking liberties with |
| 56 // integers that map to such things as NaN floating point values. |
| 57 void set_sregister_bits(SRegister reg, int32_t value); |
| 58 int32_t get_sregister_bits(SRegister reg) const; |
| 59 void set_dregister_bits(DRegister reg, int64_t value); |
| 60 int64_t get_dregister_bits(DRegister reg) const; |
| 61 |
54 // Accessor to the internal simulator stack top. | 62 // Accessor to the internal simulator stack top. |
55 uword StackTop() const; | 63 uword StackTop() const; |
56 | 64 |
57 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator | 65 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator |
58 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the | 66 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the |
59 // native stack. | 67 // native stack. |
60 uword top_exit_frame_info() const { return top_exit_frame_info_; } | 68 uword top_exit_frame_info() const { return top_exit_frame_info_; } |
61 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } | 69 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } |
62 | 70 |
63 // Call on program start. | 71 // Call on program start. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 120 |
113 // CPU state. | 121 // CPU state. |
114 int32_t registers_[kNumberOfCpuRegisters]; | 122 int32_t registers_[kNumberOfCpuRegisters]; |
115 bool n_flag_; | 123 bool n_flag_; |
116 bool z_flag_; | 124 bool z_flag_; |
117 bool c_flag_; | 125 bool c_flag_; |
118 bool v_flag_; | 126 bool v_flag_; |
119 | 127 |
120 // VFP state. | 128 // VFP state. |
121 union { // S and D register banks are overlapping. | 129 union { // S and D register banks are overlapping. |
122 float sregisters_[kNumberOfSRegisters]; | 130 int32_t sregisters_[kNumberOfSRegisters]; |
123 double dregisters_[kNumberOfDRegisters]; | 131 int64_t dregisters_[kNumberOfDRegisters]; |
124 }; | 132 }; |
125 bool fp_n_flag_; | 133 bool fp_n_flag_; |
126 bool fp_z_flag_; | 134 bool fp_z_flag_; |
127 bool fp_c_flag_; | 135 bool fp_c_flag_; |
128 bool fp_v_flag_; | 136 bool fp_v_flag_; |
129 | 137 |
130 // Simulator support. | 138 // Simulator support. |
131 char* stack_; | 139 char* stack_; |
132 bool pc_modified_; | 140 bool pc_modified_; |
133 int icount_; | 141 int icount_; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 254 } |
247 | 255 |
248 friend class SimulatorDebugger; | 256 friend class SimulatorDebugger; |
249 friend class SimulatorSetjmpBuffer; | 257 friend class SimulatorSetjmpBuffer; |
250 DISALLOW_COPY_AND_ASSIGN(Simulator); | 258 DISALLOW_COPY_AND_ASSIGN(Simulator); |
251 }; | 259 }; |
252 | 260 |
253 } // namespace dart | 261 } // namespace dart |
254 | 262 |
255 #endif // VM_SIMULATOR_ARM_H_ | 263 #endif // VM_SIMULATOR_ARM_H_ |
OLD | NEW |