Skip to content

Commit

Permalink
deps: V8: cherry-pick c1a54d5ffcd1
Browse files Browse the repository at this point in the history
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 <nicohartmann@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#88973}

Refs: v8/v8@c1a54d5
PR-URL: #48830
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
  • Loading branch information
joyeecheung authored and RafaelGSS committed Aug 15, 2023
1 parent 4515a28 commit c8e1782
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

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

##### V8 defaults for Node.js #####

Expand Down
22 changes: 17 additions & 5 deletions deps/v8/test/mjsunit/regress/regress-1320641.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,21 @@ function foo(){
const xs = new Uint16Array(3775336418);
return xs[-981886074];
}
%PrepareFunctionForOptimization(foo);
foo();

assertEquals(undefined, foo());
%OptimizeFunctionOnNextCall(foo);
assertEquals(undefined, foo());
var skip = false;
try {
new Uint16Array(3775336418);
} catch (e) {
if (e.message.test(/Array buffer allocation failed/)) {
skip = true; // We don't have enough memory, just skip the test.
}
}

if (!skip) {
%PrepareFunctionForOptimization(foo);
foo();

assertEquals(undefined, foo());
%OptimizeFunctionOnNextCall(foo);
assertEquals(undefined, foo());
}

0 comments on commit c8e1782

Please sign in to comment.