| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 void Format(Instr* instr, const char* format); | 172 void Format(Instr* instr, const char* format); |
| 173 | 173 |
| 174 // Checks if the current instruction should be executed based on its | 174 // Checks if the current instruction should be executed based on its |
| 175 // condition bits. | 175 // condition bits. |
| 176 bool ConditionallyExecute(Instr* instr); | 176 bool ConditionallyExecute(Instr* instr); |
| 177 | 177 |
| 178 // Helper functions to set the conditional flags in the architecture state. | 178 // Helper functions to set the conditional flags in the architecture state. |
| 179 void SetNZFlags(int32_t val); | 179 void SetNZFlags(int32_t val); |
| 180 void SetCFlag(bool val); | 180 void SetCFlag(bool val); |
| 181 void SetVFlag(bool val); | 181 void SetVFlag(bool val); |
| 182 bool CarryFrom(int32_t left, int32_t right); | 182 bool CarryFrom(int32_t left, int32_t right, int32_t carry); |
| 183 bool BorrowFrom(int32_t left, int32_t right); | 183 bool OverflowFrom(int32_t left, int32_t right, int32_t carry); |
| 184 bool OverflowFrom(int32_t alu_out, | |
| 185 int32_t left, | |
| 186 int32_t right, | |
| 187 bool addition); | |
| 188 | 184 |
| 189 // Helper functions to decode common "addressing" modes. | 185 // Helper functions to decode common "addressing" modes. |
| 190 int32_t GetShiftRm(Instr* instr, bool* carry_out); | 186 int32_t GetShiftRm(Instr* instr, bool* carry_out); |
| 191 int32_t GetImm(Instr* instr, bool* carry_out); | 187 int32_t GetImm(Instr* instr, bool* carry_out); |
| 192 void HandleRList(Instr* instr, bool load); | 188 void HandleRList(Instr* instr, bool load); |
| 193 void SupervisorCall(Instr* instr); | 189 void SupervisorCall(Instr* instr); |
| 194 | 190 |
| 195 // Read and write memory. | 191 // Read and write memory. |
| 196 void UnalignedAccess(const char* msg, uword addr, Instr* instr); | 192 void UnalignedAccess(const char* msg, uword addr, Instr* instr); |
| 197 | 193 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 } | 262 } |
| 267 | 263 |
| 268 friend class SimulatorDebugger; | 264 friend class SimulatorDebugger; |
| 269 friend class SimulatorSetjmpBuffer; | 265 friend class SimulatorSetjmpBuffer; |
| 270 DISALLOW_COPY_AND_ASSIGN(Simulator); | 266 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 271 }; | 267 }; |
| 272 | 268 |
| 273 } // namespace dart | 269 } // namespace dart |
| 274 | 270 |
| 275 #endif // VM_SIMULATOR_ARM_H_ | 271 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |