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 MIPS instructions if we are not generating a native | 5 // Declares a Simulator for MIPS instructions if we are not generating a native |
6 // MIPS binary. This Simulator allows us to run and debug MIPS code generation | 6 // MIPS binary. This Simulator allows us to run and debug MIPS 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 MIPS HW platform. | 10 // on a MIPS HW platform. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 bool test_fcsr_bit(uint32_t cc) { | 86 bool test_fcsr_bit(uint32_t cc) { |
87 return fcsr_ & (1 << cc); | 87 return fcsr_ & (1 << cc); |
88 } | 88 } |
89 | 89 |
90 // Accessor to the internal simulator stack top. | 90 // Accessor to the internal simulator stack top. |
91 uword StackTop() const; | 91 uword StackTop() const; |
92 | 92 |
93 // Accessor to the instruction counter. | 93 // Accessor to the instruction counter. |
94 intptr_t get_icount() const { return icount_; } | 94 uint64_t get_icount() const { return icount_; } |
95 | 95 |
96 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator | 96 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator |
97 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the | 97 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the |
98 // native stack. | 98 // native stack. |
99 uword top_exit_frame_info() const { return top_exit_frame_info_; } | 99 uword top_exit_frame_info() const { return top_exit_frame_info_; } |
100 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } | 100 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } |
101 | 101 |
102 // Call on program start. | 102 // Call on program start. |
103 static void InitOnce(); | 103 static void InitOnce(); |
104 | 104 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 int32_t hi_reg_; | 152 int32_t hi_reg_; |
153 int32_t lo_reg_; | 153 int32_t lo_reg_; |
154 | 154 |
155 int32_t registers_[kNumberOfCpuRegisters]; | 155 int32_t registers_[kNumberOfCpuRegisters]; |
156 int32_t fregisters_[kNumberOfFRegisters]; | 156 int32_t fregisters_[kNumberOfFRegisters]; |
157 int32_t fcsr_; | 157 int32_t fcsr_; |
158 uword pc_; | 158 uword pc_; |
159 | 159 |
160 // Simulator support. | 160 // Simulator support. |
161 char* stack_; | 161 char* stack_; |
162 intptr_t icount_; | 162 uint64_t icount_; |
163 bool delay_slot_; | 163 bool delay_slot_; |
164 SimulatorSetjmpBuffer* last_setjmp_buffer_; | 164 SimulatorSetjmpBuffer* last_setjmp_buffer_; |
165 uword top_exit_frame_info_; | 165 uword top_exit_frame_info_; |
166 | 166 |
167 // Registered breakpoints. | 167 // Registered breakpoints. |
168 Instr* break_pc_; | 168 Instr* break_pc_; |
169 int32_t break_instr_; | 169 int32_t break_instr_; |
170 | 170 |
171 // Illegal memory access support. | 171 // Illegal memory access support. |
172 static bool IsIllegalAddress(uword addr) { | 172 static bool IsIllegalAddress(uword addr) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 friend class SimulatorDebugger; | 255 friend class SimulatorDebugger; |
256 friend class SimulatorSetjmpBuffer; | 256 friend class SimulatorSetjmpBuffer; |
257 DISALLOW_COPY_AND_ASSIGN(Simulator); | 257 DISALLOW_COPY_AND_ASSIGN(Simulator); |
258 }; | 258 }; |
259 | 259 |
260 } // namespace dart | 260 } // namespace dart |
261 | 261 |
262 #endif // VM_SIMULATOR_MIPS_H_ | 262 #endif // VM_SIMULATOR_MIPS_H_ |
OLD | NEW |