OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 // Declares a Simulator for MIPS instructions if we are not generating a native | 6 // Declares a Simulator for MIPS instructions if we are not generating a native |
7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation | 7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation |
8 // on regular desktop machines. | 8 // on regular desktop machines. |
9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
10 // which will start execution in the Simulator or forwards to the real entry | 10 // which will start execution in the Simulator or forwards to the real entry |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 class SimInstruction : public InstructionGetters<SimInstructionBase> { | 143 class SimInstruction : public InstructionGetters<SimInstructionBase> { |
144 public: | 144 public: |
145 SimInstruction() {} | 145 SimInstruction() {} |
146 | 146 |
147 explicit SimInstruction(Instruction* instr) { *this = instr; } | 147 explicit SimInstruction(Instruction* instr) { *this = instr; } |
148 | 148 |
149 SimInstruction& operator=(Instruction* instr) { | 149 SimInstruction& operator=(Instruction* instr) { |
150 operand_ = *reinterpret_cast<const int32_t*>(instr); | 150 operand_ = *reinterpret_cast<const int32_t*>(instr); |
151 instr_ = instr; | 151 instr_ = instr; |
152 type_ = InstructionBase::InstructionType(EXTRA); | 152 type_ = InstructionBase::InstructionType(); |
153 DCHECK(reinterpret_cast<void*>(&operand_) == this); | 153 DCHECK(reinterpret_cast<void*>(&operand_) == this); |
154 return *this; | 154 return *this; |
155 } | 155 } |
156 }; | 156 }; |
157 | 157 |
158 class Simulator { | 158 class Simulator { |
159 public: | 159 public: |
160 friend class MipsDebugger; | 160 friend class MipsDebugger; |
161 | 161 |
162 // Registers are declared in order. See SMRL chapter 2. | 162 // Registers are declared in order. See SMRL chapter 2. |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 static inline void UnregisterCTryCatch(Isolate* isolate) { | 551 static inline void UnregisterCTryCatch(Isolate* isolate) { |
552 Simulator::current(isolate)->PopAddress(); | 552 Simulator::current(isolate)->PopAddress(); |
553 } | 553 } |
554 }; | 554 }; |
555 | 555 |
556 } // namespace internal | 556 } // namespace internal |
557 } // namespace v8 | 557 } // namespace v8 |
558 | 558 |
559 #endif // !defined(USE_SIMULATOR) | 559 #endif // !defined(USE_SIMULATOR) |
560 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 560 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |