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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 set_register(rd_reg, alu_out); | 384 set_register(rd_reg, alu_out); |
385 TraceRegWr(alu_out); | 385 TraceRegWr(alu_out); |
386 } | 386 } |
387 | 387 |
388 void DecodeTypeImmediate(Instruction* instr); | 388 void DecodeTypeImmediate(Instruction* instr); |
389 void DecodeTypeJump(Instruction* instr); | 389 void DecodeTypeJump(Instruction* instr); |
390 | 390 |
391 // Used for breakpoints and traps. | 391 // Used for breakpoints and traps. |
392 void SoftwareInterrupt(Instruction* instr); | 392 void SoftwareInterrupt(Instruction* instr); |
393 | 393 |
394 // Compact branch guard. | |
395 void CheckForbiddenSlot(int64_t current_pc) { | |
396 Instruction* instr_aftter_compact_branch = | |
397 reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize); | |
398 if (instr_aftter_compact_branch->IsForbiddenInBranchDelay()) { | |
399 V8_Fatal(__FILE__, __LINE__, | |
balazs.kilvady
2015/12/18 19:18:05
I think we should change the function name from 'I
ivica.bogosavljevic
2015/12/22 10:22:40
Agree. Maybe we should have it IsForbiddenAfterBra
balazs.kilvady
2015/12/22 11:01:56
We can use the same function for r6 compact branch
ivica.bogosavljevic
2015/12/22 12:23:41
Acknowledged.
| |
400 "Error: Unexpected instruction 0x%08x immediately after a " | |
401 "compact branch instruction.", | |
402 *reinterpret_cast<uint32_t*>(instr_aftter_compact_branch)); | |
403 } | |
404 } | |
405 | |
394 // Stop helper functions. | 406 // Stop helper functions. |
395 bool IsWatchpoint(uint64_t code); | 407 bool IsWatchpoint(uint64_t code); |
396 void PrintWatchpoint(uint64_t code); | 408 void PrintWatchpoint(uint64_t code); |
397 void HandleStop(uint64_t code, Instruction* instr); | 409 void HandleStop(uint64_t code, Instruction* instr); |
398 bool IsStopInstruction(Instruction* instr); | 410 bool IsStopInstruction(Instruction* instr); |
399 bool IsEnabledStop(uint64_t code); | 411 bool IsEnabledStop(uint64_t code); |
400 void EnableStop(uint64_t code); | 412 void EnableStop(uint64_t code); |
401 void DisableStop(uint64_t code); | 413 void DisableStop(uint64_t code); |
402 void IncreaseStopCounter(uint64_t code); | 414 void IncreaseStopCounter(uint64_t code); |
403 void PrintStopInfo(uint64_t code); | 415 void PrintStopInfo(uint64_t code); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 static inline void UnregisterCTryCatch(Isolate* isolate) { | 549 static inline void UnregisterCTryCatch(Isolate* isolate) { |
538 Simulator::current(isolate)->PopAddress(); | 550 Simulator::current(isolate)->PopAddress(); |
539 } | 551 } |
540 }; | 552 }; |
541 | 553 |
542 } // namespace internal | 554 } // namespace internal |
543 } // namespace v8 | 555 } // namespace v8 |
544 | 556 |
545 #endif // !defined(USE_SIMULATOR) | 557 #endif // !defined(USE_SIMULATOR) |
546 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 558 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |