Skip to content

Commit 76d6be5

Browse files
deps: patch V8 to 14.2.231.16
Refs: v8/v8@14.2.231.14...14.2.231.16 PR-URL: #60544 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent c9578dc commit 76d6be5

File tree

7 files changed

+79
-45
lines changed

7 files changed

+79
-45
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 14
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 231
14-
#define V8_PATCH_LEVEL 14
14+
#define V8_PATCH_LEVEL 16
1515

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

deps/v8/src/codegen/loong64/macro-assembler-loong64.cc

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,34 @@ void MacroAssembler::PreCheckSkippedWriteBarrier(Register object,
194194
bind(&not_ok);
195195
}
196196

197+
void MacroAssembler::MaybeJumpIfReadOnlyOrSmallSmi(Register value,
198+
Label* dest) {
199+
#if V8_STATIC_ROOTS_BOOL
200+
// Quick check for Read-only and small Smi values.
201+
static_assert(StaticReadOnlyRoot::kLastAllocatedRoot < kRegularPageSize);
202+
JumpIfUnsignedLessThan(value, kRegularPageSize, dest);
203+
#endif // V8_STATIC_ROOTS_BOOL
204+
}
205+
197206
// Clobbers object, dst, value, and ra, if (ra_status == kRAHasBeenSaved)
198207
// The register 'object' contains a heap object pointer. The heap object
199208
// tag is shifted away.
200209
void MacroAssembler::RecordWriteField(Register object, int offset,
201210
Register value, RAStatus ra_status,
202211
SaveFPRegsMode save_fp,
203-
SmiCheck smi_check, SlotDescriptor slot) {
212+
SmiCheck smi_check,
213+
ReadOnlyCheck ro_check,
214+
SlotDescriptor slot) {
204215
ASM_CODE_COMMENT(this);
216+
DCHECK(!AreAliased(object, value));
205217
// First, check if a write barrier is even needed. The tests below
206-
// catch stores of Smis.
218+
// catch stores of Smis and read-only objects.
207219
Label done;
208220

221+
if (ro_check == ReadOnlyCheck::kInline) {
222+
MaybeJumpIfReadOnlyOrSmallSmi(value, &done);
223+
}
224+
209225
// Skip barrier if writing a smi.
210226
if (smi_check == SmiCheck::kInline) {
211227
JumpIfSmi(value, &done);
@@ -228,7 +244,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
228244
}
229245

230246
RecordWrite(object, Operand(offset - kHeapObjectTag), value, ra_status,
231-
save_fp, SmiCheck::kOmit, slot);
247+
save_fp, SmiCheck::kOmit, ReadOnlyCheck::kOmit, slot);
232248

233249
bind(&done);
234250
}
@@ -703,7 +719,7 @@ void MacroAssembler::MoveObjectAndSlot(Register dst_object, Register dst_slot,
703719
void MacroAssembler::RecordWrite(Register object, Operand offset,
704720
Register value, RAStatus ra_status,
705721
SaveFPRegsMode fp_mode, SmiCheck smi_check,
706-
SlotDescriptor slot) {
722+
ReadOnlyCheck ro_check, SlotDescriptor slot) {
707723
DCHECK(!AreAliased(object, value));
708724

709725
if (v8_flags.slow_debug_code) {
@@ -726,9 +742,14 @@ void MacroAssembler::RecordWrite(Register object, Operand offset,
726742
}
727743

728744
// First, check if a write barrier is even needed. The tests below
729-
// catch stores of smis and stores into the young generation.
745+
// catch stores of smis and read-only objects, as well as stores into the
746+
// young generation.
730747
Label done;
731748

749+
if (ro_check == ReadOnlyCheck::kInline) {
750+
MaybeJumpIfReadOnlyOrSmallSmi(value, &done);
751+
}
752+
732753
if (smi_check == SmiCheck::kInline) {
733754
DCHECK_EQ(0, kSmiTag);
734755
JumpIfSmi(value, &done);
@@ -5312,7 +5333,7 @@ void MacroAssembler::ReplaceClosureCodeWithOptimizedCode(
53125333
FieldMemOperand(closure, JSFunction::kCodeOffset));
53135334
RecordWriteField(closure, JSFunction::kCodeOffset, optimized_code,
53145335
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore, SmiCheck::kOmit,
5315-
SlotDescriptor::ForCodePointerSlot());
5336+
ReadOnlyCheck::kOmit, SlotDescriptor::ForCodePointerSlot());
53165337
}
53175338

53185339
// Read off the flags in the feedback vector and check if there

deps/v8/src/codegen/loong64/macro-assembler-loong64.h

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -817,18 +817,20 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase {
817817
// Jump the register contains a smi.
818818
void JumpIfSmi(Register value, Label* smi_label);
819819

820-
void JumpIfEqual(Register a, int32_t b, Label* dest) {
821-
UseScratchRegisterScope temps(this);
822-
Register scratch = temps.Acquire();
823-
li(scratch, Operand(b));
824-
Branch(dest, eq, a, Operand(scratch));
820+
inline void JumpIf(Condition cond, Register x, int32_t y, Label* dest) {
821+
Branch(dest, cond, x, Operand(y));
825822
}
826823

827-
void JumpIfLessThan(Register a, int32_t b, Label* dest) {
828-
UseScratchRegisterScope temps(this);
829-
Register scratch = temps.Acquire();
830-
li(scratch, Operand(b));
831-
Branch(dest, lt, a, Operand(scratch));
824+
inline void JumpIfEqual(Register x, int32_t y, Label* dest) {
825+
Branch(dest, eq, x, Operand(y));
826+
}
827+
828+
inline void JumpIfLessThan(Register x, int32_t y, Label* dest) {
829+
Branch(dest, lt, x, Operand(y));
830+
}
831+
832+
inline void JumpIfUnsignedLessThan(Register x, int32_t y, Label* dest) {
833+
Branch(dest, lo, x, Operand(y));
832834
}
833835

834836
// Push a standard frame, consisting of ra, fp, context and JS function.
@@ -1058,6 +1060,10 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase {
10581060
// ---------------------------------------------------------------------------
10591061
// GC Support
10601062

1063+
// Performs a fast check for whether `value` is a read-only object or a small
1064+
// Smi. Only enabled in some configurations.
1065+
void MaybeJumpIfReadOnlyOrSmallSmi(Register value, Label* dest);
1066+
10611067
// Notify the garbage collector that we wrote a pointer into an object.
10621068
// |object| is the object being stored into, |value| is the object being
10631069
// stored.
@@ -1066,13 +1072,15 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase {
10661072
void RecordWriteField(
10671073
Register object, int offset, Register value, RAStatus ra_status,
10681074
SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline,
1075+
ReadOnlyCheck ro_check = ReadOnlyCheck::kInline,
10691076
SlotDescriptor slot = SlotDescriptor::ForDirectPointerSlot());
10701077

10711078
// For a given |object| notify the garbage collector that the slot at |offset|
10721079
// has been written. |value| is the object being stored.
10731080
void RecordWrite(
10741081
Register object, Operand offset, Register value, RAStatus ra_status,
10751082
SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline,
1083+
ReadOnlyCheck ro_check = ReadOnlyCheck::kInline,
10761084
SlotDescriptor slot = SlotDescriptor::ForDirectPointerSlot());
10771085

10781086
// ---------------------------------------------------------------------------

deps/v8/src/compiler/backend/arm64/instruction-selector-arm64.cc

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5817,19 +5817,14 @@ void InstructionSelector::VisitI8x16Shuffle(OpIndex node) {
58175817
int lane_size = kBitsPerByte * kSimd128Size / lanes;
58185818
Emit(kArm64S128Dup | LaneSizeField::encode(lane_size), dup,
58195819
g.UseRegister(dup_input), g.UseImmediate(dup_index));
5820-
if (is_swizzle) {
5821-
Emit(shuffle_op, g.DefineAsRegister(node), g.UseRegister(input0), dup);
5822-
return;
5823-
} else {
5824-
// For non-swizzles, we first need to perform the shuffles with the two
5825-
// original inputs, into a temp register.
5826-
InstructionOperand temp = g.TempSimd128Register();
5827-
Emit(shuffle_op, temp, g.UseRegister(input0), g.UseRegister(input1));
5828-
// Then we need to move the dup result into the top 8 bytes.
5829-
Emit(kArm64S128MoveLane | LaneSizeField::encode(64),
5830-
g.DefineSameAsFirst(node), temp, dup, g.UseImmediate(1),
5831-
g.UseImmediate(1));
5832-
}
5820+
// First need to perform the shuffles with the two original inputs, into a
5821+
// temp register.
5822+
InstructionOperand temp = g.TempSimd128Register();
5823+
Emit(shuffle_op, temp, g.UseRegister(input0), g.UseRegister(input1));
5824+
// Then we need to move the dup result into the top 8 bytes.
5825+
Emit(kArm64S128MoveLane | LaneSizeField::encode(64),
5826+
g.DefineSameAsFirst(node), temp, dup, g.UseImmediate(1),
5827+
g.UseImmediate(1));
58335828
};
58345829

58355830
std::array<uint8_t, kSimd128HalfSize> bottom_shuffle;

deps/v8/src/compiler/backend/loong64/code-generator-loong64.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
10681068
Register scratch = i.TempRegister(0);
10691069
auto ool = zone()->New<OutOfLineVerifySkippedWriteBarrier>(
10701070
this, object, value, scratch);
1071+
__ MaybeJumpIfReadOnlyOrSmallSmi(value, ool->exit());
10711072
__ JumpIfNotSmi(value, ool->entry());
10721073
__ bind(ool->exit());
10731074

@@ -1128,6 +1129,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
11281129
Register scratch = i.TempRegister(1);
11291130
auto ool = zone()->New<OutOfLineVerifySkippedWriteBarrier>(
11301131
this, object, value, scratch);
1132+
__ MaybeJumpIfReadOnlyOrSmallSmi(value, ool->exit());
11311133
__ JumpIfNotSmi(value, ool->entry());
11321134
__ bind(ool->exit());
11331135

deps/v8/test/mjsunit/wasm/half-dup-shuffles.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ function Test(config) {
5454

5555
(function SplatAndShuffleTest(config) {
5656
const dup_byte_0 = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
57+
const dup_half_0 = [0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01 ]
5758
const dup_half_8 = [0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11 ]
5859
const dup_word_1 = [0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07 ]
5960

6061
const even_bytes = [0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e ]
6162
const interleave_high_halves = [0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b ]
6263
const transpose_odd_words = [0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17 ]
64+
const reverse_16x2 = [0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05 ]
6365

6466
const splat_and_shuffle_tests =[
6567
{
@@ -77,6 +79,11 @@ function Test(config) {
7779
dup_shuffle: dup_word_1,
7880
shuffle: transpose_odd_words,
7981
},
82+
{
83+
name: "dup and reverse 16x2",
84+
dup_shuffle: dup_half_0,
85+
shuffle: reverse_16x2,
86+
},
8087
];
8188

8289
for (const config of splat_and_shuffle_tests) {

deps/v8/test/unittests/compiler/arm64/turboshaft-instruction-selector-arm64-unittest.cc

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,23 +3627,23 @@ std::ostream& operator<<(std::ostream& os, const DupAndShuffleInst& inst) {
36273627
const DupAndShuffleInst kDupAndShuffles[] = {
36283628
{"Dup 0 and UnzipLeft",
36293629
kArm64S128UnzipLeft,
3630-
2,
3630+
3,
36313631
0,
36323632
16,
36333633
0,
36343634
true,
36353635
{{0, 1, 4, 5, 8, 9, 12, 13, 0, 1, 0, 1, 0, 1, 0, 1}}},
36363636
{"Dup 1 and UnzipLeft",
36373637
kArm64S128UnzipLeft,
3638-
2,
3638+
3,
36393639
0,
36403640
16,
36413641
1,
36423642
true,
36433643
{{0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 2, 3, 2, 3, 2, 3}}},
36443644
{"Dup 0 and UnzipRight",
36453645
kArm64S128UnzipRight,
3646-
2,
3646+
3,
36473647
0,
36483648
16,
36493649
0,
@@ -3738,28 +3738,29 @@ TEST_P(TurboshaftInstructionSelectorDupAndShuffleTest, DupAndShuffle) {
37383738
Stream s = m.Build();
37393739
EXPECT_EQ(inst.expected_num_insts, s.size());
37403740

3741-
if (inst.expected_num_insts > 1) {
3741+
if (inst.expected_num_insts == 3) {
3742+
// The dup
37423743
EXPECT_EQ(kArm64S128Dup, s[0]->arch_opcode());
3744+
EXPECT_EQ(inst.lane_size, LaneSizeField::decode(s[0]->opcode()));
37433745
EXPECT_EQ(s.ToVreg(s[0]->InputAt(0)),
37443746
s.ToVreg(m.Parameter(inst.expected_param_index)));
37453747
EXPECT_EQ(s.ToInt32(s[0]->InputAt(1)), inst.index);
37463748

3747-
EXPECT_EQ(inst.lane_size, LaneSizeField::decode(s[0]->opcode()));
3749+
// The shuffle
37483750
EXPECT_EQ(inst.arch_opcode, s[1]->arch_opcode());
37493751
EXPECT_EQ(inst.lane_size, LaneSizeField::decode(s[1]->opcode()));
3750-
3751-
if (inst.expected_num_insts == 3) {
3752-
EXPECT_EQ(s.ToVreg(s[1]->InputAt(0)), s.ToVreg(m.Parameter(0)));
3753-
EXPECT_EQ(s.ToVreg(s[1]->InputAt(1)), s.ToVreg(m.Parameter(1)));
3754-
EXPECT_EQ(kArm64S128MoveLane, s[2]->arch_opcode());
3755-
EXPECT_EQ(1U, s[2]->OutputCount());
3752+
EXPECT_EQ(s.ToVreg(s[1]->InputAt(0)), s.ToVreg(m.Parameter(0)));
3753+
if (inst.is_swizzle) {
3754+
EXPECT_EQ(s.ToVreg(s[1]->InputAt(1)), s.ToVreg(m.Parameter(0)));
37563755
} else {
3757-
EXPECT_EQ(s.ToVreg(s[1]->InputAt(0)),
3758-
s.ToVreg(m.Parameter(inst.expected_param_index)));
3759-
EXPECT_EQ(s.ToVreg(s[1]->InputAt(1)), s.ToVreg(s[0]->Output()));
3760-
EXPECT_EQ(1U, s[1]->OutputCount());
3756+
EXPECT_EQ(s.ToVreg(s[1]->InputAt(1)), s.ToVreg(m.Parameter(1)));
37613757
}
3758+
3759+
// Copy the top half of the dup into the result register.
3760+
EXPECT_EQ(kArm64S128MoveLane, s[2]->arch_opcode());
3761+
EXPECT_EQ(1U, s[2]->OutputCount());
37623762
} else {
3763+
DCHECK_EQ(inst.expected_num_insts, 1);
37633764
EXPECT_EQ(inst.arch_opcode, s[0]->arch_opcode());
37643765
}
37653766
}

0 commit comments

Comments
 (0)