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

Unified Diff: src/mips/code-stubs-mips.cc

Issue 1628453002: MIPS: Use PC realitive instructions on r6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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 | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index aab8d08e3141df0f1ef90bf6183138c58832398d..51162171a2ba992f1746a411cd65b60f650026f1 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -1125,20 +1125,21 @@ void CEntryStub::Generate(MacroAssembler* masm) {
// we can store the address on the stack to be able to find it again and
// we never have to restore it, because it will not change.
{ Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm);
- // This branch-and-link sequence is needed to find the current PC on mips,
- // saved to the ra register.
- // Use masm-> here instead of the double-underscore macro since extra
- // coverage code can interfere with the proper calculation of ra.
+ int kNumInstructionsToJump = 4;
Label find_ra;
- __ bal(&find_ra); // bal exposes branch delay slot.
- __ nop();
- __ bind(&find_ra);
-
// Adjust the value in ra to point to the correct return location, 2nd
// instruction past the real call into C code (the jalr(t9)), and push it.
// This is the return address of the exit frame.
- const int kNumInstructionsToJump = 5;
- __ Addu(ra, ra, kNumInstructionsToJump * kPointerSize);
+ if (kArchVariant >= kMips32r6) {
+ __ addiupc(ra, kNumInstructionsToJump + 1);
+ } else {
+ // This branch-and-link sequence is needed to find the current PC on mips
+ // before r6, saved to the ra register.
+ __ bal(&find_ra); // bal exposes branch delay slot.
+ __ Addu(ra, ra, kNumInstructionsToJump * Instruction::kInstrSize);
+ }
+ __ bind(&find_ra);
+
// This spot was reserved in EnterExitFrame.
__ sw(ra, MemOperand(sp, result_stack_size));
// Stack space reservation moved to the branch delay slot below.
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698