Commit d8a958f5 authored by Ivica Bogosavljevic's avatar Ivica Bogosavljevic Committed by Commit Bot

MIPSR6: Fix compilation failure due to missing instruction patching

On MIPS32R6, instruction JIC and JIALC where not properly
patched and this caused compilation failure in snapshot
generating phase

Change-Id: I29d8323faf22f825116e295cd2a2d55e714e61ed
Reviewed-on: https://chromium-review.googlesource.com/c/1314118Reviewed-by: 's avatarSreten Kovacevic <skovacevic@wavecomp.com>
Commit-Queue: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Cr-Commit-Position: refs/heads/master@{#57216}
parent c1215df6
...@@ -281,12 +281,13 @@ Handle<Code> Assembler::relative_code_target_object_handle_at( ...@@ -281,12 +281,13 @@ Handle<Code> Assembler::relative_code_target_object_handle_at(
Address pc) const { Address pc) const {
Instr instr1 = instr_at(pc); Instr instr1 = instr_at(pc);
Instr instr2 = instr_at(pc + kInstrSize); Instr instr2 = instr_at(pc + kInstrSize);
DCHECK(IsLui(instr1));
DCHECK(IsOri(instr2) || IsNal(instr2));
DCHECK(IsNal(instr2) || IsNal(instr_at(pc - kInstrSize)));
if (IsNal(instr2)) { if (IsNal(instr2)) {
instr2 = instr_at(pc + 2 * kInstrSize); instr2 = instr_at(pc + 2 * kInstrSize);
} }
// Interpret 2 instructions generated by li (lui/ori). // Interpret 2 instructions generated by li (lui/ori).
DCHECK(IsLui(instr1));
DCHECK(IsOri(instr2));
int code_target_index = GetLuiOriImmediate(instr1, instr2); int code_target_index = GetLuiOriImmediate(instr1, instr2);
return GetCodeTarget(code_target_index); return GetCodeTarget(code_target_index);
} }
......
...@@ -4104,6 +4104,8 @@ void Assembler::set_target_value_at(Address pc, uint32_t target, ...@@ -4104,6 +4104,8 @@ void Assembler::set_target_value_at(Address pc, uint32_t target,
instr1 |= lui_offset; instr1 |= lui_offset;
instr2 |= jic_offset; instr2 |= jic_offset;
instr_at_put(pc, instr1);
instr_at_put(pc + kInstrSize, instr2);
} else { } else {
Instr instr3 = instr_at(pc + 2 * kInstrSize); Instr instr3 = instr_at(pc + 2 * kInstrSize);
// If we are using relative calls/jumps for builtins. // If we are using relative calls/jumps for builtins.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment