Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: src/mips/assembler-mips-inl.h

Issue 2542403002: MIPS: Use JIC/JIALC offset when possible (Closed)
Patch Set: Fix deserialization problem, rebase to master Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/mips/assembler-mips-inl.h
diff --git a/src/mips/assembler-mips-inl.h b/src/mips/assembler-mips-inl.h
index 215c0efd886a9e782036dcafd5d3001e0ad76e5d..c843cc8663e61db90fc3e123b642c556ed98da08 100644
--- a/src/mips/assembler-mips-inl.h
+++ b/src/mips/assembler-mips-inl.h
@@ -121,8 +121,17 @@ Address RelocInfo::target_address_address() {
// place, ready to be patched with the target. After jump optimization,
// that is the address of the instruction that follows J/JAL/JR/JALR
// instruction.
- return reinterpret_cast<Address>(
- pc_ + Assembler::kInstructionsFor32BitConstant * Assembler::kInstrSize);
+ if (IsMipsArchVariant(kMips32r6)) {
+ // On R6 we don't move to the end of the instructions to be patched, but one
+ // instruction before, because if these instructions are at the end of the
+ // code object it can cause errors in the deserializer.
+ return reinterpret_cast<Address>(
+ pc_ +
+ (Assembler::kInstructionsFor32BitConstant - 1) * Assembler::kInstrSize);
+ } else {
+ return reinterpret_cast<Address>(
+ pc_ + Assembler::kInstructionsFor32BitConstant * Assembler::kInstrSize);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698