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 |
| 6 |
| 7 var doubles = new Float64Array(1); |
| 8 function ToHeapNumber(i) { |
| 9 doubles[0] = i; |
| 10 return doubles[0]; |
| 11 } |
| 12 for (var i = 0; i < 3; i++) ToHeapNumber(i); |
| 13 %OptimizeFunctionOnNextCall(ToHeapNumber); |
| 14 assertFalse(%IsSmi(ToHeapNumber(1))); |
| 15 |
| 16 function Fail(a, i, v) { |
| 17 a[i] = v; |
| 18 } |
| 19 |
| 20 for (var i = 0; i < 3; i++) Fail(new Array(1), 1, i); |
| 21 %OptimizeFunctionOnNextCall(Fail); |
| 22 // 1050 > JSObject::kMaxGap, causing stub failure and runtime call. |
| 23 Fail(new Array(1), ToHeapNumber(1050), 3); |
OLD | NEW |