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

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

Issue 1830133002: MIPS64: Replace JR/JALR with JIC/JIALC for r6. (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/mips64/assembler-mips64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7276e98deaddd78c674e3a0f58cd8279e467b36b 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -4062,7 +4062,9 @@ 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 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);
@@ -4092,7 +4094,6 @@ void BackEdgeTable::PatchAt(Code* unoptimized_code,
patcher.masm()->daddiu(at, zero_reg, 1);
break;
}
- Address 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 +4109,11 @@ BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState(
Code* unoptimized_code,
Address pc) {
static const int kInstrSize = Assembler::kInstrSize;
- Address branch_address = pc - 8 * kInstrSize;
-#ifdef DEBUG
- Address pc_immediate_load_address = pc - 6 * 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 - 7 * kInstrSize)));
+ DCHECK(Assembler::IsBeq(Assembler::instr_at(branch_address + kInstrSize)));
if (!Assembler::IsAddImmediate(Assembler::instr_at(branch_address))) {
DCHECK(reinterpret_cast<uint64_t>(
Assembler::target_address_at(pc_immediate_load_address)) ==
« no previous file with comments | « no previous file | src/mips64/assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698