diff options
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js')
-rw-r--r-- | deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js b/deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js index dcbf8dcb2d..0201411d6f 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-961709-2.js @@ -8,12 +8,25 @@ function foo() { const a = []; a[0] = 1; return a[0]; -} +}; + +function bar() { + const a = new Array(10); + a[0] = 1; + return a[0]; +}; -%EnsureFeedbackVectorForFunction(foo); Object.setPrototypeOf(Array.prototype, new Int8Array()); +%PrepareFunctionForOptimization(foo); assertEquals(undefined, foo()); assertEquals(undefined, foo()); %OptimizeFunctionOnNextCall(foo); assertEquals(undefined, foo()); assertOptimized(foo); + +%PrepareFunctionForOptimization(bar); +assertEquals(undefined, bar()); +assertEquals(undefined, bar()); +%OptimizeFunctionOnNextCall(bar); +assertEquals(undefined, bar()); +assertOptimized(bar); |