| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // Implementation of atomic compare and exchange in the same synchronization | 73 // Implementation of atomic compare and exchange in the same synchronization |
| 74 // domain as other synchronization primitive instructions (e.g. ldrex, strex). | 74 // domain as other synchronization primitive instructions (e.g. ldrex, strex). |
| 75 static uword CompareExchange(uword* address, | 75 static uword CompareExchange(uword* address, |
| 76 uword compare_value, | 76 uword compare_value, |
| 77 uword new_value); | 77 uword new_value); |
| 78 | 78 |
| 79 // Runtime and native call support. | 79 // Runtime and native call support. |
| 80 enum CallKind { | 80 enum CallKind { |
| 81 kRuntimeCall, | 81 kRuntimeCall, |
| 82 kLeafRuntimeCall, |
| 82 kNativeCall | 83 kNativeCall |
| 83 }; | 84 }; |
| 84 static uword RedirectExternalReference(uword function, CallKind call_kind); | 85 static uword RedirectExternalReference(uword function, CallKind call_kind); |
| 85 | 86 |
| 86 void Longjmp(int32_t pc, int32_t sp, int32_t fp, const Instance& object); | 87 void Longjmp(int32_t pc, int32_t sp, int32_t fp, const Instance& object); |
| 87 | 88 |
| 88 private: | 89 private: |
| 89 // Known bad pc value to ensure that the simulator does not execute | 90 // Known bad pc value to ensure that the simulator does not execute |
| 90 // without being properly setup. | 91 // without being properly setup. |
| 91 static const uword kBadLR = -1; | 92 static const uword kBadLR = -1; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 225 } |
| 225 | 226 |
| 226 friend class SimulatorDebugger; | 227 friend class SimulatorDebugger; |
| 227 friend class SimulatorSetjmpBuffer; | 228 friend class SimulatorSetjmpBuffer; |
| 228 DISALLOW_COPY_AND_ASSIGN(Simulator); | 229 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 229 }; | 230 }; |
| 230 | 231 |
| 231 } // namespace dart | 232 } // namespace dart |
| 232 | 233 |
| 233 #endif // VM_SIMULATOR_ARM_H_ | 234 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |