Skip to content

Commit d6a9e93

Browse files
committed
deps: patch V8 to 10.2.154.13
Refs: v8/v8@10.2.154.4...10.2.154.13 PR-URL: #43727 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 7ffcd85 commit d6a9e93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+710
-280
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 10
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 154
14-
#define V8_PATCH_LEVEL 4
14+
#define V8_PATCH_LEVEL 13
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/builtins/arm/builtins-arm.cc

+17-6
Original file line numberDiff line numberDiff line change
@@ -2609,8 +2609,7 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
26092609
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
26102610
// The function index was put in a register by the jump table trampoline.
26112611
// Convert to Smi for the runtime call.
2612-
__ SmiTag(kWasmCompileLazyFuncIndexRegister,
2613-
kWasmCompileLazyFuncIndexRegister);
2612+
__ SmiTag(kWasmCompileLazyFuncIndexRegister);
26142613
{
26152614
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
26162615
FrameAndConstantPoolScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
@@ -2640,22 +2639,34 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
26402639
__ stm(db_w, sp, gp_regs);
26412640
__ vstm(db_w, sp, lowest_fp_reg, highest_fp_reg);
26422641

2643-
// Pass instance and function index as explicit arguments to the runtime
2642+
// Push the Wasm instance for loading the jump table address after the
2643+
// runtime call.
2644+
__ push(kWasmInstanceRegister);
2645+
2646+
// Push the Wasm instance again as an explicit argument to the runtime
26442647
// function.
26452648
__ push(kWasmInstanceRegister);
2649+
// Push the function index as second argument.
26462650
__ push(kWasmCompileLazyFuncIndexRegister);
26472651
// Initialize the JavaScript context with 0. CEntry will use it to
26482652
// set the current context on the isolate.
26492653
__ Move(cp, Smi::zero());
26502654
__ CallRuntime(Runtime::kWasmCompileLazy, 2);
2651-
// The entrypoint address is the return value.
2652-
__ mov(r8, kReturnRegister0);
2655+
// The runtime function returns the jump table slot offset as a Smi. Use
2656+
// that to compute the jump target in r8.
2657+
__ pop(kWasmInstanceRegister);
2658+
__ ldr(r8, MemOperand(
2659+
kWasmInstanceRegister,
2660+
WasmInstanceObject::kJumpTableStartOffset - kHeapObjectTag));
2661+
__ add(r8, r8, Operand::SmiUntag(kReturnRegister0));
2662+
// r8 now holds the jump table slot where we want to jump to in the end.
26532663

26542664
// Restore registers.
26552665
__ vldm(ia_w, sp, lowest_fp_reg, highest_fp_reg);
26562666
__ ldm(ia_w, sp, gp_regs);
26572667
}
2658-
// Finally, jump to the entrypoint.
2668+
2669+
// Finally, jump to the jump table slot for the function.
26592670
__ Jump(r8);
26602671
}
26612672

deps/v8/src/builtins/arm64/builtins-arm64.cc

+48-33
Original file line numberDiff line numberDiff line change
@@ -3018,41 +3018,50 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
30183018
// Sign extend and convert to Smi for the runtime call.
30193019
__ sxtw(kWasmCompileLazyFuncIndexRegister,
30203020
kWasmCompileLazyFuncIndexRegister.W());
3021-
__ SmiTag(kWasmCompileLazyFuncIndexRegister,
3022-
kWasmCompileLazyFuncIndexRegister);
3023-
3024-
UseScratchRegisterScope temps(masm);
3025-
{
3026-
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
3027-
FrameScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
3028-
3029-
// Save all parameter registers (see wasm-linkage.h). They might be
3030-
// overwritten in the runtime call below. We don't have any callee-saved
3031-
// registers in wasm, so no need to store anything else.
3032-
RegList gp_regs;
3021+
__ SmiTag(kWasmCompileLazyFuncIndexRegister);
3022+
3023+
// Compute register lists for parameters to be saved. We save all parameter
3024+
// registers (see wasm-linkage.h). They might be overwritten in the runtime
3025+
// call below. We don't have any callee-saved registers in wasm, so no need to
3026+
// store anything else.
3027+
constexpr RegList kSavedGpRegs = ([]() constexpr {
3028+
RegList saved_gp_regs;
30333029
for (Register gp_param_reg : wasm::kGpParamRegisters) {
3034-
gp_regs.set(gp_param_reg);
3030+
saved_gp_regs.set(gp_param_reg);
30353031
}
30363032
// Also push x1, because we must push multiples of 16 bytes (see
30373033
// {TurboAssembler::PushCPURegList}.
3038-
CHECK_EQ(1, gp_regs.Count() % 2);
3039-
gp_regs.set(x1);
3040-
CHECK_EQ(0, gp_regs.Count() % 2);
3034+
saved_gp_regs.set(x1);
3035+
// All set registers were unique.
3036+
CHECK_EQ(saved_gp_regs.Count(), arraysize(wasm::kGpParamRegisters) + 1);
3037+
// We push a multiple of 16 bytes.
3038+
CHECK_EQ(0, saved_gp_regs.Count() % 2);
3039+
// The Wasm instance must be part of the saved registers.
3040+
CHECK(saved_gp_regs.has(kWasmInstanceRegister));
3041+
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
3042+
saved_gp_regs.Count());
3043+
return saved_gp_regs;
3044+
})();
30413045

3042-
DoubleRegList fp_regs;
3046+
constexpr DoubleRegList kSavedFpRegs = ([]() constexpr {
3047+
DoubleRegList saved_fp_regs;
30433048
for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
3044-
fp_regs.set(fp_param_reg);
3049+
saved_fp_regs.set(fp_param_reg);
30453050
}
30463051

3047-
CHECK_EQ(gp_regs.Count(), arraysize(wasm::kGpParamRegisters) + 1);
3048-
CHECK_EQ(fp_regs.Count(), arraysize(wasm::kFpParamRegisters));
3049-
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
3050-
gp_regs.Count());
3052+
CHECK_EQ(saved_fp_regs.Count(), arraysize(wasm::kFpParamRegisters));
30513053
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedFpParamRegs,
3052-
fp_regs.Count());
3054+
saved_fp_regs.Count());
3055+
return saved_fp_regs;
3056+
})();
30533057

3054-
__ PushXRegList(gp_regs);
3055-
__ PushQRegList(fp_regs);
3058+
{
3059+
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
3060+
FrameScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
3061+
3062+
// Save registers that we need to keep alive across the runtime call.
3063+
__ PushXRegList(kSavedGpRegs);
3064+
__ PushQRegList(kSavedFpRegs);
30563065

30573066
// Pass instance and function index as explicit arguments to the runtime
30583067
// function.
@@ -3062,17 +3071,23 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
30623071
__ Mov(cp, Smi::zero());
30633072
__ CallRuntime(Runtime::kWasmCompileLazy, 2);
30643073

3065-
// Exclude x17 from the scope, there are hardcoded uses of it below.
3066-
temps.Exclude(x17);
3067-
3068-
// The entrypoint address is the return value.
3069-
__ Mov(x17, kReturnRegister0);
3074+
// Untag the returned Smi into into x17, for later use.
3075+
static_assert(!kSavedGpRegs.has(x17));
3076+
__ SmiUntag(x17, kReturnRegister0);
30703077

30713078
// Restore registers.
3072-
__ PopQRegList(fp_regs);
3073-
__ PopXRegList(gp_regs);
3079+
__ PopQRegList(kSavedFpRegs);
3080+
__ PopXRegList(kSavedGpRegs);
30743081
}
3075-
// Finally, jump to the entrypoint.
3082+
3083+
// The runtime function returned the jump table slot offset as a Smi (now in
3084+
// x17). Use that to compute the jump target.
3085+
static_assert(!kSavedGpRegs.has(x18));
3086+
__ ldr(x18, MemOperand(
3087+
kWasmInstanceRegister,
3088+
WasmInstanceObject::kJumpTableStartOffset - kHeapObjectTag));
3089+
__ add(x17, x18, Operand(x17));
3090+
// Finally, jump to the jump table slot for the function.
30763091
__ Jump(x17);
30773092
}
30783093

deps/v8/src/builtins/ia32/builtins-ia32.cc

+18-9
Original file line numberDiff line numberDiff line change
@@ -2878,20 +2878,28 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
28782878
offset += kSimd128Size;
28792879
}
28802880

2881-
// Push the Wasm instance as an explicit argument to WasmCompileLazy.
2881+
// Push the Wasm instance for loading the jump table address after the
2882+
// runtime call.
2883+
__ Push(kWasmInstanceRegister);
2884+
2885+
// Push the Wasm instance again as an explicit argument to the runtime
2886+
// function.
28822887
__ Push(kWasmInstanceRegister);
28832888
// Push the function index as second argument.
28842889
__ Push(kWasmCompileLazyFuncIndexRegister);
28852890
// Initialize the JavaScript context with 0. CEntry will use it to
28862891
// set the current context on the isolate.
28872892
__ Move(kContextRegister, Smi::zero());
2888-
{
2889-
// At this point, ebx has been spilled to the stack but is not yet
2890-
// overwritten with another value. We can still use it as kRootRegister.
2891-
__ CallRuntime(Runtime::kWasmCompileLazy, 2);
2892-
}
2893-
// The entrypoint address is the return value.
2894-
__ mov(edi, kReturnRegister0);
2893+
__ CallRuntime(Runtime::kWasmCompileLazy, 2);
2894+
// The runtime function returns the jump table slot offset as a Smi. Use
2895+
// that to compute the jump target in edi.
2896+
__ Pop(kWasmInstanceRegister);
2897+
__ mov(edi, MemOperand(kWasmInstanceRegister,
2898+
WasmInstanceObject::kJumpTableStartOffset -
2899+
kHeapObjectTag));
2900+
__ SmiUntag(kReturnRegister0);
2901+
__ add(edi, kReturnRegister0);
2902+
// edi now holds the jump table slot where we want to jump to in the end.
28952903

28962904
// Restore registers.
28972905
for (DoubleRegister reg : base::Reversed(wasm::kFpParamRegisters)) {
@@ -2904,7 +2912,8 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
29042912
__ Pop(reg);
29052913
}
29062914
}
2907-
// Finally, jump to the entrypoint.
2915+
2916+
// Finally, jump to the jump table slot for the function.
29082917
__ jmp(edi);
29092918
}
29102919

deps/v8/src/builtins/loong64/builtins-loong64.cc

+49-24
Original file line numberDiff line numberDiff line change
@@ -2648,37 +2648,50 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
26482648
// The function index was put in t0 by the jump table trampoline.
26492649
// Convert to Smi for the runtime call
26502650
__ SmiTag(kWasmCompileLazyFuncIndexRegister);
2651-
{
2652-
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
2653-
FrameScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
26542651

2655-
// Save all parameter registers (see wasm-linkage.h). They might be
2656-
// overwritten in the runtime call below. We don't have any callee-saved
2657-
// registers in wasm, so no need to store anything else.
2658-
RegList gp_regs;
2652+
// Compute register lists for parameters to be saved. We save all parameter
2653+
// registers (see wasm-linkage.h). They might be overwritten in the runtime
2654+
// call below. We don't have any callee-saved registers in wasm, so no need to
2655+
// store anything else.
2656+
constexpr RegList kSavedGpRegs = ([]() constexpr {
2657+
RegList saved_gp_regs;
26592658
for (Register gp_param_reg : wasm::kGpParamRegisters) {
2660-
gp_regs.set(gp_param_reg);
2659+
saved_gp_regs.set(gp_param_reg);
26612660
}
26622661

2663-
DoubleRegList fp_regs;
2662+
// All set registers were unique.
2663+
CHECK_EQ(saved_gp_regs.Count(), arraysize(wasm::kGpParamRegisters));
2664+
// The Wasm instance must be part of the saved registers.
2665+
CHECK(saved_gp_regs.has(kWasmInstanceRegister));
2666+
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
2667+
saved_gp_regs.Count());
2668+
return saved_gp_regs;
2669+
})();
2670+
2671+
constexpr DoubleRegList kSavedFpRegs = ([]() constexpr {
2672+
DoubleRegList saved_fp_regs;
26642673
for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
2665-
fp_regs.set(fp_param_reg);
2674+
saved_fp_regs.set(fp_param_reg);
26662675
}
26672676

2668-
CHECK_EQ(gp_regs.Count(), arraysize(wasm::kGpParamRegisters));
2669-
CHECK_EQ(fp_regs.Count(), arraysize(wasm::kFpParamRegisters));
2670-
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
2671-
gp_regs.Count());
2677+
CHECK_EQ(saved_fp_regs.Count(), arraysize(wasm::kFpParamRegisters));
26722678
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedFpParamRegs,
2673-
fp_regs.Count());
2679+
saved_fp_regs.Count());
2680+
return saved_fp_regs;
2681+
})();
2682+
2683+
{
2684+
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
2685+
FrameScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
26742686

2675-
__ MultiPush(gp_regs);
2676-
__ MultiPushFPU(fp_regs);
2687+
// Save registers that we need to keep alive across the runtime call.
2688+
__ MultiPush(kSavedGpRegs);
2689+
__ MultiPushFPU(kSavedFpRegs);
26772690

26782691
// kFixedFrameSizeFromFp is hard coded to include space for Simd
26792692
// registers, so we still need to allocate extra (unused) space on the stack
26802693
// as if they were saved.
2681-
__ Sub_d(sp, sp, fp_regs.Count() * kDoubleSize);
2694+
__ Sub_d(sp, sp, kSavedFpRegs.Count() * kDoubleSize);
26822695

26832696
// Pass instance and function index as an explicit arguments to the runtime
26842697
// function.
@@ -2687,15 +2700,27 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
26872700
// set the current context on the isolate.
26882701
__ Move(kContextRegister, Smi::zero());
26892702
__ CallRuntime(Runtime::kWasmCompileLazy, 2);
2690-
__ mov(t8, a0);
26912703

2692-
__ Add_d(sp, sp, fp_regs.Count() * kDoubleSize);
2704+
// Untag the returned Smi into into t7, for later use.
2705+
static_assert(!kSavedGpRegs.has(t7));
2706+
__ SmiUntag(t7, a0);
2707+
2708+
__ Add_d(sp, sp, kSavedFpRegs.Count() * kDoubleSize);
26932709
// Restore registers.
2694-
__ MultiPopFPU(fp_regs);
2695-
__ MultiPop(gp_regs);
2710+
__ MultiPopFPU(kSavedFpRegs);
2711+
__ MultiPop(kSavedGpRegs);
26962712
}
2697-
// Finally, jump to the entrypoint.
2698-
__ Jump(t8);
2713+
2714+
// The runtime function returned the jump table slot offset as a Smi (now in
2715+
// t7). Use that to compute the jump target.
2716+
static_assert(!kSavedGpRegs.has(t8));
2717+
__ Ld_d(t8, MemOperand(
2718+
kWasmInstanceRegister,
2719+
WasmInstanceObject::kJumpTableStartOffset - kHeapObjectTag));
2720+
__ Add_d(t7, t8, Operand(t7));
2721+
2722+
// Finally, jump to the jump table slot for the function.
2723+
__ Jump(t7);
26992724
}
27002725

27012726
void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {

0 commit comments

Comments
 (0)