Skip to content

Commit

Permalink
deps: V8: cherry-pick 7889803e82d3
Browse files Browse the repository at this point in the history
Original commit message:

    [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}

Refs: v8/v8@7889803

PR-URL: #34214
Fixes: #33703
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
zjiaz authored and BethGriggs committed Sep 15, 2020
1 parent 79c4c73 commit 60b697d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -34,7 +34,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.39',
'v8_embedder_string': '-node.40',

##### V8 defaults for Node.js #####

Expand Down
6 changes: 2 additions & 4 deletions deps/v8/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 deps/v8/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 60b697d

Please sign in to comment.