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 
 24 super public class fieldacc01a {
 25 
 26     static Field staticBoolean:Z;
 27     static Field staticByte:B;
 28     static Field staticShort:S;
 29     static Field staticInt:I;
 30     static Field staticLong:J;
 31     static Field staticFloat:F;
 32     static Field staticDouble:D;
 33     static Field staticChar:C;
 34     static Field staticObject:"Ljava/lang/Object;";
 35     static Field staticArrInt:"[I";
 36     Field instanceBoolean:Z;
 37     Field instanceByte:B;
 38     Field instanceShort:S;
 39     Field instanceInt:I;
 40     Field instanceLong:J;
 41     Field instanceFloat:F;
 42     Field instanceDouble:D;
 43     Field instanceChar:C;
 44     Field instanceObject:"Ljava/lang/Object;";
 45     Field instanceArrInt:"[I";
 46 
 47     public Method "<init>":"()V" stack 5 locals 1 {
 48         aload_0;
 49         invokespecial Method java/lang/Object."<init>":"()V";
 50         aload_0;
 51         iconst_0;
 52         putfield    Field instanceBoolean:"Z";
 53         aload_0;
 54         bipush      10;
 55         putfield    Field instanceByte:"B";
 56         aload_0;
 57         bipush      20;
 58         putfield    Field instanceShort:"S";
 59         aload_0;
 60         bipush      30;
 61         putfield    Field instanceInt:"I";
 62         aload_0;
 63         ldc2_w      long 40l;
 64         putfield    Field instanceLong:"J";
 65         aload_0;
 66         ldc         float 0.05f;
 67         putfield    Field instanceFloat:"F";
 68         aload_0;
 69         ldc2_w      double 0.06d;
 70         putfield    Field instanceDouble:"D";
 71         aload_0;
 72         bipush      122;
 73         putfield    Field instanceChar:"C";
 74         aload_0;
 75         new class java/lang/Object;
 76         dup;
 77         invokespecial Method java/lang/Object."<init>":"()V";
 78         putfield    Field instanceObject:"Ljava/lang/Object;";
 79         aload_0;
 80         iconst_2;
 81         newarray    int;
 82         dup;
 83         iconst_0;
 84         bipush      70;
 85         iastore;
 86         dup;
 87         iconst_1;
 88         bipush      80;
 89         iastore;
 90         putfield    Field instanceArrInt:"[I";
 91         return;
 92     }
 93 
 94     public Method run:"()I" stack 4 locals 2 {
 95         iconst_0;
 96         istore_1;
 97         getstatic   Field staticBoolean:"Z";    // bci=2
 98         aload_0;
 99         getfield    Field instanceBoolean:"Z";  // bci=6
100         if_icmpne   L15;
101         iinc        1, 1;
102 L15:    getstatic   Field staticByte:"B";       // bci=15
103         aload_0;
104         getfield    Field instanceByte:"B";     // bci=19
105         if_icmpne   L28;
106         iinc        1, 1;
107 L28:    getstatic   Field staticShort:"S";      // bci=28
108         aload_0;
109         getfield    Field instanceShort:"S";    // bci=32
110         if_icmpne   L41;
111         iinc        1, 1;
112 L41:    getstatic   Field staticInt:"I";        // bci=41
113         aload_0;
114         getfield    Field instanceInt:"I";      // bci=45
115         if_icmpne   L54;
116         iinc        1, 1;
117 L54:    getstatic   Field staticLong:"J";       // bci=54
118         aload_0;
119         getfield    Field instanceLong:"J";     // bci=58
120         lcmp;
121         ifne        L68;
122         iinc        1, 1;
123 L68:    getstatic   Field staticFloat:"F";      // bci=68
124         aload_0;
125         getfield    Field instanceFloat:"F";    // bci=72
126         fcmpl;
127         ifne        L82;
128         iinc        1, 1;
129 L82:    getstatic   Field staticDouble:"D";     // bci=82
130         aload_0;
131         getfield    Field instanceDouble:"D";   // bci=86
132         dcmpl;
133         ifne    L96;
134         iinc        1, 1;
135 L96:    getstatic   Field staticChar:"C";       // bci=96
136         aload_0;
137         getfield    Field instanceChar:"C";     // bci=100
138         if_icmpne   L109;
139         iinc        1, 1;
140 L109:   getstatic   Field staticObject:"Ljava/lang/Object;"; // bci=109
141         aload_0;
142         getfield    Field instanceObject:"Ljava/lang/Object;"; // bci=113
143         if_acmpne   L122;
144         iinc        1, 1;
145 L122:   getstatic   Field staticArrInt:"[I";    // bci=122
146         iconst_0;
147         iaload;
148         aload_0;
149         getfield    Field instanceArrInt:"[I";  // bci=128
150         iconst_1;
151         iaload;
152         if_icmpne   L139;
153         iinc        1, 1;
154 L139:   iload_1;
155         ireturn;
156     }
157 
158     static Method "<clinit>":"()V" stack 4 locals 0 {
159         iconst_1;
160         putstatic   Field staticBoolean:"Z";
161         iconst_1;
162         putstatic   Field staticByte:"B";
163         iconst_2;
164         putstatic   Field staticShort:"S";
165         iconst_3;
166         putstatic   Field staticInt:"I";
167         ldc2_w      long 4l;
168         putstatic   Field staticLong:"J";
169         ldc         float 0.5f;
170         putstatic   Field staticFloat:"F";
171         ldc2_w      double 0.6d;
172         putstatic   Field staticDouble:"D";
173         bipush      97;
174         putstatic   Field staticChar:"C";
175         aconst_null;
176         putstatic   Field staticObject:"Ljava/lang/Object;";
177         iconst_2;
178         newarray    int;
179         dup;
180         iconst_0;
181         bipush      7;
182         iastore;
183         dup;
184         iconst_1;
185         bipush      8;
186         iastore;
187         putstatic   Field staticArrInt:"[I";
188         return;
189     }
190 
191 }