Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: test/mjsunit/compiler/try-deopt.js

Issue 972943004: [turbofan] Add test coverage for deopt within try-catch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/compiler/test-run-jsexceptions.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // TODO(mstarzinger): Add FLAG_turbo_exceptions once we want ClusterFuzz.
6 // Flags: --allow-natives-syntax --turbo-deoptimization
7
8 function DeoptFromTry(x) {
9 try {
10 %DeoptimizeFunction(DeoptFromTry);
11 throw x;
12 } catch (e) {
13 return e + 1;
14 }
15 return x + 2;
16 }
17 %OptimizeFunctionOnNextCall(DeoptFromTry);
18 assertEquals(24, DeoptFromTry(23));
19
20
21 function DeoptFromCatch(x) {
22 try {
23 throw x;
24 } catch (e) {
25 %DeoptimizeFunction(DeoptFromCatch);
26 return e + 1;
27 }
28 return x + 2;
29 }
30 %OptimizeFunctionOnNextCall(DeoptFromCatch);
31 assertEquals(24, DeoptFromCatch(23));
32
33
34 function DeoptFromFinally_Return(x) {
35 try {
36 throw x;
37 } finally {
38 %DeoptimizeFunction(DeoptFromFinally_Return);
39 return x + 1;
40 }
41 return x + 2;
42 }
43 %OptimizeFunctionOnNextCall(DeoptFromFinally_Return);
44 assertEquals(24, DeoptFromFinally_Return(23));
45
46
47 function DeoptFromFinally_ReThrow(x) {
48 try {
49 throw x;
50 } finally {
51 %DeoptimizeFunction(DeoptFromFinally_ReThrow);
52 }
53 return x + 2;
54 }
55 %OptimizeFunctionOnNextCall(DeoptFromFinally_ReThrow);
56 assertThrows("DeoptFromFinally_ReThrow(new Error)", Error);
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-jsexceptions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698