OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 (function InlinedThrowAtEndOfTry() { |
| 8 function g() { |
| 9 %DeoptimizeFunction(f); |
| 10 throw "boom"; |
| 11 } |
| 12 function f() { |
| 13 try { |
| 14 g(); // Right at the end of try. |
| 15 } catch (e) { |
| 16 assertEquals("boom", e) |
| 17 } |
| 18 } |
| 19 assertDoesNotThrow(f); |
| 20 assertDoesNotThrow(f); |
| 21 %OptimizeFunctionOnNextCall(f); |
| 22 assertDoesNotThrow(f); |
| 23 })(); |
| 24 |
| 25 (function InlinedThrowInFrontOfTry() { |
| 26 function g() { |
| 27 %DeoptimizeFunction(f); |
| 28 throw "boom"; |
| 29 } |
| 30 function f() { |
| 31 g(); // Right in front of try. |
| 32 try { |
| 33 Math.random(); |
| 34 } catch (e) { |
| 35 assertUnreachable(); |
| 36 } |
| 37 } |
| 38 assertThrows(f); |
| 39 assertThrows(f); |
| 40 %OptimizeFunctionOnNextCall(f); |
| 41 assertThrows(f); |
| 42 })(); |
OLD | NEW |