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 2 20 .limit stack 3 21 22 aload_0 23 dup 24 dup 25 astore_1 26 pop2 27 return 28 .end method 29 30 ; Test jsr and jsr_w. 31 .method public test_jsr()Ljava/lang/Object; 32 .limit locals 3 33 .limit stack 4 34 aload_0 35 jsr j1 36 aload_0 37 pop 38 ; Call j1 with different locals 39 ldc 10 40 astore_0 41 jsr j1 42 aload_0 43 pop 44 jsr j3 45 areturn 46 j1: 47 astore_2 48 jsr_w j2 49 ret 2 50 j2: 51 ; a subroutine with two returns and a catch block 52 astore_1 53 dup 54 dup 55 ; Just something that could throw an exception... 56 invokevirtual blort.test_jsr()V 57 ifnonnull j2a 58 ret_w 1 59 j2a: 60 ret_w 1 61 j3: 62 ; a subroutine that does not return 63 pop 64 areturn 65 catchBlock: 66 areturn 67 68 .catch java/lang/Throwable from j2 to j2a using catchBlock 69 .end method 70 71 72