Index: src/mips64/assembler-mips64-inl.h |
diff --git a/src/mips64/assembler-mips64-inl.h b/src/mips64/assembler-mips64-inl.h |
index a824ee7fc13c7d38a63a40dd079319c960498e9b..71078352871a1284f3b6e637ab685fe750205078 100644 |
--- a/src/mips64/assembler-mips64-inl.h |
+++ b/src/mips64/assembler-mips64-inl.h |
@@ -438,20 +438,40 @@ void Assembler::CheckTrampolinePoolQuick(int extra_instructions) { |
} |
-void Assembler::emit(Instr x) { |
+void Assembler::emit(Instr x, CompactBranchType is_compact_branch) { |
if (!is_buffer_growth_blocked()) { |
CheckBuffer(); |
} |
+ if (IsPrevInstrCompactBranch()) { |
+ if (Instruction::IsForbiddenAfterBranchInstr(x)) { |
+ // Nop instruction to preceed a CTI in forbidden slot: |
+ Instr nop = SPECIAL | SLL; |
+ *reinterpret_cast<Instr*>(pc_) = nop; |
+ pc_ += kInstrSize; |
+ } |
+ ClearCompactBranchState(); |
+ } |
*reinterpret_cast<Instr*>(pc_) = x; |
pc_ += kInstrSize; |
+ if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) { |
+ EmittedCompactBranchInstruction(); |
+ } |
CheckTrampolinePoolQuick(); |
} |
-void Assembler::emit(uint64_t x) { |
+void Assembler::emit(uint64_t x, CompactBranchType is_compact_branch) { |
if (!is_buffer_growth_blocked()) { |
CheckBuffer(); |
} |
+ if (IsPrevInstrCompactBranch()) { |
+ // Nop instruction to preceed a CTI in forbidden slot: |
Ilija.Pavlovic1
2015/12/18 11:38:22
Missing check IsForbiddenAfterBranchInstr(x)?
balazs.kilvady
2015/12/18 19:18:05
Also when we emitting a 64-bit value that is not a
ivica.bogosavljevic
2015/12/22 10:22:39
There is no need for IsForbiddenAfterBranchInstr(x
balazs.kilvady
2015/12/22 11:01:55
I guess in this case the CPU could not know if the
balazs.kilvady
2016/01/04 13:38:39
I still miss Instruction::IsForbiddenAfterBranchI
|
+ Instr nop = SPECIAL | SLL; |
+ *reinterpret_cast<Instr*>(pc_) = nop; |
+ pc_ += kInstrSize; |
+ |
+ ClearCompactBranchState(); |
+ } |
*reinterpret_cast<uint64_t*>(pc_) = x; |
pc_ += kInstrSize * 2; |
Ilija.Pavlovic1
2015/12/18 11:38:22
Missing check is_compact_branch == COMPACT_BRANCH
balazs.kilvady
2015/12/18 19:18:05
A 64-bit value cannot be a real instruction so it
ivica.bogosavljevic
2015/12/22 10:22:39
Acknowledged.
ivica.bogosavljevic
2015/12/22 10:22:39
Done.
|
CheckTrampolinePoolQuick(); |