| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --use-osr | 5 // Flags: --use-osr |
| 6 // TODO(titzer): enable --turbo-osr when nested OSR works. | |
| 7 | 6 |
| 8 function f1(a,b,c) { | 7 function f1(a,b,c) { |
| 9 var x = 0; | 8 var x = 0; |
| 10 var y = 0; | 9 var y = 0; |
| 11 var z = 0; | 10 var z = 0; |
| 12 for (var i = 0; i < 2; i++) { | 11 for (var i = 0; i < 2; i++) { |
| 13 while (a > 0) { x += 19; a--; } | 12 while (a > 0) { x += 19; a--; } |
| 14 while (b > 0) { y += 23; b--; } | 13 while (b > 0) { y += 23; b--; } |
| 15 while (c > 0) { z += 29; c--; } | 14 while (c > 0) { z += 29; c--; } |
| 16 } | 15 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 42 return x + y + z; | 41 return x + y + z; |
| 43 } | 42 } |
| 44 | 43 |
| 45 function check(f,a,b,c) { | 44 function check(f,a,b,c) { |
| 46 assertEquals(a * 19 + b * 23 + c * 29, f(a,b,c)); | 45 assertEquals(a * 19 + b * 23 + c * 29, f(a,b,c)); |
| 47 } | 46 } |
| 48 | 47 |
| 49 check(f1, 50000, 5, 6); | 48 check(f1, 50000, 5, 6); |
| 50 check(f2, 4, 50000, 6); | 49 check(f2, 4, 50000, 6); |
| 51 check(f3, 11, 12, 50000); | 50 check(f3, 11, 12, 50000); |
| OLD | NEW |