1/*
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24package nsk/jvmti/Exception;
25
26/* Reassembled from the following Java pattern:
27 *
28 * public class exception001a {
29 *     public static void run() {
30 *         exception001b t = new exception001b();
31 *         try {
32 *             t.meth1();
33 *         } catch (Throwable e) {}
34 *         try {
35 *             t.meth2(0);
36 *         } catch (Throwable e) {}
37 *         try {
38 *             t.meth3(2);
39 *         } catch (Throwable e) {}
40 *     }
41 * }
42 *
43 * class exception001b {
44 *     public static void meth1() throws Throwable {
45 *         throw new exception001c();
46 *     }
47 *
48 *     public int meth2(int i) throws ArithmeticException {
49 *         return (10 / i);
50 *     }
51 *
52 *     public int meth3(int i) throws IndexOutOfBoundsException {
53 *         int arr[] = {1};
54 *         return arr[i];
55 *     }
56 * }
57 *
58 * class exception001c extends Throwable {
59 * }
60 *
61 */
62
63super public class exception001a {
64
65    public Method "<init>":"()V" stack 1 locals 1 {
66        aload_0;
67        invokespecial        Method java/lang/Object."<init>":"()V";
68        return;
69    }
70
71    public static Method run:"()V" stack 2 locals 2 {
72        new     class exception001b;
73        dup;
74        invokespecial Method exception001b."<init>":"()V";
75        astore_0;
76    try t0;
77        invokestatic Method exception001b.meth1:"()V";
78    endtry t0;
79        goto    L15;
80    catch t0 java/lang/Throwable; // bci=14
81        astore_1;
82    try t1;
83L15:    aload_0;
84        iconst_0;
85        invokevirtual Method exception001b.meth2:"(I)I";
86        pop;
87    endtry t1;
88        goto    L25;
89    catch t1 java/lang/Throwable; // bci=24
90        astore_1;
91    try t2;
92L25:    aload_0;
93        iconst_2;
94        invokevirtual Method exception001b.meth3:"(I)I";
95        pop;
96    endtry t2;
97        goto    L35;
98    catch t2 java/lang/Throwable; // bci=34
99        astore_1;
100L35:    return;
101    }
102
103}
104
105super class exception001b {
106
107    Method "<init>":"()V" stack 1 locals 1 {
108        aload_0;
109        invokespecial        Method java/lang/Object."<init>":"()V";
110        return;
111    }
112
113    public static Method meth1:"()V"
114    throws java/lang/Throwable
115    stack 2 locals 0 {
116        new     class exception001c;
117        dup;
118        invokespecial Method exception001c."<init>":"()V";
119        athrow; // bci=7
120    }
121
122    public Method meth2:"(I)I"
123    throws java/lang/ArithmeticException
124    stack 2 locals 2 {
125        bipush  10;
126        iload_1;
127        idiv;   // bci=3
128        ireturn;
129    }
130
131    public Method meth3:"(I)I"
132    throws java/lang/IndexOutOfBoundsException
133    stack 4 locals 3 {
134        iconst_1;
135        newarray int;
136        dup;
137        iconst_0;
138        iconst_1;
139        iastore;
140        astore_2;
141        aload_2;
142        iload_1;
143        iaload;  // bci=10
144        ireturn;
145    }
146}
147
148super class exception001c extends java/lang/Throwable {
149
150    Method "<init>":"()V" stack 1 locals 1 {
151        aload_0;
152        invokespecial Method java/lang/Throwable."<init>":"()V";
153        return;
154    }
155
156}
157