Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 void set_fregister(FRegister freg, int32_t value); | 43 void set_fregister(FRegister freg, int32_t value); |
| 44 void set_fregister_float(FRegister freg, float value); | 44 void set_fregister_float(FRegister freg, float value); |
| 45 void set_fregister_double(FRegister freg, double value); | 45 void set_fregister_double(FRegister freg, double value); |
| 46 void set_fregister_long(FRegister freg, int64_t value); | 46 void set_fregister_long(FRegister freg, int64_t value); |
| 47 | 47 |
| 48 int32_t get_fregister(FRegister freg) const; | 48 int32_t get_fregister(FRegister freg) const; |
| 49 float get_fregister_float(FRegister freg) const; | 49 float get_fregister_float(FRegister freg) const; |
| 50 double get_fregister_double(FRegister freg) const; | 50 double get_fregister_double(FRegister freg) const; |
| 51 int64_t get_fregister_long(FRegister freg) const; | 51 int64_t get_fregister_long(FRegister freg) const; |
| 52 | 52 |
| 53 void set_dregister(DRegister freg, int64_t value); | |
| 54 void set_dregister_double(DRegister freg, double value); | |
|
regis
2013/06/18 08:42:12
I would expect set_dregister to take a double. The
zra
2013/06/18 16:47:25
Done.
| |
| 55 | |
| 56 int64_t get_dregister(DRegister freg) const; | |
| 57 double get_dregister_double(DRegister freg) const; | |
|
regis
2013/06/18 08:42:12
ditto with return types.
zra
2013/06/18 16:47:25
Done.
| |
| 53 | 58 |
| 54 // Accessor for the pc. | 59 // Accessor for the pc. |
| 55 void set_pc(int32_t value) { pc_ = value; } | 60 void set_pc(int32_t value) { pc_ = value; } |
| 56 int32_t get_pc() const { return pc_; } | 61 int32_t get_pc() const { return pc_; } |
| 57 | 62 |
| 58 // Accessors for hi, lo registers. | 63 // Accessors for hi, lo registers. |
| 59 void set_hi_register(int32_t value) { hi_reg_ = value; } | 64 void set_hi_register(int32_t value) { hi_reg_ = value; } |
| 60 void set_lo_register(int32_t value) { lo_reg_ = value; } | 65 void set_lo_register(int32_t value) { lo_reg_ = value; } |
| 61 int32_t get_hi_register() const { return hi_reg_; } | 66 int32_t get_hi_register() const { return hi_reg_; } |
| 62 int32_t get_lo_register() const { return lo_reg_; } | 67 int32_t get_lo_register() const { return lo_reg_; } |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 88 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the | 93 // stack. The simulator's top_exit_frame_info refers to a C++ frame in the |
| 89 // native stack. | 94 // native stack. |
| 90 uword top_exit_frame_info() const { return top_exit_frame_info_; } | 95 uword top_exit_frame_info() const { return top_exit_frame_info_; } |
| 91 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } | 96 void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; } |
| 92 | 97 |
| 93 // Call on program start. | 98 // Call on program start. |
| 94 static void InitOnce(); | 99 static void InitOnce(); |
| 95 | 100 |
| 96 // Dart generally calls into generated code with 5 parameters. This is a | 101 // Dart generally calls into generated code with 5 parameters. This is a |
| 97 // convenience function, which sets up the simulator state and grabs the | 102 // convenience function, which sets up the simulator state and grabs the |
| 98 // result on return. | 103 // result on return. |
|
regis
2013/06/18 08:42:12
The comment should explain the fp_return parameter
zra
2013/06/18 16:47:25
Done.
| |
| 99 int64_t Call(int32_t entry, | 104 int64_t Call(int32_t entry, |
| 100 int32_t parameter0, | 105 int32_t parameter0, |
| 101 int32_t parameter1, | 106 int32_t parameter1, |
| 102 int32_t parameter2, | 107 int32_t parameter2, |
| 103 int32_t parameter3); | 108 int32_t parameter3, |
| 109 bool fp_return = false); | |
| 104 | 110 |
| 105 // Runtime and native call support. | 111 // Runtime and native call support. |
| 106 enum CallKind { | 112 enum CallKind { |
| 107 kRuntimeCall, | 113 kRuntimeCall, |
| 108 kLeafRuntimeCall, | 114 kLeafRuntimeCall, |
| 109 kNativeCall | 115 kNativeCall |
| 110 }; | 116 }; |
| 111 static uword RedirectExternalReference(uword function, CallKind call_kind); | 117 static uword RedirectExternalReference(uword function, CallKind call_kind); |
| 112 | 118 |
| 113 void Longjmp(uword pc, | 119 void Longjmp(uword pc, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 } | 204 } |
| 199 | 205 |
| 200 friend class SimulatorDebugger; | 206 friend class SimulatorDebugger; |
| 201 friend class SimulatorSetjmpBuffer; | 207 friend class SimulatorSetjmpBuffer; |
| 202 DISALLOW_COPY_AND_ASSIGN(Simulator); | 208 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 203 }; | 209 }; |
| 204 | 210 |
| 205 } // namespace dart | 211 } // namespace dart |
| 206 | 212 |
| 207 #endif // VM_SIMULATOR_MIPS_H_ | 213 #endif // VM_SIMULATOR_MIPS_H_ |
| OLD | NEW |