Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick 1b471b796022 #47399

Merged
merged 1 commit into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.6',
'v8_embedder_string': '-node.7',

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

Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3976,8 +3976,12 @@ bool MacroAssembler::BranchShortHelper(int32_t offset, Label* L, Condition cond,
BlockTrampolinePoolScope block_trampoline_pool(this);
Register scratch = no_reg;
if (!rt.is_reg()) {
scratch = temps.Acquire();
li(scratch, rt);
if (rt.immediate() == 0) {
scratch = zero_reg;
} else {
scratch = temps.Acquire();
li(scratch, rt);
}
} else {
scratch = rt.rm();
}
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace internal {
* - s5 : Currently loaded character. Must be loaded using
* LoadCurrentCharacter before using any of the dispatch methods.
* - s6 : Points to tip of backtrack stack
* - s7 : End of input (points to byte after last character in input).
* - s8 : End of input (points to byte after last character in input).
* - fp : Frame pointer. Used to access arguments, local variables and
* RegExp registers.
* - sp : Points to tip of C stack.
Expand All @@ -38,7 +38,7 @@ namespace internal {
* --- sp when called ---
* - fp[72] ra Return from RegExp code (ra). kReturnAddress
* - fp[64] old-fp Old fp, callee saved(s9).
* - fp[0..63] s1..s78 Callee-saved registers fp..s7.
* - fp[0..63] s1..s11 Callee-saved registers fp..s11.
* --- frame pointer ----
* - fp[-8] frame marker
* - fp[-16] Isolate* isolate (address of the current isolate) kIsolate
Expand Down Expand Up @@ -672,8 +672,8 @@ Handle<HeapObject> RegExpMacroAssemblerRISCV::GetCode(Handle<String> source) {
// Order here should correspond to order of offset constants in header file.
// TODO(plind): we save fp..s11, but ONLY use s3 here - use the regs
// or dont save.
RegList registers_to_retain = {fp, s1, s2, s3, s4,
s5, s6, s7, s8 /*, s9, s10, s11*/};
RegList registers_to_retain = {fp, s1, s2, s3, s4, s5,
s6, s7, s8, s9, s10, s11};
DCHECK(registers_to_retain.Count() == kNumCalleeRegsToRetain);

// The remaining arguments are passed in registers, e.g.by calling the code
Expand Down Expand Up @@ -717,7 +717,7 @@ Handle<HeapObject> RegExpMacroAssemblerRISCV::GetCode(Handle<String> source) {

// Initialize backtrack stack pointer. It must not be clobbered from here
// on. Note the backtrack_stackpointer is callee-saved.
static_assert(backtrack_stackpointer() == s7);
static_assert(backtrack_stackpointer() == s8);
LoadRegExpStackPointerFromMemory(backtrack_stackpointer());
// Store the regexp base pointer - we'll later restore it / write it to
// memory when returning from this irregexp code object.
Expand Down
8 changes: 5 additions & 3 deletions deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerRISCV
static constexpr int kStoredRegistersOffset = kFramePointerOffset;
// Return address (stored from link register, read into pc on return).

// This 9 is 8 s-regs (s1..s8) plus fp.
static constexpr int kNumCalleeRegsToRetain = 9;
// This 9 is 8 s-regs (s1..s11) plus fp.
static constexpr int kNumCalleeRegsToRetain = 12;
static constexpr int kReturnAddressOffset =
kStoredRegistersOffset + kNumCalleeRegsToRetain * kSystemPointerSize;

Expand Down Expand Up @@ -187,7 +187,9 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerRISCV

// The register containing the backtrack stack top. Provides a meaningful
// name to the register.
static constexpr Register backtrack_stackpointer() { return s7; }
// s7 should not be used here because baseline sparkplug uses s7 as context
// register.
static constexpr Register backtrack_stackpointer() { return s8; }

// Register holding pointer to the current code object.
static constexpr Register code_pointer() { return s1; }
Expand Down