Index: src/full-codegen/mips64/full-codegen-mips64.cc |
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc |
index a37586440af0f588195d2c061c91a64324cadbbc..07471a0e1c89d0fe7532f50a7e24031682aa847d 100644 |
--- a/src/full-codegen/mips64/full-codegen-mips64.cc |
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc |
@@ -4062,7 +4062,12 @@ void BackEdgeTable::PatchAt(Code* unoptimized_code, |
BackEdgeState target_state, |
Code* replacement_code) { |
static const int kInstrSize = Assembler::kInstrSize; |
- Address branch_address = pc - 8 * kInstrSize; |
+ Address branch_address; |
+ if (kArchVariant == kMips64r6) { |
+ branch_address = pc - 7 * kInstrSize; |
+ } else { |
+ branch_address = pc - 8 * kInstrSize; |
+ } |
balazs.kilvady
2016/03/24 17:03:10
Could you use the same constant-based solution her
miran.karic
2016/03/25 09:30:09
Yes, I was planing to do that the same way as for
|
Isolate* isolate = unoptimized_code->GetIsolate(); |
CodePatcher patcher(isolate, branch_address, 1); |
@@ -4092,7 +4097,12 @@ void BackEdgeTable::PatchAt(Code* unoptimized_code, |
patcher.masm()->daddiu(at, zero_reg, 1); |
break; |
} |
- Address pc_immediate_load_address = pc - 6 * kInstrSize; |
+ Address pc_immediate_load_address; |
+ if (kArchVariant == kMips64r6) { |
+ pc_immediate_load_address = pc - 5 * kInstrSize; |
+ } else { |
+ pc_immediate_load_address = pc - 6 * kInstrSize; |
+ } |
// Replace the stack check address in the load-immediate (6-instr sequence) |
// with the entry address of the replacement code. |
Assembler::set_target_address_at(isolate, pc_immediate_load_address, |
@@ -4108,12 +4118,24 @@ BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
Code* unoptimized_code, |
Address pc) { |
static const int kInstrSize = Assembler::kInstrSize; |
- Address branch_address = pc - 8 * kInstrSize; |
+ Address branch_address; |
+#ifdef DEBUG |
+ Address pc_immediate_load_address; |
+#endif |
+ if (kArchVariant == kMips64r6) { |
+ branch_address = pc - 7 * kInstrSize; |
#ifdef DEBUG |
- Address pc_immediate_load_address = pc - 6 * kInstrSize; |
+ pc_immediate_load_address = pc - 5 * kInstrSize; |
#endif |
+ DCHECK(Assembler::IsBeq(Assembler::instr_at(pc - 6 * kInstrSize))); |
+ } else { |
+ branch_address = pc - 8 * kInstrSize; |
+#ifdef DEBUG |
+ pc_immediate_load_address = pc - 6 * kInstrSize; |
+#endif |
+ DCHECK(Assembler::IsBeq(Assembler::instr_at(pc - 7 * kInstrSize))); |
+ } |
- DCHECK(Assembler::IsBeq(Assembler::instr_at(pc - 7 * kInstrSize))); |
if (!Assembler::IsAddImmediate(Assembler::instr_at(branch_address))) { |
DCHECK(reinterpret_cast<uint64_t>( |
Assembler::target_address_at(pc_immediate_load_address)) == |