| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Implementation of atomic compare and exchange in the same synchronization | 75 // Implementation of atomic compare and exchange in the same synchronization |
| 76 // domain as other synchronization primitive instructions (e.g. ldrex, strex). | 76 // domain as other synchronization primitive instructions (e.g. ldrex, strex). |
| 77 static uword CompareExchange(uword* address, | 77 static uword CompareExchange(uword* address, |
| 78 uword compare_value, | 78 uword compare_value, |
| 79 uword new_value); | 79 uword new_value); |
| 80 | 80 |
| 81 // Runtime and native call support. | 81 // Runtime and native call support. |
| 82 enum CallKind { | 82 enum CallKind { |
| 83 kRuntimeCall, | 83 kRuntimeCall, |
| 84 kLeafRuntimeCall, | 84 kLeafRuntimeCall, |
| 85 kLeafFloatRuntimeCall, |
| 85 kNativeCall | 86 kNativeCall |
| 86 }; | 87 }; |
| 87 // TODO(regis): In order to simulate leaf runtime calls taking floating point | 88 static uword RedirectExternalReference(uword function, |
| 88 // arguments, we need to add a 'kLeafFloatRuntimeCall' CallKind and pass the | 89 CallKind call_kind, |
| 89 // number of arguments. | 90 int argument_count); |
| 90 static uword RedirectExternalReference(uword function, CallKind call_kind); | |
| 91 | 91 |
| 92 void Longjmp(uword pc, | 92 void Longjmp(uword pc, |
| 93 uword sp, | 93 uword sp, |
| 94 uword fp, | 94 uword fp, |
| 95 RawObject* raw_exception, | 95 RawObject* raw_exception, |
| 96 RawObject* raw_stacktrace); | 96 RawObject* raw_stacktrace); |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 // Known bad pc value to ensure that the simulator does not execute | 99 // Known bad pc value to ensure that the simulator does not execute |
| 100 // without being properly setup. | 100 // without being properly setup. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 friend class SimulatorDebugger; | 243 friend class SimulatorDebugger; |
| 244 friend class SimulatorSetjmpBuffer; | 244 friend class SimulatorSetjmpBuffer; |
| 245 DISALLOW_COPY_AND_ASSIGN(Simulator); | 245 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 } // namespace dart | 248 } // namespace dart |
| 249 | 249 |
| 250 #endif // VM_SIMULATOR_ARM_H_ | 250 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |