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 <[email protected]>
    Commit-Queue: Jakob Kummerow <[email protected]>
    Reviewed-by: Jakob Kummerow <[email protected]>
    Cr-Commit-Position: refs/heads/master@{#63988}

Refs: v8/v8@7889803

PR-URL: #34214
Fixes: #33703
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.