Skip to content

Commit 7889803

Browse files
xwafishCommit Bot
authored andcommitted
[mips] Use t9 as the function call register.
on mips, we should use t9 when jump to a ExternalReference, because the callee function will consider t9 as the function start address. Change-Id: I56e2bf073fd24b2f3434dfd255d48264bfd0b2cd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1826417 Auto-Submit: Yu Yin <xwafish@gmail.com> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#63988}
1 parent cae9aae commit 7889803

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/codegen/mips/macro-assembler-mips.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,10 +3853,8 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
38533853
}
38543854

38553855
void TurboAssembler::Jump(const ExternalReference& reference) {
3856-
UseScratchRegisterScope temps(this);
3857-
Register scratch = temps.Acquire();
3858-
li(scratch, reference);
3859-
Jump(scratch);
3856+
li(t9, reference);
3857+
Jump(t9);
38603858
}
38613859

38623860
void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit,

src/codegen/mips64/macro-assembler-mips64.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4202,10 +4202,8 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
42024202
}
42034203

42044204
void TurboAssembler::Jump(const ExternalReference& reference) {
4205-
UseScratchRegisterScope temps(this);
4206-
Register scratch = temps.Acquire();
4207-
li(scratch, reference);
4208-
Jump(scratch);
4205+
li(t9, reference);
4206+
Jump(t9);
42094207
}
42104208

42114209
// Note: To call gcc-compiled C code on mips, you must call through t9.

0 commit comments

Comments
 (0)