Skip to content

Commit c8e1782

Browse files
joyeecheungRafaelGSS
authored andcommitted
deps: V8: cherry-pick c1a54d5ffcd1
Original commit message: Skip regress-1320641 when the system does not have enough memory Change-Id: I23a5232f6437c4bc77390796ee2986f1600cb1bf Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4689686 Reviewed-by: Nico Hartmann <[email protected]> Commit-Queue: Joyee Cheung <[email protected]> Cr-Commit-Position: refs/heads/main@{#88973} Refs: v8/v8@c1a54d5 PR-URL: #48830 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]>
1 parent 4515a28 commit c8e1782

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.10',
39+
'v8_embedder_string': '-node.12',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/test/mjsunit/regress/regress-1320641.js

+17-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@ function foo(){
88
const xs = new Uint16Array(3775336418);
99
return xs[-981886074];
1010
}
11-
%PrepareFunctionForOptimization(foo);
12-
foo();
1311

14-
assertEquals(undefined, foo());
15-
%OptimizeFunctionOnNextCall(foo);
16-
assertEquals(undefined, foo());
12+
var skip = false;
13+
try {
14+
new Uint16Array(3775336418);
15+
} catch (e) {
16+
if (e.message.test(/Array buffer allocation failed/)) {
17+
skip = true; // We don't have enough memory, just skip the test.
18+
}
19+
}
20+
21+
if (!skip) {
22+
%PrepareFunctionForOptimization(foo);
23+
foo();
24+
25+
assertEquals(undefined, foo());
26+
%OptimizeFunctionOnNextCall(foo);
27+
assertEquals(undefined, foo());
28+
}

0 commit comments

Comments
 (0)