Index: src/mips/simulator-mips.h |
diff --git a/src/mips/simulator-mips.h b/src/mips/simulator-mips.h |
index 796d08fc2700c351465ac26635a1df8fbd231b27..624d4acf8094936fbce5b2ad08eb9a3afe3af18d 100644 |
--- a/src/mips/simulator-mips.h |
+++ b/src/mips/simulator-mips.h |
@@ -315,6 +315,7 @@ class Simulator { |
void DecodeTypeRegisterLRsType(); |
Instruction* currentInstr_; |
+ |
inline Instruction* get_instr() const { return currentInstr_; } |
inline void set_instr(Instruction* instr) { currentInstr_ = instr; } |
@@ -346,6 +347,18 @@ class Simulator { |
// Used for breakpoints and traps. |
void SoftwareInterrupt(Instruction* instr); |
+ // Compact branch guard. |
+ void CheckForbiddenSlot(int32_t current_pc) { |
+ Instruction* instr_aftter_compact_branch = |
+ reinterpret_cast<Instruction*>(current_pc + Instruction::kInstrSize); |
+ if (instr_aftter_compact_branch->IsForbiddenInBranchDelay()) { |
+ V8_Fatal(__FILE__, __LINE__, |
+ "Error: Unexpected instruction 0x%08x immediately after a " |
+ "compact branch instruction.", |
+ *reinterpret_cast<uint32_t*>(instr_aftter_compact_branch)); |
+ } |
+ } |
+ |
// Stop helper functions. |
bool IsWatchpoint(uint32_t code); |
void PrintWatchpoint(uint32_t code); |