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