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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return fcsr_ & (1 << cc); | 92 return fcsr_ & (1 << cc); |
93 } | 93 } |
94 | 94 |
95 // Accessors to the internal simulator stack base and top. | 95 // Accessors to the internal simulator stack base and top. |
96 uword StackBase() const { return reinterpret_cast<uword>(stack_); } | 96 uword StackBase() const { return reinterpret_cast<uword>(stack_); } |
97 uword StackTop() const; | 97 uword StackTop() const; |
98 | 98 |
99 // Accessor to the instruction counter. | 99 // Accessor to the instruction counter. |
100 uint64_t get_icount() const { return icount_; } | 100 uint64_t get_icount() const { return icount_; } |
101 | 101 |
102 // The isolate's top_exit_frame_info refers to a Dart frame in the simulator | 102 // The thread's top_exit_frame_info refers to a Dart frame in the simulator |
103 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the | 103 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the |
104 // native stack. | 104 // native stack. |
105 uword top_exit_frame_info() const { return top_exit_frame_info_; } | 105 uword top_exit_frame_info() const { return top_exit_frame_info_; } |
106 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } | 106 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } |
107 | 107 |
108 // Call on program start. | 108 // Call on program start. |
109 static void InitOnce(); | 109 static void InitOnce(); |
110 | 110 |
111 // Dart generally calls into generated code with 4 parameters. This is a | 111 // Dart generally calls into generated code with 4 parameters. This is a |
112 // convenience function, which sets up the simulator state and grabs the | 112 // convenience function, which sets up the simulator state and grabs the |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 friend class SimulatorDebugger; | 263 friend class SimulatorDebugger; |
264 friend class SimulatorSetjmpBuffer; | 264 friend class SimulatorSetjmpBuffer; |
265 DISALLOW_COPY_AND_ASSIGN(Simulator); | 265 DISALLOW_COPY_AND_ASSIGN(Simulator); |
266 }; | 266 }; |
267 | 267 |
268 } // namespace dart | 268 } // namespace dart |
269 | 269 |
270 #endif // VM_SIMULATOR_MIPS_H_ | 270 #endif // VM_SIMULATOR_MIPS_H_ |
OLD | NEW |