| 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: --use-osr --allow-natives-syntax | 5 // Flags: --use-osr --allow-natives-syntax |
| 6 | 6 |
| 7 var global_counter = 0; | 7 var global_counter = 0; |
| 8 | 8 |
| 9 function thrower() { | 9 function thrower() { |
| 10 var x = global_counter++; | 10 var x = global_counter++; |
| 11 if (x == 5) %OptimizeOsr(thrower.caller); | 11 if (x == 5) %OptimizeOsr(1); |
| 12 if (x == 10) throw "terminate"; | 12 if (x == 10) throw "terminate"; |
| 13 } | 13 } |
| 14 | 14 |
| 15 %NeverOptimizeFunction(thrower); // Don't want to inline the thrower. | 15 %NeverOptimizeFunction(thrower); // Don't want to inline the thrower. |
| 16 %NeverOptimizeFunction(test); // Don't want to inline the func into test. | 16 %NeverOptimizeFunction(test); // Don't want to inline the func into test. |
| 17 | 17 |
| 18 function test(func) { | 18 function test(func) { |
| 19 for (var i = 0; i < 3; i++) { | 19 for (var i = 0; i < 3; i++) { |
| 20 global_counter = 0; | 20 global_counter = 0; |
| 21 assertThrows(func); | 21 assertThrows(func); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 | 71 |
| 72 test(n1); | 72 test(n1); |
| 73 test(n2); | 73 test(n2); |
| 74 test(n3); | 74 test(n3); |
| 75 test(n4); | 75 test(n4); |
| 76 test(b1); | 76 test(b1); |
| 77 test(b2); | 77 test(b2); |
| 78 test(b3); | 78 test(b3); |
| OLD | NEW |