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 // TODO(mstarzinger): Add FLAG_turbo_exceptions once we want ClusterFuzz. | |
6 // Flags: --allow-natives-syntax --turbo-deoptimization | 5 // Flags: --allow-natives-syntax --turbo-deoptimization |
7 | 6 |
8 function DeoptFromTry(x) { | 7 function DeoptFromTry(x) { |
9 try { | 8 try { |
10 %DeoptimizeFunction(DeoptFromTry); | 9 %DeoptimizeFunction(DeoptFromTry); |
11 throw x; | 10 throw x; |
12 } catch (e) { | 11 } catch (e) { |
13 return e + 1; | 12 return e + 1; |
14 } | 13 } |
15 return x + 2; | 14 return x + 2; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 function DeoptFromFinally_ReThrow(x) { | 46 function DeoptFromFinally_ReThrow(x) { |
48 try { | 47 try { |
49 throw x; | 48 throw x; |
50 } finally { | 49 } finally { |
51 %DeoptimizeFunction(DeoptFromFinally_ReThrow); | 50 %DeoptimizeFunction(DeoptFromFinally_ReThrow); |
52 } | 51 } |
53 return x + 2; | 52 return x + 2; |
54 } | 53 } |
55 %OptimizeFunctionOnNextCall(DeoptFromFinally_ReThrow); | 54 %OptimizeFunctionOnNextCall(DeoptFromFinally_ReThrow); |
56 assertThrows("DeoptFromFinally_ReThrow(new Error)", Error); | 55 assertThrows("DeoptFromFinally_ReThrow(new Error)", Error); |
OLD | NEW |