summaryrefslogtreecommitdiffstats
path: root/dx/tests/032-bb-live-code/blort.j
blob: a1ec1dc484a1f501bd04f747e6f3c93af6d40625 (plain)
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
; Copyright (C) 2007 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;      http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.

.class blort
.super java/lang/Object

.method public <init>()V
    .limit locals 1

    aload_0
    invokespecial java/lang/Object/<init>()V
    return
.end method

; Test that an exception handler for a live range is enlivened.
.method public test_live_exception([I)V
    nop
    nop
start:
    aload_0
    arraylength
end1:
    nop
end2:
    return
handler1:
    return
handler2:
    return
    .catch java/lang/RuntimeException from start to end2 using handler2
    .catch all from start to end1 using handler1
.end method

; Test that an exception handler for a live range is dead as long as
; the covered code can't possibly throw.
.method public test_dead_exception()V
    nop
    nop
start:
    nop
end1:
    nop
end2:
    return
handler1:
    return
handler2:
    return
    .catch java/lang/RuntimeException from start to end2 using handler2
    .catch all from start to end1 using handler1
.end method

; Test all the if* variants.
.method public test_ifs()V
    ifeq x0
    ifne x1
    iflt x2
    ifge x3
    ifgt x4
    ifle x5
    if_icmpeq x6
    if_icmpne x7
    if_icmplt x8
    if_icmpge x9
    if_icmpgt x10
    if_icmple x11
    if_acmpeq x12
    if_acmpne x13
    ifnull x14
    ifnonnull x15
    return
x0:
    return
x1:
    return
x2:
    return
x3:
    return
x4:
    return
x5:
    return
x6:
    return
x7:
    return
x8:
    return
x9:
    return
x10:
    return
x11:
    return
x12:
    return
x13:
    return
x14:
    return
x15:
    return
.end method

; Test jsr and jsr_w.
.method public test_jsr()V
    jsr j1
    jsr_w j2
    return
j1:
    astore_0
    ret 0
j2:
    astore_0
    ret_w 0
.end method

; Test tableswitch.
.method public test_tableswitch()V
    tableswitch 0x10
        t1
        t2
        default: t3
t1:
    return
t2:
    return
t3:
    return
.end method

; Test lookupswitch.
.method public test_lookupswitch()V
    lookupswitch
        0x05: s1
        0x10: s2
        default: s3
s1:
    return
s2:
    return
s3:
    return
.end method

; Test every non-branching op.
.method public test_nonbranch()V
    nop
    aconst_null
    iconst_m1
    iconst_0
    iconst_1
    iconst_2
    iconst_3
    iconst_4
    iconst_5
    lconst_0
    lconst_1
    fconst_0
    fconst_1
    fconst_2
    dconst_0
    dconst_1
    bipush 0x10
    sipush 0x1000
    ldc "x"
    ldc_w "y"
    ldc2_w 3.0
    iload 5
    lload 5
    fload 5
    dload 5
    aload 5
    iload_0
    iload_1
    iload_2
    iload_3
    lload_0
    lload_1
    lload_2
    lload_3
    fload_0
    fload_1
    fload_2
    fload_3
    dload_0
    dload_1
    dload_2
    dload_3
    aload_0
    aload_1
    aload_2
    aload_3
    iaload
    laload
    faload
    daload
    aaload
    baload
    caload
    saload
    istore 5
    lstore 5
    fstore 5
    dstore 5
    astore 5
    istore_0
    istore_1
    istore_2
    istore_3
    lstore_0
    lstore_1
    lstore_2
    lstore_3
    fstore_0
    fstore_1
    fstore_2
    fstore_3
    dstore_0
    dstore_1
    dstore_2
    dstore_3
    astore_0
    astore_1
    astore_2
    astore_3
    iastore
    lastore
    fastore
    dastore
    aastore
    bastore
    castore
    sastore
    pop
    pop2
    dup
    dup_x1
    dup_x2
    dup2
    dup2_x1
    dup2_x2
    swap
    iadd
    ladd
    fadd
    dadd
    isub
    lsub
    fsub
    dsub
    imul
    lmul
    fmul
    dmul
    idiv
    ldiv
    fdiv
    ddiv
    irem
    lrem
    frem
    drem
    ineg
    lneg
    fneg
    dneg
    ishl
    lshl
    ishr
    lshr
    iushr
    lushr
    iand
    land
    ior
    lor
    ixor
    lxor
    iinc 5 0x10
    i2l
    i2f
    i2d
    l2i
    l2f
    l2d
    f2i
    f2l
    f2d
    d2i
    d2l
    d2f
    i2b
    i2c
    i2s
    lcmp
    fcmpl
    fcmpg
    dcmpl
    dcmpg
    getstatic blort/x I
    putstatic blort/x I
    getfield blort/x I
    putfield blort/x I
    invokevirtual blort/x()V
    invokespecial blort/x()V
    invokestatic blort/x()V
    invokeinterface blort/x()V 1
    new blort
    newarray int
    anewarray blort
    arraylength
    checkcast blort
    instanceof blort
    monitorenter
    monitorexit
    iload 0x100
    lload 0x100
    fload 0x100
    dload 0x100
    aload 0x100
    istore 0x100
    lstore 0x100
    fstore 0x100
    dstore 0x100
    astore 0x100
    iinc 0x123 0x321
    multianewarray [[[I 2
    return
.end method