Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
MIPS: Fix trampoline pool handling in MacroAssembler::BranchShort() f…
Browse files Browse the repository at this point in the history
…or r6.

BUG=chromium:555543
LOG=N

Review URL: https://codereview.chromium.org/1446343002

Cr-Commit-Position: refs/heads/master@{#32094}
  • Loading branch information
balazs.kilvady authored and Commit bot committed Nov 18, 2015
1 parent eb8a423 commit c91bcf7
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 261 deletions.
8 changes: 7 additions & 1 deletion src/mips/assembler-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1367,10 +1367,12 @@ void Assembler::bgezalc(Register rt, int16_t offset) {


void Assembler::bgezall(Register rs, int16_t offset) {
DCHECK(IsMipsArchVariant(kMips32r6));
DCHECK(!IsMipsArchVariant(kMips32r6));
DCHECK(!(rs.is(zero_reg)));
BlockTrampolinePoolScope block_trampoline_pool(this);
positions_recorder()->WriteRecordedPositions();
GenInstrImmediate(REGIMM, rs, BGEZALL, offset);
BlockTrampolinePoolFor(1); // For associated delay slot.
}


Expand Down Expand Up @@ -1453,7 +1455,9 @@ void Assembler::j(int32_t target) {
(kImm26Bits + kImmFieldShift)) == 0;
DCHECK(in_range && ((target & 3) == 0));
#endif
BlockTrampolinePoolScope block_trampoline_pool(this);
GenInstrJump(J, (target >> 2) & kImm26Mask);
BlockTrampolinePoolFor(1); // For associated delay slot.
}


Expand All @@ -1479,8 +1483,10 @@ void Assembler::jal(int32_t target) {
(kImm26Bits + kImmFieldShift)) == 0;
DCHECK(in_range && ((target & 3) == 0));
#endif
BlockTrampolinePoolScope block_trampoline_pool(this);
positions_recorder()->WriteRecordedPositions();
GenInstrJump(JAL, (target >> 2) & kImm26Mask);
BlockTrampolinePoolFor(1); // For associated delay slot.
}


Expand Down
3 changes: 2 additions & 1 deletion src/mips/assembler-mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,8 @@ class Assembler : public AssemblerBase {
return block_buffer_growth_;
}

inline void CheckTrampolinePoolQuick(int extra_instructions = 0);

private:
inline static void set_target_internal_reference_encoded_at(Address pc,
Address target);
Expand Down Expand Up @@ -1258,7 +1260,6 @@ class Assembler : public AssemblerBase {
void GrowBuffer();
inline void emit(Instr x,
CompactBranchType is_compact_branch = CompactBranchType::NO);
inline void CheckTrampolinePoolQuick(int extra_instructions = 0);

// Instruction generation.
// We have 3 different kind of encoding layout on MIPS.
Expand Down
Loading

0 comments on commit c91bcf7

Please sign in to comment.