Skip to content

Commit

Permalink
[mips] Use t9 as the function call register.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
xwafish authored and Commit Bot committed Sep 26, 2019
1 parent cae9aae commit 7889803
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/codegen/mips/macro-assembler-mips.cc
Expand Up @@ -3853,10 +3853,8 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
}

void TurboAssembler::Jump(const ExternalReference& reference) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
li(scratch, reference);
Jump(scratch);
li(t9, reference);
Jump(t9);
}

void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit,
Expand Down
6 changes: 2 additions & 4 deletions src/codegen/mips64/macro-assembler-mips64.cc
Expand Up @@ -4202,10 +4202,8 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
}

void TurboAssembler::Jump(const ExternalReference& reference) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
li(scratch, reference);
Jump(scratch);
li(t9, reference);
Jump(t9);
}

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

0 comments on commit 7889803

Please sign in to comment.