| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 int32_t parameter1, | 69 int32_t parameter1, |
| 70 int32_t parameter2, | 70 int32_t parameter2, |
| 71 int32_t parameter3); | 71 int32_t parameter3); |
| 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 call support. | 79 // Runtime and native call support. |
| 80 static uword RedirectExternalReference(uword function, | 80 enum CallKind { |
| 81 uint32_t argument_count); | 81 kRuntimeCall, |
| 82 kNativeCall |
| 83 }; |
| 84 static uword RedirectExternalReference(uword function, CallKind call_kind); |
| 82 | 85 |
| 83 void Longjmp(int32_t pc, int32_t sp, int32_t fp, const Instance& object); | 86 void Longjmp(int32_t pc, int32_t sp, int32_t fp, const Instance& object); |
| 84 | 87 |
| 85 private: | 88 private: |
| 86 // Known bad pc value to ensure that the simulator does not execute | 89 // Known bad pc value to ensure that the simulator does not execute |
| 87 // without being properly setup. | 90 // without being properly setup. |
| 88 static const uword kBadLR = -1; | 91 static const uword kBadLR = -1; |
| 89 // A pc value used to signal the simulator to stop execution. Generally | 92 // A pc value used to signal the simulator to stop execution. Generally |
| 90 // the lr is set to this value on transition from native C code to | 93 // the lr is set to this value on transition from native C code to |
| 91 // simulated execution, so that the simulator can "return" to the native | 94 // simulated execution, so that the simulator can "return" to the native |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 224 } |
| 222 | 225 |
| 223 friend class SimulatorDebugger; | 226 friend class SimulatorDebugger; |
| 224 friend class SimulatorSetjmpBuffer; | 227 friend class SimulatorSetjmpBuffer; |
| 225 DISALLOW_COPY_AND_ASSIGN(Simulator); | 228 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 226 }; | 229 }; |
| 227 | 230 |
| 228 } // namespace dart | 231 } // namespace dart |
| 229 | 232 |
| 230 #endif // VM_SIMULATOR_ARM_H_ | 233 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |