1
2method A.<init>():void
3{
4	.src "tryCatch.java"
5	.line 2
6	.prologue_end
7	.line 2
8	    0| move-object v0, v2
9	.local v0, "this", A
10	    1| move-object v1, v0
11	    2| invoke-direct {v1}, java.lang.Throwable.<init>():void
12	    5| return-void
13}
14
15method B.<init>():void
16{
17	.src "tryCatch.java"
18	.line 6
19	.prologue_end
20	.line 6
21	    0| move-object v0, v2
22	.local v0, "this", B
23	    1| move-object v1, v0
24	    2| invoke-direct {v1}, java.lang.Throwable.<init>():void
25	    5| return-void
26}
27
28method TryCatch.<init>():void
29{
30	.src "tryCatch.java"
31	.line 10
32	.prologue_end
33	.line 10
34	    0| move-object v0, v2
35	.local v0, "this", TryCatch
36	    1| move-object v1, v0
37	    2| invoke-direct {v1}, java.lang.Object.<init>():void
38	    5| return-void
39}
40
41method TryCatch.foo(int):int
42{
43	.params "?"
44	.src "tryCatch.java"
45	.line 27
46	.prologue_end
47	.line 27
48	    0| move v0, v4
49	.local v0, "x", int
50	    1| move v1, v0
51	    2| if-lez v1, Label_4
52	.line 28
53	    4| move v1, v0
54	    5| packed-switch v1, Label_5
55	.line 31
56	    8| const/4 v1, #+1 (0x00000001 | 1.40130e-45)
57	    9| move v0, v1
58Label_1:
59	.line 34
60	.end_local v0
61	   10| return v0
62Label_2:
63	.line 29
64	.restart_local v0
65	   11| new-instance v1, A
66	   13| move-object v3, v1
67	   14| move-object v1, v3
68	   15| move-object v2, v3
69	   16| invoke-direct {v2}, A.<init>():void
70	   19| throw v1
71Label_3:
72	.line 30
73	   20| new-instance v1, B
74	   22| move-object v3, v1
75	   23| move-object v1, v3
76	   24| move-object v2, v3
77	   25| invoke-direct {v2}, B.<init>():void
78	   28| throw v1
79Label_4:
80	.line 34
81	   29| const/4 v1, #+0 (0x00000000 | 0.00000)
82	   30| move v0, v1
83	   31| goto Label_1
84Label_5: <aligned>
85	.line 28
86	   32| packed-switch-payload
87		    1: Label_2
88		    2: Label_3
89}
90
91method TryCatch.main(java.lang.String[]):void
92{
93	.params "?"
94	.src "tryCatch.java"
95	.line 15
96	.prologue_end
97	.line 15
98	    0| move-object v0, v6
99	.local v0, "args", java.lang.String[]
100	    1| const/4 v3, #+0 (0x00000000 | 0.00000)
101	.try_begin_1
102	    2| invoke-static {v3}, TryCatch.foo(int):int
103	.try_end_1
104	  catch(B) : Label_3
105	  catch(A) : Label_4
106	  catch(...) : Label_5
107	    5| move-result v3
108Label_1:
109	.line 18
110	.line 22
111	    6| sget-object v3, java.lang.System.out
112	    8| const-string v4, "finally\n"
113	   10| const/4 v5, #+0 (0x00000000 | 0.00000)
114	   11| new-array v5, v5, java.lang.Object[]
115	   13| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream
116	   16| move-result-object v3
117Label_2:
118	.line 23
119	.line 24
120	   17| return-void
121Label_3:
122	.line 16
123	   18| move-exception v3
124	   19| move-object v1, v3
125	.try_begin_2
126	.line 17
127	.local v1, "ex", B
128	   20| sget-object v3, java.lang.System.out
129	   22| const-string v4, "catch: B\n"
130	   24| const/4 v5, #+0 (0x00000000 | 0.00000)
131	   25| new-array v5, v5, java.lang.Object[]
132	   27| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream
133	.try_end_2
134	  catch(A) : Label_4
135	  catch(...) : Label_5
136	   30| move-result-object v3
137	   31| goto Label_1
138Label_4:
139	.line 19
140	.end_local v1
141	   32| move-exception v3
142	   33| move-object v1, v3
143	.try_begin_3
144	.line 20
145	.local v1, "ex", A
146	   34| sget-object v3, java.lang.System.out
147	   36| const-string v4, "catch: A\n"
148	   38| const/4 v5, #+0 (0x00000000 | 0.00000)
149	   39| new-array v5, v5, java.lang.Object[]
150	   41| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream
151	.try_end_3
152	  catch(...) : Label_5
153	   44| move-result-object v3
154	.line 22
155	   45| sget-object v3, java.lang.System.out
156	   47| const-string v4, "finally\n"
157	   49| const/4 v5, #+0 (0x00000000 | 0.00000)
158	   50| new-array v5, v5, java.lang.Object[]
159	   52| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream
160	   55| move-result-object v3
161	.line 23
162	   56| goto Label_2
163Label_5:
164	.line 22
165	.end_local v1
166	   57| move-exception v3
167	   58| move-object v2, v3
168	   59| sget-object v3, java.lang.System.out
169	   61| const-string v4, "finally\n"
170	   63| const/4 v5, #+0 (0x00000000 | 0.00000)
171	   64| new-array v5, v5, java.lang.Object[]
172	   66| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream
173	   69| move-result-object v3
174	   70| move-object v3, v2
175	   71| throw v3
176}
177