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

Unified Diff: src/mips/assembler-mips.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.h
diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h
index 6403f06e57a2e9c9d75609b6c47a7da1c8587f85..e4b60c1d244676488a9b8bc11e759de3595e2e4e 100644
--- a/src/mips/assembler-mips.h
+++ b/src/mips/assembler-mips.h
@@ -439,6 +439,8 @@ class Operand BASE_EMBEDDED {
Register rm() const { return rm_; }
+ RelocInfo::Mode rmode() const { return rmode_; }
+
private:
Register rm_;
int32_t imm32_; // Valid if rm_ == no_reg.
@@ -594,10 +596,19 @@ class Assembler : public AssemblerBase {
inline static void deserialization_set_special_target_at(
Isolate* isolate, Address instruction_payload, Code* code,
Address target) {
- set_target_address_at(
- isolate,
- instruction_payload - kInstructionsFor32BitConstant * kInstrSize, code,
- target);
+ if (IsMipsArchVariant(kMips32r6)) {
+ // On R6 the address location is shifted by one instruction
+ set_target_address_at(
+ isolate,
+ instruction_payload -
+ (kInstructionsFor32BitConstant - 1) * kInstrSize,
dusan.simicic 2017/04/24 14:48:56 If you changed this constant expression for R6 in
+ code, target);
+ } else {
+ set_target_address_at(
+ isolate,
+ instruction_payload - kInstructionsFor32BitConstant * kInstrSize,
+ code, target);
+ }
}
// This sets the internal reference at the pc.
@@ -628,7 +639,7 @@ class Assembler : public AssemblerBase {
// Distance between the instruction referring to the address of the call
// target and the return address.
#ifdef _MIPS_ARCH_MIPS32R6
- static constexpr int kCallTargetAddressOffset = 3 * kInstrSize;
+ static constexpr int kCallTargetAddressOffset = 2 * kInstrSize;
#else
static constexpr int kCallTargetAddressOffset = 4 * kInstrSize;
#endif

Powered by Google App Engine
This is Rietveld 408576698