OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 d = {x: undefined, y: undefined}; |
| 8 |
| 9 function Crash(left, right) { |
| 10 var c = { |
| 11 x: right.x - left.x, |
| 12 y: right.y - left.y |
| 13 }; |
| 14 return c.x * c.y; |
| 15 } |
| 16 |
| 17 var a = {x: 0.5, y: 0}; |
| 18 var b = {x: 1, y: 0}; |
| 19 |
| 20 for (var i = 0; i < 3; i++) Crash(a, b); |
| 21 %OptimizeFunctionOnNextCall(Crash); |
| 22 Crash(a, b); |
| 23 |
| 24 Crash({x: 0, y: 0.5}, b); |
OLD | NEW |