diff --git a/common.gypi b/common.gypi index 3e1902fb7892bb..b68804ac668d32 100644 --- a/common.gypi +++ b/common.gypi @@ -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 ##### diff --git a/deps/v8/test/mjsunit/regress/regress-1320641.js b/deps/v8/test/mjsunit/regress/regress-1320641.js index 6c52c9d178606d..cc6a11be3d89db 100644 --- a/deps/v8/test/mjsunit/regress/regress-1320641.js +++ b/deps/v8/test/mjsunit/regress/regress-1320641.js @@ -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()); +}