| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 ARM64 instructions if we are not generating a native | 5 // Declares a Simulator for ARM64 instructions if we are not generating a native |
| 6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation | 6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation |
| 7 // on regular desktop machines. | 7 // on 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 ARM64 HW platform. | 10 // on a ARM64 HW platform. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 kLeafFloatRuntimeCall, | 117 kLeafFloatRuntimeCall, |
| 118 kBootstrapNativeCall, | 118 kBootstrapNativeCall, |
| 119 kNativeCall | 119 kNativeCall |
| 120 }; | 120 }; |
| 121 static uword RedirectExternalReference(uword function, | 121 static uword RedirectExternalReference(uword function, |
| 122 CallKind call_kind, | 122 CallKind call_kind, |
| 123 int argument_count); | 123 int argument_count); |
| 124 | 124 |
| 125 static uword FunctionForRedirect(uword redirect); | 125 static uword FunctionForRedirect(uword redirect); |
| 126 | 126 |
| 127 void Longjmp(uword pc, | 127 void JumpToFrame(uword pc, uword sp, uword fp, Thread* thread); |
| 128 uword sp, | |
| 129 uword fp, | |
| 130 RawObject* raw_exception, | |
| 131 RawObject* raw_stacktrace, | |
| 132 Thread* thread); | |
| 133 | 128 |
| 134 private: | 129 private: |
| 135 // Known bad pc value to ensure that the simulator does not execute | 130 // Known bad pc value to ensure that the simulator does not execute |
| 136 // without being properly setup. | 131 // without being properly setup. |
| 137 static const uword kBadLR = -1; | 132 static const uword kBadLR = -1; |
| 138 // A pc value used to signal the simulator to stop execution. Generally | 133 // A pc value used to signal the simulator to stop execution. Generally |
| 139 // the lr is set to this value on transition from native C code to | 134 // the lr is set to this value on transition from native C code to |
| 140 // simulated execution, so that the simulator can "return" to the native | 135 // simulated execution, so that the simulator can "return" to the native |
| 141 // C code. | 136 // C code. |
| 142 static const uword kEndSimulatingPC = -2; | 137 static const uword kEndSimulatingPC = -2; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 268 } |
| 274 | 269 |
| 275 friend class SimulatorDebugger; | 270 friend class SimulatorDebugger; |
| 276 friend class SimulatorSetjmpBuffer; | 271 friend class SimulatorSetjmpBuffer; |
| 277 DISALLOW_COPY_AND_ASSIGN(Simulator); | 272 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 278 }; | 273 }; |
| 279 | 274 |
| 280 } // namespace dart | 275 } // namespace dart |
| 281 | 276 |
| 282 #endif // RUNTIME_VM_SIMULATOR_ARM64_H_ | 277 #endif // RUNTIME_VM_SIMULATOR_ARM64_H_ |
| OLD | NEW |