OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // Flags: --allow-natives-syntax --typed-array-max-size-in-heap=1 |
| 6 |
| 7 var foo = (function () { |
| 8 var y = 0; |
| 9 return function foo(x) { |
| 10 // Needs to be an external array. |
| 11 var a = new Float64Array(32); |
| 12 a[0] = 42; |
| 13 y = x + 0.1; // This has to allocate. |
| 14 return a[0]; |
| 15 } |
| 16 })(); |
| 17 |
| 18 foo(1); |
| 19 foo(1); |
| 20 %OptimizeFunctionOnNextCall(foo); |
| 21 foo(1); |
| 22 // Try to force a GC during allocation in above marked line. |
| 23 for (var i = 0; i < 20; ++i) { |
| 24 %SetAllocationTimeout(i, i, false); |
| 25 assertEquals(42, foo(2)); |
| 26 } |
OLD | NEW |