method A.():void { ............................. begin block 1 ............................. .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.():void .............................. end block 1 .............................. ............................. begin block 2 ............................. 5| return-void .............................. end block 2 .............................. } method B.():void { ............................. begin block 1 ............................. .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.():void .............................. end block 1 .............................. ............................. begin block 2 ............................. 5| return-void .............................. end block 2 .............................. } method TryCatch.():void { ............................. begin block 1 ............................. .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.():void .............................. end block 1 .............................. ............................. begin block 2 ............................. 5| return-void .............................. end block 2 .............................. } method TryCatch.foo(int):int { ............................. begin block 1 ............................. .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 .............................. end block 1 .............................. ............................. begin block 2 ............................. .line 28 4| move v1, v0 5| packed-switch v1, Label_5 .............................. end block 2 .............................. ............................. begin block 3 ............................. .line 31 8| const/4 v1, #+1 (0x00000001 | 1.40130e-45) 9| move v0, v1 .............................. end block 3 .............................. ............................. begin block 4 ............................. Label_1: .line 34 .end_local v0 10| return v0 .............................. end block 4 .............................. ............................. begin block 5 ............................. Label_2: .line 29 .restart_local v0 11| new-instance v1, A .............................. end block 5 .............................. ............................. begin block 6 ............................. 13| move-object v3, v1 14| move-object v1, v3 15| move-object v2, v3 16| invoke-direct {v2}, A.():void .............................. end block 6 .............................. ............................. begin block 7 ............................. 19| throw v1 .............................. end block 7 .............................. ............................. begin block 8 ............................. Label_3: .line 30 20| new-instance v1, B .............................. end block 8 .............................. ............................. begin block 9 ............................. 22| move-object v3, v1 23| move-object v1, v3 24| move-object v2, v3 25| invoke-direct {v2}, B.():void .............................. end block 9 .............................. ............................. begin block 10 ............................. 28| throw v1 .............................. end block 10 .............................. ............................. begin block 11 ............................. Label_4: .line 34 29| const/4 v1, #+0 (0x00000000 | 0.00000) 30| move v0, v1 31| goto Label_1 .............................. end block 11 .............................. Label_5: .line 28 32| packed-switch-payload 1: Label_2 2: Label_3 } method TryCatch.main(java.lang.String[]):void { ............................. begin block 1 ............................. .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) .............................. end block 1 .............................. .try_begin_1 ............................. begin block 2 ............................. 2| invoke-static {v3}, TryCatch.foo(int):int .............................. end block 2 .............................. .try_end_1 catch(B) : Label_3 catch(A) : Label_4 catch(...) : Label_5 ............................. begin block 3 ............................. 5| move-result v3 .............................. end block 3 .............................. ............................. begin block 4 ............................. Label_1: .line 18 .line 22 6| sget-object v3, java.lang.System.out .............................. end block 4 .............................. ............................. begin block 5 ............................. 8| const-string v4, "finally\n" .............................. end block 5 .............................. ............................. begin block 6 ............................. 10| const/4 v5, #+0 (0x00000000 | 0.00000) 11| new-array v5, v5, java.lang.Object[] .............................. end block 6 .............................. ............................. begin block 7 ............................. 13| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream .............................. end block 7 .............................. ............................. begin block 8 ............................. 16| move-result-object v3 .............................. end block 8 .............................. ............................. begin block 9 ............................. Label_2: .line 23 .line 24 17| return-void .............................. end block 9 .............................. ............................. begin block 10 ............................. Label_3: .line 16 18| move-exception v3 19| move-object v1, v3 .............................. end block 10 .............................. .try_begin_2 ............................. begin block 11 ............................. .line 17 .local v1, "ex", B 20| sget-object v3, java.lang.System.out .............................. end block 11 .............................. ............................. begin block 12 ............................. 22| const-string v4, "catch: B\n" .............................. end block 12 .............................. ............................. begin block 13 ............................. 24| const/4 v5, #+0 (0x00000000 | 0.00000) 25| new-array v5, v5, java.lang.Object[] .............................. end block 13 .............................. ............................. begin block 14 ............................. 27| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream .............................. end block 14 .............................. .try_end_2 catch(A) : Label_4 catch(...) : Label_5 ............................. begin block 15 ............................. 30| move-result-object v3 31| goto Label_1 .............................. end block 15 .............................. ............................. begin block 16 ............................. Label_4: .line 19 .end_local v1 32| move-exception v3 33| move-object v1, v3 .............................. end block 16 .............................. .try_begin_3 ............................. begin block 17 ............................. .line 20 .local v1, "ex", A 34| sget-object v3, java.lang.System.out .............................. end block 17 .............................. ............................. begin block 18 ............................. 36| const-string v4, "catch: A\n" .............................. end block 18 .............................. ............................. begin block 19 ............................. 38| const/4 v5, #+0 (0x00000000 | 0.00000) 39| new-array v5, v5, java.lang.Object[] .............................. end block 19 .............................. ............................. begin block 20 ............................. 41| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream .............................. end block 20 .............................. .try_end_3 catch(...) : Label_5 ............................. begin block 21 ............................. 44| move-result-object v3 .line 22 45| sget-object v3, java.lang.System.out .............................. end block 21 .............................. ............................. begin block 22 ............................. 47| const-string v4, "finally\n" .............................. end block 22 .............................. ............................. begin block 23 ............................. 49| const/4 v5, #+0 (0x00000000 | 0.00000) 50| new-array v5, v5, java.lang.Object[] .............................. end block 23 .............................. ............................. begin block 24 ............................. 52| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream .............................. end block 24 .............................. ............................. begin block 25 ............................. 55| move-result-object v3 .line 23 56| goto Label_2 .............................. end block 25 .............................. ............................. begin block 26 ............................. Label_5: .line 22 .end_local v1 57| move-exception v3 58| move-object v2, v3 59| sget-object v3, java.lang.System.out .............................. end block 26 .............................. ............................. begin block 27 ............................. 61| const-string v4, "finally\n" .............................. end block 27 .............................. ............................. begin block 28 ............................. 63| const/4 v5, #+0 (0x00000000 | 0.00000) 64| new-array v5, v5, java.lang.Object[] .............................. end block 28 .............................. ............................. begin block 29 ............................. 66| invoke-virtual {v3,v4,v5}, java.io.PrintStream.printf(java.lang.String, java.lang.Object[]):java.io.PrintStream .............................. end block 29 .............................. ............................. begin block 30 ............................. 69| move-result-object v3 70| move-object v3, v2 71| throw v3 .............................. end block 30 .............................. }