Skip to content

Commit 435cd1a

Browse files
committed
deps: patch V8 to 14.4.258.15
Refs: v8/v8@14.4.258.13...14.4.258.15
1 parent 2a8ce56 commit 435cd1a

File tree

7 files changed

+75
-7
lines changed

7 files changed

+75
-7
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 4
1313
#define V8_BUILD_NUMBER 258
14-
#define V8_PATCH_LEVEL 13
14+
#define V8_PATCH_LEVEL 15
1515

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

deps/v8/src/maglev/arm/maglev-ir-arm.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,18 +957,26 @@ int CheckJSDataViewBounds::MaxCallStackArgs() const { return 1; }
957957
void CheckJSDataViewBounds::SetValueLocationConstraints() {
958958
UseRegister(IndexInput());
959959
UseRegister(ByteLengthInput());
960+
int element_size = compiler::ExternalArrayElementSize(element_type_);
961+
if (element_size > 1) {
962+
set_temporaries_needed(1);
963+
}
960964
}
961965
void CheckJSDataViewBounds::GenerateCode(MaglevAssembler* masm,
962966
const ProcessingState& state) {
963967
Register index = ToRegister(IndexInput());
964968
Register byte_length = ToRegister(ByteLengthInput());
965969

970+
MaglevAssembler::TemporaryRegisterScope temps(masm);
971+
Register limit = byte_length;
972+
966973
int element_size = compiler::ExternalArrayElementSize(element_type_);
967974
if (element_size > 1) {
968-
__ sub(byte_length, byte_length, Operand(element_size - 1), SetCC);
975+
limit = temps.Acquire();
976+
__ sub(limit, byte_length, Operand(element_size - 1), SetCC);
969977
__ EmitEagerDeoptIf(mi, DeoptimizeReason::kOutOfBounds, this);
970978
}
971-
__ cmp(index, byte_length);
979+
__ cmp(index, limit);
972980
__ EmitEagerDeoptIf(hs, DeoptimizeReason::kOutOfBounds, this);
973981
}
974982

deps/v8/src/maglev/arm64/maglev-ir-arm64.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,18 +931,26 @@ int CheckJSDataViewBounds::MaxCallStackArgs() const { return 1; }
931931
void CheckJSDataViewBounds::SetValueLocationConstraints() {
932932
UseRegister(IndexInput());
933933
UseRegister(ByteLengthInput());
934+
int element_size = compiler::ExternalArrayElementSize(element_type_);
935+
if (element_size > 1) {
936+
set_temporaries_needed(1);
937+
}
934938
}
935939
void CheckJSDataViewBounds::GenerateCode(MaglevAssembler* masm,
936940
const ProcessingState& state) {
937941
Register index = ToRegister(IndexInput());
938942
Register byte_length = ToRegister(ByteLengthInput());
939943

944+
MaglevAssembler::TemporaryRegisterScope temps(masm);
945+
Register limit = byte_length;
946+
940947
int element_size = compiler::ExternalArrayElementSize(element_type_);
941948
if (element_size > 1) {
942-
__ Subs(byte_length, byte_length, Immediate(element_size - 1));
949+
limit = temps.Acquire();
950+
__ Subs(limit, byte_length, Immediate(element_size - 1));
943951
__ EmitEagerDeoptIf(mi, DeoptimizeReason::kOutOfBounds, this);
944952
}
945-
__ Cmp(index, byte_length);
953+
__ Cmp(index, limit);
946954
__ EmitEagerDeoptIf(hs, DeoptimizeReason::kOutOfBounds, this);
947955
}
948956

deps/v8/src/maglev/x64/maglev-ir-x64.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ void LoadTypedArrayLength::GenerateCode(MaglevAssembler* masm,
9393

9494
void CheckJSDataViewBounds::SetValueLocationConstraints() {
9595
UseRegister(IndexInput());
96-
UseRegister(ByteLengthInput());
96+
int element_size = compiler::ExternalArrayElementSize(element_type_);
97+
if (element_size > 1) {
98+
UseAndClobberRegister(ByteLengthInput());
99+
} else {
100+
UseRegister(ByteLengthInput());
101+
}
97102
}
98103

99104
void CheckJSDataViewBounds::GenerateCode(MaglevAssembler* masm,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
let ab = new ArrayBuffer(7);
8+
let dv = new DataView(ab);
9+
10+
/* -----------------------------
11+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | << the ArrayBuffer
12+
-----------------------------
13+
14+
---------
15+
| X | X | << trying to access size 2 element at index 6
16+
---------
17+
*/
18+
19+
function foo(dv) {
20+
return dv.getInt16(6);
21+
}
22+
%PrepareFunctionForOptimization(foo);
23+
24+
assertThrows(() => foo(dv), RangeError);
25+
26+
%OptimizeMaglevOnNextCall(foo);
27+
28+
assertThrows(() => foo(dv), RangeError);
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 --maglev
6+
7+
let ab = new ArrayBuffer(8);
8+
let view = new DataView(ab);
9+
10+
function foo(dv) {
11+
let len = dv.byteLength;
12+
dv.getFloat64(0);
13+
return len;
14+
}
15+
16+
%PrepareFunctionForOptimization(foo);
17+
assertEquals(8, foo(view));
18+
%OptimizeMaglevOnNextCall(foo);
19+
assertEquals(8, foo(view));

deps/v8/tools/whitespace.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Try to write something funny. And please don't add trailing whitespace.
55
A Smi balks into a war and says:
66
"I'm so deoptimized today!"
77
The doubles heard this and started to unbox.
8-
The Smi looked at them when a crazy v8-autoroll account showed up.....
8+
The Smi looked at them when a crazy v8-autoroll account showed up......
99
The autoroller bought a round of Himbeerbrause. Suddenly...............
1010
The bartender starts to shake the bottles................................
1111
I can't add trailing whitespaces, so I'm adding this line................

0 commit comments

Comments
 (0)