Skip to content

Commit a981214

Browse files
BridgeARdanbev
authored andcommitted
deps: patch V8 to 7.1.302.33
PR-URL: #25101 Refs: v8/v8@7.1.302.28...7.1.302.33 Fixes: #25089 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Yang Guo <[email protected]>
1 parent 8b57208 commit a981214

12 files changed

+544
-127
lines changed

deps/v8/DEPS

+22-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ vars = {
99
'download_jsfunfuzz': False,
1010
'download_mips_toolchain': False,
1111
'check_v8_header_includes': False,
12+
13+
# luci-go CIPD package version.
14+
'luci_go': 'git_revision:fdf05508e8a66c773a41521e0243c9d11b9a2a1c',
1215
}
1316

1417
deps = {
@@ -51,7 +54,7 @@ deps = {
5154
'v8/third_party/markupsafe':
5255
Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '8f45f5cfa0009d2a70589bcda0349b8cb2b72783',
5356
'v8/tools/swarming_client':
54-
Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '486c9b53c4d54dd4b95bb6ce0e31160e600dfc11',
57+
Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '0e3e1c4dc4e79f25a5b58fcbc135dc93183c0c54',
5558
'v8/test/benchmarks/data':
5659
Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f',
5760
'v8/test/mozilla/data':
@@ -82,8 +85,24 @@ deps = {
8285
},
8386
'v8/tools/clang':
8487
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '7792d28b069af6dd3a86d1ba83b7f5c4ede605dc',
85-
'v8/tools/luci-go':
86-
Var('chromium_url') + '/chromium/src/tools/luci-go.git' + '@' + '445d7c4b6a4f10e188edb395b132e3996b127691',
88+
'v8/tools/luci-go': {
89+
'packages': [
90+
{
91+
'package': 'infra/tools/luci/isolate/${{platform}}',
92+
'version': Var('luci_go'),
93+
},
94+
{
95+
'package': 'infra/tools/luci/isolated/${{platform}}',
96+
'version': Var('luci_go'),
97+
},
98+
{
99+
'package': 'infra/tools/luci/swarming/${{platform}}',
100+
'version': Var('luci_go'),
101+
},
102+
],
103+
'condition': 'host_cpu != "s390"',
104+
'dep_type': 'cipd',
105+
},
87106
'v8/test/wasm-js':
88107
Var('chromium_url') + '/external/github.com/WebAssembly/spec.git' + '@' + 'db9cd40808a90ecc5f4a23e88fb375c8f60b8d52',
89108
}

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 7
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 302
14-
#define V8_PATCH_LEVEL 28
14+
#define V8_PATCH_LEVEL 33
1515

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

deps/v8/src/builtins/array-splice.tq

+62-41
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ module array {
99
// zero-length input FixedArray is handled here.
1010
macro Extract<FixedArrayType: type>(
1111
elements: FixedArrayBase, first: Smi, count: Smi,
12-
capacity: Smi): FixedArrayType {
13-
return UnsafeCast<FixedArrayType>(
12+
capacity: Smi): FixedArrayType;
13+
14+
Extract<FixedArray>(
15+
elements: FixedArrayBase, first: Smi, count: Smi,
16+
capacity: Smi): FixedArray {
17+
return UnsafeCast<FixedArray>(
1418
ExtractFixedArray(elements, first, count, capacity));
1519
}
1620

@@ -24,63 +28,80 @@ module array {
2428
ExtractFixedArray(elements, first, count, capacity));
2529
}
2630

31+
macro DoMoveElements<FixedArrayType: type>(
32+
elements: FixedArrayType, dstIndex: Smi, srcIndex: Smi,
33+
count: Smi): void {
34+
TorqueMoveElements(
35+
elements, Convert<intptr>(dstIndex), Convert<intptr>(srcIndex),
36+
Convert<intptr>(count));
37+
}
38+
39+
macro StoreHoles<FixedArrayType: type>(
40+
elements: FixedArrayType, holeStartIndex: Smi, holeEndIndex: Smi): void {
41+
for (let i: Smi = holeStartIndex; i < holeEndIndex; i++) {
42+
StoreArrayHole(elements, i);
43+
}
44+
}
45+
46+
macro DoCopyElements<FixedArrayType: type>(
47+
dstElements: FixedArrayType, dstIndex: Smi, srcElements: FixedArrayType,
48+
srcIndex: Smi, count: Smi): void {
49+
TorqueCopyElements(
50+
dstElements, Convert<intptr>(dstIndex), srcElements,
51+
Convert<intptr>(srcIndex), Convert<intptr>(count));
52+
}
53+
2754
macro FastSplice<FixedArrayType: type, ElementType: type>(
2855
args: constexpr Arguments, a: JSArray, length: Smi, newLength: Smi,
2956
lengthDelta: Smi, actualStart: Smi, insertCount: Smi,
3057
actualDeleteCount: Smi): void
3158
labels Bailout {
32-
const elements: FixedArrayBase = a.elements;
33-
const elementsMap: Map = elements.map;
34-
35-
// If the spliced array is larger then the
36-
// source array, then allocate a new FixedArrayType to hold the result.
37-
let newElements: FixedArrayBase = elements;
38-
if (elementsMap == kCOWMap || lengthDelta > 0) {
39-
newElements =
40-
Extract<FixedArrayType>(elements, 0, actualStart, newLength);
41-
if (elementsMap == kCOWMap) {
42-
newElements.map = elementsMap;
59+
// Make sure elements are writable.
60+
EnsureWriteableFastElements(a);
61+
62+
if (insertCount != actualDeleteCount) {
63+
const elements: FixedArrayBase = a.elements;
64+
const dstIndex: Smi = actualStart + insertCount;
65+
const srcIndex: Smi = actualStart + actualDeleteCount;
66+
const count: Smi = length - actualDeleteCount - actualStart;
67+
if (insertCount < actualDeleteCount) {
68+
// Shrink.
69+
DoMoveElements<FixedArrayType>(
70+
UnsafeCast<FixedArrayType>(elements), dstIndex, srcIndex, count);
71+
StoreHoles<FixedArrayType>(
72+
UnsafeCast<FixedArrayType>(elements), newLength, length);
73+
} else if (insertCount > actualDeleteCount) {
74+
// If the backing store is big enough, then moving elements is enough.
75+
if (newLength <= elements.length) {
76+
DoMoveElements<FixedArrayType>(
77+
UnsafeCast<FixedArrayType>(elements), dstIndex, srcIndex, count);
78+
} else {
79+
// Grow.
80+
let capacity: Smi = CalculateNewElementsCapacity(newLength);
81+
const newElements: FixedArrayType =
82+
Extract<FixedArrayType>(elements, 0, actualStart, capacity);
83+
a.elements = newElements;
84+
if (elements.length > 0) {
85+
DoCopyElements<FixedArrayType>(
86+
newElements, dstIndex, UnsafeCast<FixedArrayType>(elements),
87+
srcIndex, count);
88+
}
89+
}
4390
}
44-
a.elements = newElements;
4591
}
4692

47-
// Copy over inserted elements.
93+
// Copy arguments.
4894
let k: Smi = actualStart;
4995
if (insertCount > 0) {
5096
const typedNewElements: FixedArrayType =
51-
UnsafeCast<FixedArrayType>(newElements);
97+
UnsafeCast<FixedArrayType>(a.elements);
5298
for (let e: Object of args [2: ]) {
5399
// The argument elements were already validated to be an appropriate
54100
// {ElementType} to store in {FixedArrayType}.
55101
typedNewElements[k++] = UnsafeCast<ElementType>(e);
56102
}
57103
}
58104

59-
// Copy over elements after deleted elements.
60-
let count: Smi = length - actualStart - actualDeleteCount;
61-
while (count > 0) {
62-
const typedElements: FixedArrayType =
63-
UnsafeCast<FixedArrayType>(elements);
64-
const typedNewElements: FixedArrayType =
65-
UnsafeCast<FixedArrayType>(newElements);
66-
CopyArrayElement(typedElements, typedNewElements, k - lengthDelta, k);
67-
k++;
68-
count--;
69-
}
70-
71-
// Fill rest of spliced FixedArray with the hole, but only if the
72-
// destination FixedArray is the original array's, since otherwise the array
73-
// is pre-filled with holes.
74-
if (elements == newElements) {
75-
const typedNewElements: FixedArrayType =
76-
UnsafeCast<FixedArrayType>(newElements);
77-
const limit: Smi = elements.length;
78-
while (k < limit) {
79-
StoreArrayHole(typedNewElements, k);
80-
k++;
81-
}
82-
}
83-
84105
// Update the array's length after all the FixedArray shuffling is done.
85106
a.length = newLength;
86107
}

deps/v8/src/builtins/base.tq

+32
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,8 @@ macro AllowNonNumberElements(kind: ElementsKind): ElementsKind {
844844
extern macro AllocateZeroedFixedArray(intptr): FixedArray;
845845
extern macro AllocateZeroedFixedDoubleArray(intptr): FixedDoubleArray;
846846

847+
extern macro CalculateNewElementsCapacity(Smi): Smi;
848+
847849
extern macro CopyFixedArrayElements(
848850
constexpr ElementsKind, FixedArray, constexpr ElementsKind, FixedArray,
849851
intptr, intptr, intptr): void;
@@ -879,6 +881,36 @@ extern macro ExtractFixedArray(
879881

880882
extern builtin ExtractFastJSArray(Context, JSArray, Smi, Smi): JSArray;
881883

884+
extern macro MoveElements(
885+
constexpr ElementsKind, FixedArrayBase, intptr, intptr, intptr): void;
886+
macro TorqueMoveElements(
887+
elements: FixedArray, dstIndex: intptr, srcIndex: intptr,
888+
count: intptr): void {
889+
MoveElements(HOLEY_ELEMENTS, elements, dstIndex, srcIndex, count);
890+
}
891+
macro TorqueMoveElements(
892+
elements: FixedDoubleArray, dstIndex: intptr, srcIndex: intptr,
893+
count: intptr): void {
894+
MoveElements(HOLEY_DOUBLE_ELEMENTS, elements, dstIndex, srcIndex, count);
895+
}
896+
897+
extern macro CopyElements(
898+
constexpr ElementsKind, FixedArrayBase, intptr, FixedArrayBase, intptr,
899+
intptr): void;
900+
macro TorqueCopyElements(
901+
dstElements: FixedArray, dstIndex: intptr, srcElements: FixedArray,
902+
srcIndex: intptr, count: intptr): void {
903+
CopyElements(
904+
HOLEY_ELEMENTS, dstElements, dstIndex, srcElements, srcIndex, count);
905+
}
906+
macro TorqueCopyElements(
907+
dstElements: FixedDoubleArray, dstIndex: intptr,
908+
srcElements: FixedDoubleArray, srcIndex: intptr, count: intptr): void {
909+
CopyElements(
910+
HOLEY_DOUBLE_ELEMENTS, dstElements, dstIndex, srcElements, srcIndex,
911+
count);
912+
}
913+
882914
macro LoadElementNoHole<T: type>(a: JSArray, index: Smi): Object
883915
labels IfHole;
884916

0 commit comments

Comments
 (0)