| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Call on program start. | 61 // Call on program start. |
| 62 static void InitOnce(); | 62 static void InitOnce(); |
| 63 | 63 |
| 64 // Dart generally calls into generated code with 5 parameters. This is a | 64 // Dart generally calls into generated code with 5 parameters. This is a |
| 65 // convenience function, which sets up the simulator state and grabs the | 65 // convenience function, which sets up the simulator state and grabs the |
| 66 // result on return. | 66 // result on return. |
| 67 int64_t Call(int32_t entry, | 67 int64_t Call(int32_t entry, |
| 68 int32_t parameter0, | 68 int32_t parameter0, |
| 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 int32_t parameter4); | |
| 73 | 72 |
| 74 // Implementation of atomic compare and exchange in the same synchronization | 73 // Implementation of atomic compare and exchange in the same synchronization |
| 75 // domain as other synchronization primitive instructions (e.g. ldrex, strex). | 74 // domain as other synchronization primitive instructions (e.g. ldrex, strex). |
| 76 static uword CompareExchange(uword* address, | 75 static uword CompareExchange(uword* address, |
| 77 uword compare_value, | 76 uword compare_value, |
| 78 uword new_value); | 77 uword new_value); |
| 79 | 78 |
| 80 // Runtime call support. | 79 // Runtime call support. |
| 81 static uword RedirectExternalReference(uword function, | 80 static uword RedirectExternalReference(uword function, |
| 82 uint32_t argument_count); | 81 uint32_t argument_count); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 107 }; | 106 }; |
| 108 bool fp_n_flag_; | 107 bool fp_n_flag_; |
| 109 bool fp_z_flag_; | 108 bool fp_z_flag_; |
| 110 bool fp_c_flag_; | 109 bool fp_c_flag_; |
| 111 bool fp_v_flag_; | 110 bool fp_v_flag_; |
| 112 | 111 |
| 113 // Simulator support. | 112 // Simulator support. |
| 114 char* stack_; | 113 char* stack_; |
| 115 bool pc_modified_; | 114 bool pc_modified_; |
| 116 int icount_; | 115 int icount_; |
| 117 static bool flag_trace_sim_; | |
| 118 static int32_t flag_stop_sim_at_; | 116 static int32_t flag_stop_sim_at_; |
| 119 SimulatorSetjmpBuffer* last_setjmp_buffer_; | 117 SimulatorSetjmpBuffer* last_setjmp_buffer_; |
| 120 | 118 |
| 121 // Registered breakpoints. | 119 // Registered breakpoints. |
| 122 Instr* break_pc_; | 120 Instr* break_pc_; |
| 123 int32_t break_instr_; | 121 int32_t break_instr_; |
| 124 | 122 |
| 125 // Illegal memory access support. | 123 // Illegal memory access support. |
| 126 static bool IsIllegalAddress(uword addr) { | 124 static bool IsIllegalAddress(uword addr) { |
| 127 return addr < 64*1024; | 125 return addr < 64*1024; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 221 } |
| 224 | 222 |
| 225 friend class SimulatorDebugger; | 223 friend class SimulatorDebugger; |
| 226 friend class SimulatorSetjmpBuffer; | 224 friend class SimulatorSetjmpBuffer; |
| 227 DISALLOW_COPY_AND_ASSIGN(Simulator); | 225 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 228 }; | 226 }; |
| 229 | 227 |
| 230 } // namespace dart | 228 } // namespace dart |
| 231 | 229 |
| 232 #endif // VM_SIMULATOR_ARM_H_ | 230 #endif // VM_SIMULATOR_ARM_H_ |
| OLD | NEW |