Chromium Code Reviews| Index: src/mips/macro-assembler-mips.cc |
| diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
| index 56930699e5d8628db22b23cf1f9ff41bb7998865..6e99959660d00c36d53fd0164d281f802fdcded2 100644 |
| --- a/src/mips/macro-assembler-mips.cc |
| +++ b/src/mips/macro-assembler-mips.cc |
| @@ -4731,6 +4731,34 @@ void MacroAssembler::PatchRelocatedValue(Register li_location, |
| FlushICache(li_location, 2); |
| } |
| +void MacroAssembler::GetRelocatedValue(Register li_location, |
| + Register value, |
| + Register scratch) { |
| + lw(value, MemOperand(li_location)); |
| + if (emit_debug_code()) { |
| + And(value, value, kOpcodeMask); |
| + Check(eq, "The instruction to patch should be a lui.", |
|
Vyacheslav Egorov (Chromium)
2012/01/20 11:50:41
check message does not match function actions (I k
kalmard
2012/01/20 12:13:32
Done.
|
| + value, Operand(LUI)); |
| + lw(value, MemOperand(li_location)); |
| + } |
| + |
| + // value now holds a lui instruction. Extract the immediate. |
| + sll(value, value, kImm16Bits); |
| + |
| + lw(scratch, MemOperand(li_location, kInstrSize)); |
| + if (emit_debug_code()) { |
| + And(scratch, scratch, kOpcodeMask); |
| + Check(eq, "The instruction to patch should be an ori.", |
|
Vyacheslav Egorov (Chromium)
2012/01/20 11:50:41
check message does not match function actions (I k
kalmard
2012/01/20 12:13:32
Done.
|
| + scratch, Operand(ORI)); |
| + lw(scratch, MemOperand(li_location, kInstrSize)); |
| + } |
| + // "scratch" now holds an ori instruction. Extract the immediscratche. |
|
Vyacheslav Egorov (Chromium)
2012/01/20 11:50:41
immediscratche ?
kalmard
2012/01/20 12:13:32
A search and replace attempt gone horribly wrong.
|
| + andi(scratch, scratch, kImm16Mask); |
| + |
| + // Merge the results. |
| + or_(value, value, scratch); |
| +} |
| + |
| void MacroAssembler::CheckPageFlag( |
| Register object, |