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

Unified Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1807263003: MIPS: Replace JR/JALR with JIC/JIALC for r6 part 2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | src/mips/assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips/full-codegen-mips.cc
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc
index 05c851e925a5fc87ceaa08809a41372bb9e8a45a..9db39547e5b906f2b6c612117f08debe073187d5 100644
--- a/src/full-codegen/mips/full-codegen-mips.cc
+++ b/src/full-codegen/mips/full-codegen-mips.cc
@@ -4058,7 +4058,9 @@ void BackEdgeTable::PatchAt(Code* unoptimized_code,
BackEdgeState target_state,
Code* replacement_code) {
static const int kInstrSize = Assembler::kInstrSize;
- Address branch_address = pc - 6 * kInstrSize;
+ Address pc_immediate_load_address =
+ Assembler::target_address_from_return_address(pc);
+ Address branch_address = pc_immediate_load_address - 2 * kInstrSize;
Isolate* isolate = unoptimized_code->GetIsolate();
CodePatcher patcher(isolate, branch_address, 1);
@@ -4084,7 +4086,6 @@ void BackEdgeTable::PatchAt(Code* unoptimized_code,
patcher.masm()->addiu(at, zero_reg, 1);
break;
}
- Address pc_immediate_load_address = pc - 4 * kInstrSize;
// Replace the stack check address in the load-immediate (lui/ori pair)
// with the entry address of the replacement code.
Assembler::set_target_address_at(isolate, pc_immediate_load_address,
@@ -4100,12 +4101,11 @@ BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState(
Code* unoptimized_code,
Address pc) {
static const int kInstrSize = Assembler::kInstrSize;
- Address branch_address = pc - 6 * kInstrSize;
-#ifdef DEBUG
- Address pc_immediate_load_address = pc - 4 * kInstrSize;
-#endif
+ Address pc_immediate_load_address =
+ Assembler::target_address_from_return_address(pc);
+ Address branch_address = pc_immediate_load_address - 2 * kInstrSize;
- DCHECK(Assembler::IsBeq(Assembler::instr_at(pc - 5 * kInstrSize)));
+ DCHECK(Assembler::IsBeq(Assembler::instr_at(branch_address + kInstrSize)));
if (!Assembler::IsAddImmediate(Assembler::instr_at(branch_address))) {
DCHECK(reinterpret_cast<uint32_t>(
Assembler::target_address_at(pc_immediate_load_address)) ==
« no previous file with comments | « no previous file | src/mips/assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698