Skip to content

Commit 78940f7

Browse files
committed
deps: patch V8 to 14.3.127.4
Refs: v8/v8@14.3.127.2...14.3.127.4
1 parent 98d243a commit 78940f7

File tree

7 files changed

+77
-32
lines changed

7 files changed

+77
-32
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 3
1313
#define V8_BUILD_NUMBER 127
14-
#define V8_PATCH_LEVEL 2
14+
#define V8_PATCH_LEVEL 4
1515

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

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

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

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

deps/v8/src/maglev/maglev-graph-builder.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,14 +4495,17 @@ ValueNode* MaglevGraphBuilder::ConvertForField(ValueNode* value,
44954495
AllocationType allocation_type) {
44964496
switch (desc.type) {
44974497
case vobj::FieldType::kTagged: {
4498-
if (NodeTypeIs(GetType(value), NodeType::kSmi)) {
4498+
// Subtle: we don't use `NodeTypeIs(...)` since the predicate must NOT
4499+
// be true for NodeType::kNone.
4500+
// TODO(jgruber): NodeType::kNone should never reach here.
4501+
if (GetType(value) == NodeType::kSmi) {
44994502
// TODO(jgruber): This is needed because HoleyFloat64ToTagged does not
45004503
// canonicalize smis by default in GetTaggedValue. We rely on
45014504
// canonicalization though in TryReduceConstructArrayConstructor.
45024505
// We should make this more robust.
45034506
MaybeReduceResult res = GetSmiValue(value);
4504-
DCHECK(res.IsDoneWithPayload());
4505-
return res.node()->Cast<ValueNode>();
4507+
CHECK(res.IsDoneWithValue());
4508+
return res.value();
45064509
}
45074510
if (value->Is<Float64Constant>()) {
45084511
// Note that NodeType::kSmi MUST go through GetSmiValue for proper
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2025 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// Flags: --allow-natives-syntax --maglev
6+
7+
function f0() {
8+
try {
9+
([f0,f0]).forEach(undefined);
10+
class C4 {
11+
[undefined];
12+
}
13+
} catch(e5) {
14+
}
15+
return f0;
16+
}
17+
const v6 = %PrepareFunctionForOptimization(f0);
18+
f0();
19+
const v8 = %OptimizeMaglevOnNextCall(f0);
20+
f0();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2025 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
//
5+
// Flags: --allow-natives-syntax
6+
7+
function* __f_0(__v_1) {
8+
for (let __v_2 = 0; __v_2 < __v_1; __v_2++) {
9+
for (let __v_3 = 0; __v_3 < __v_1; __v_3++) {
10+
Math.acos(false);
11+
yield __v_2 * 10 + __v_3;
12+
}
13+
}
14+
}
15+
%PrepareFunctionForOptimization(__f_0);
16+
let __v_0 = __f_0(4);
17+
__v_0.next().value;
18+
%OptimizeFunctionOnNextCall(__f_0);
19+
__v_0 = __f_0();

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)