Index: src/mips64/simulator-mips64.h |
diff --git a/src/mips64/simulator-mips64.h b/src/mips64/simulator-mips64.h |
index 4c67eff6636cc4d7fa7d087166fb7d951871f7d5..9627a37fb759b62644ace8a3673b51c61d98eab3 100644 |
--- a/src/mips64/simulator-mips64.h |
+++ b/src/mips64/simulator-mips64.h |
@@ -391,6 +391,18 @@ class Simulator { |
// Used for breakpoints and traps. |
void SoftwareInterrupt(Instruction* instr); |
+ // Compact branch guard. |
+ void CheckForbiddenSlot(int64_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__, |
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.
|
+ "Error: Unexpected instruction 0x%08x immediately after a " |
+ "compact branch instruction.", |
+ *reinterpret_cast<uint32_t*>(instr_aftter_compact_branch)); |
+ } |
+ } |
+ |
// Stop helper functions. |
bool IsWatchpoint(uint64_t code); |
void PrintWatchpoint(uint64_t code); |