| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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: --allow-natives-syntax --use-osr --turbo-deoptimization | 5 // Flags: --allow-natives-syntax --use-osr --turbo-deoptimization |
| 6 | 6 |
| 7 function bar(goal) { | 7 function bar(goal) { |
| 8 var count = 0; | 8 var count = 0; |
| 9 var sum = 11; | 9 var sum = 11; |
| 10 var i = 35; | 10 var i = 35; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 while (j-- > 1) { | 37 while (j-- > 1) { |
| 38 if (count++ == goal) %OptimizeOsr(); | 38 if (count++ == goal) %OptimizeOsr(); |
| 39 while (k-- > 6) { | 39 while (k-- > 6) { |
| 40 if (count++ == goal) %OptimizeOsr(); | 40 if (count++ == goal) %OptimizeOsr(); |
| 41 sum = sum + j * 13; | 41 sum = sum + j * 13; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 print(count); | |
| 46 return sum; | 45 return sum; |
| 47 } | 46 } |
| 48 | 47 |
| 49 for (var i = 0; i < 13; i++) { | 48 for (var i = 0; i < 13; i++) { |
| 50 %DeoptimizeFunction(bar); | 49 %DeoptimizeFunction(bar); |
| 51 assertEquals(348, bar(i)); | 50 assertEquals(348, bar(i)); |
| 52 } | 51 } |
| OLD | NEW |