1; Copyright (C) 2007 The Android Open Source Project 2; 3; Licensed under the Apache License, Version 2.0 (the "License"); 4; you may not use this file except in compliance with the License. 5; You may obtain a copy of the License at 6; 7; http://www.apache.org/licenses/LICENSE-2.0 8; 9; Unless required by applicable law or agreed to in writing, software 10; distributed under the License is distributed on an "AS IS" BASIS, 11; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12; See the License for the specific language governing permissions and 13; limitations under the License. 14 15.class blort 16.super java/lang/Object 17 18.method public <init>()V 19 .limit locals 1 20 21 aload_0 22 invokespecial java/lang/Object/<init>()V 23 return 24.end method 25 26; Test that an exception handler for a live range is enlivened. 27.method public test_live_exception([I)V 28 nop 29 nop 30start: 31 aload_0 32 arraylength 33end1: 34 nop 35end2: 36 return 37handler1: 38 return 39handler2: 40 return 41 .catch java/lang/RuntimeException from start to end2 using handler2 42 .catch all from start to end1 using handler1 43.end method 44 45; Test that an exception handler for a live range is dead as long as 46; the covered code can't possibly throw. 47.method public test_dead_exception()V 48 nop 49 nop 50start: 51 nop 52end1: 53 nop 54end2: 55 return 56handler1: 57 return 58handler2: 59 return 60 .catch java/lang/RuntimeException from start to end2 using handler2 61 .catch all from start to end1 using handler1 62.end method 63 64; Test all the if* variants. 65.method public test_ifs()V 66 ifeq x0 67 ifne x1 68 iflt x2 69 ifge x3 70 ifgt x4 71 ifle x5 72 if_icmpeq x6 73 if_icmpne x7 74 if_icmplt x8 75 if_icmpge x9 76 if_icmpgt x10 77 if_icmple x11 78 if_acmpeq x12 79 if_acmpne x13 80 ifnull x14 81 ifnonnull x15 82 return 83x0: 84 return 85x1: 86 return 87x2: 88 return 89x3: 90 return 91x4: 92 return 93x5: 94 return 95x6: 96 return 97x7: 98 return 99x8: 100 return 101x9: 102 return 103x10: 104 return 105x11: 106 return 107x12: 108 return 109x13: 110 return 111x14: 112 return 113x15: 114 return 115.end method 116 117; Test jsr and jsr_w. 118.method public test_jsr()V 119 jsr j1 120 jsr_w j2 121 return 122j1: 123 astore_0 124 ret 0 125j2: 126 astore_0 127 ret_w 0 128.end method 129 130; Test tableswitch. 131.method public test_tableswitch()V 132 tableswitch 0x10 133 t1 134 t2 135 default: t3 136t1: 137 return 138t2: 139 return 140t3: 141 return 142.end method 143 144; Test lookupswitch. 145.method public test_lookupswitch()V 146 lookupswitch 147 0x05: s1 148 0x10: s2 149 default: s3 150s1: 151 return 152s2: 153 return 154s3: 155 return 156.end method 157 158; Test every non-branching op. 159.method public test_nonbranch()V 160 nop 161 aconst_null 162 iconst_m1 163 iconst_0 164 iconst_1 165 iconst_2 166 iconst_3 167 iconst_4 168 iconst_5 169 lconst_0 170 lconst_1 171 fconst_0 172 fconst_1 173 fconst_2 174 dconst_0 175 dconst_1 176 bipush 0x10 177 sipush 0x1000 178 ldc "x" 179 ldc_w "y" 180 ldc2_w 3.0 181 iload 5 182 lload 5 183 fload 5 184 dload 5 185 aload 5 186 iload_0 187 iload_1 188 iload_2 189 iload_3 190 lload_0 191 lload_1 192 lload_2 193 lload_3 194 fload_0 195 fload_1 196 fload_2 197 fload_3 198 dload_0 199 dload_1 200 dload_2 201 dload_3 202 aload_0 203 aload_1 204 aload_2 205 aload_3 206 iaload 207 laload 208 faload 209 daload 210 aaload 211 baload 212 caload 213 saload 214 istore 5 215 lstore 5 216 fstore 5 217 dstore 5 218 astore 5 219 istore_0 220 istore_1 221 istore_2 222 istore_3 223 lstore_0 224 lstore_1 225 lstore_2 226 lstore_3 227 fstore_0 228 fstore_1 229 fstore_2 230 fstore_3 231 dstore_0 232 dstore_1 233 dstore_2 234 dstore_3 235 astore_0 236 astore_1 237 astore_2 238 astore_3 239 iastore 240 lastore 241 fastore 242 dastore 243 aastore 244 bastore 245 castore 246 sastore 247 pop 248 pop2 249 dup 250 dup_x1 251 dup_x2 252 dup2 253 dup2_x1 254 dup2_x2 255 swap 256 iadd 257 ladd 258 fadd 259 dadd 260 isub 261 lsub 262 fsub 263 dsub 264 imul 265 lmul 266 fmul 267 dmul 268 idiv 269 ldiv 270 fdiv 271 ddiv 272 irem 273 lrem 274 frem 275 drem 276 ineg 277 lneg 278 fneg 279 dneg 280 ishl 281 lshl 282 ishr 283 lshr 284 iushr 285 lushr 286 iand 287 land 288 ior 289 lor 290 ixor 291 lxor 292 iinc 5 0x10 293 i2l 294 i2f 295 i2d 296 l2i 297 l2f 298 l2d 299 f2i 300 f2l 301 f2d 302 d2i 303 d2l 304 d2f 305 i2b 306 i2c 307 i2s 308 lcmp 309 fcmpl 310 fcmpg 311 dcmpl 312 dcmpg 313 getstatic blort/x I 314 putstatic blort/x I 315 getfield blort/x I 316 putfield blort/x I 317 invokevirtual blort/x()V 318 invokespecial blort/x()V 319 invokestatic blort/x()V 320 invokeinterface blort/x()V 1 321 new blort 322 newarray int 323 anewarray blort 324 arraylength 325 checkcast blort 326 instanceof blort 327 monitorenter 328 monitorexit 329 iload 0x100 330 lload 0x100 331 fload 0x100 332 dload 0x100 333 aload 0x100 334 istore 0x100 335 lstore 0x100 336 fstore 0x100 337 dstore 0x100 338 astore 0x100 339 iinc 0x123 0x321 340 multianewarray [[[I 2 341 return 342.end method 343