1 /*
  2  * Copyright (c) 2020, 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 // These classes are based on the following source.  The return type of factory
 25 // method <init> in class HiddenPoint was changed to java.lang.Object because
 26 // HiddenPoint will be defined as an inline hidden class.
 27 //
 28 //  inline class HiddenPoint {
 29 //      int x;
 30 //      int y;
 31 //
 32 //      HiddenPoint() {
 33 //          this.x = 0;
 34 //          this.y = 0;
 35 //      }
 36 //      public String getValue() {
 37 //          return "x: " + x + ", y: " + y;
 38 //      }
 39 //  }
 40 
 41 class HiddenPoint$ref {
 42   0xCAFEBABE;
 43   0; // minor version
 44   62; // version
 45   [7] { // Constant Pool
 46     ; // first element is empty
 47     class #2; // #1     at 0x0A
 48     Utf8 "HiddenPoint$ref"; // #2     at 0x0D
 49     class #4; // #3     at 0x1F
 50     Utf8 "java/lang/Object"; // #4     at 0x22
 51     Utf8 "SourceFile"; // #5     at 0x35
 52     Utf8 "HiddenPoint.java"; // #6     at 0x42
 53   } // Constant Pool
 54 
 55   0x0420; // access [ ACC_SUPER ACC_ABSTRACT ]
 56   #1;// this_cpx
 57   #3;// super_cpx
 58 
 59   [0] { // Interfaces
 60   } // Interfaces
 61 
 62   [0] { // fields
 63   } // fields
 64 
 65   [0] { // methods
 66   } // methods
 67 
 68   [1] { // Attributes
 69     Attr(#5, 2) { // SourceFile at 0x63
 70       #6;
 71     } // end SourceFile
 72   } // Attributes
 73 } // end class HiddenPoint$ref
 74 
 75 class HiddenPoint {
 76   0xCAFEBABE;
 77   0; // minor version
 78   62; // version
 79   [60] { // Constant Pool
 80     ; // first element is empty
 81     class #2; // #1     at 0x0A
 82     Utf8 "HiddenPoint"; // #2     at 0x0D
 83     Field #1 #4; // #3     at 0x1B
 84     NameAndType #5 #6; // #4     at 0x20
 85     Utf8 "x"; // #5     at 0x25
 86     Utf8 "I"; // #6     at 0x29
 87     Field #1 #8; // #7     at 0x2D
 88     NameAndType #9 #6; // #8     at 0x32
 89     Utf8 "y"; // #9     at 0x37
 90     InvokeDynamic 0s #11; // #10     at 0x3B
 91     NameAndType #12 #13; // #11     at 0x40
 92     Utf8 "makeConcatWithConstants"; // #12     at 0x45
 93     Utf8 "(II)Ljava/lang/String;"; // #13     at 0x5F
 94     InvokeDynamic 1s #15; // #14     at 0x78
 95     NameAndType #16 #17; // #15     at 0x7D
 96     Utf8 "hashCode"; // #16     at 0x82
 97     Utf8 "(QHiddenPoint;)I"; // #17     at 0x8D
 98     InvokeDynamic 1s #19; // #18     at 0xA0
 99     NameAndType #20 #21; // #19     at 0xA5
100     Utf8 "equals"; // #20     at 0xAA
101     Utf8 "(QHiddenPoint;Ljava/lang/Object;)Z"; // #21     at 0xB3
102     InvokeDynamic 1s #23; // #22     at 0xD8
103     NameAndType #24 #25; // #23     at 0xDD
104     Utf8 "toString"; // #24     at 0xE2
105     Utf8 "(QHiddenPoint;)Ljava/lang/String;"; // #25     at 0xED
106     class #27; // #26     at 0x0111
107     Utf8 "HiddenPoint$ref"; // #27     at 0x0114
108     Utf8 "getValue"; // #28     at 0x0126
109     Utf8 "()Ljava/lang/String;"; // #29     at 0x0131
110     Utf8 "Code"; // #30     at 0x0148
111     Utf8 "LineNumberTable"; // #31     at 0x014F
112     Utf8 "()I"; // #32     at 0x0161
113     Utf8 "(Ljava/lang/Object;)Z"; // #33     at 0x0167
114     Utf8 "<init>"; // #34     at 0x017F
115     Utf8 "()Ljava/lang/Object;"; // #35     at 0x0188
116     Utf8 "SourceFile"; // #36     at 0x019A
117     Utf8 "HiddenPoint.java"; // #37     at 0x01A7
118     Utf8 "BootstrapMethods"; // #38     at 0x01BA
119     MethodHandle 6b #40; // #39     at 0x01CD
120     Method #41 #42; // #40     at 0x01D1
121     class #43; // #41     at 0x01D6
122     NameAndType #12 #44; // #42     at 0x01D9
123     Utf8 "java/lang/invoke/StringConcatFactory"; // #43     at 0x01DE
124     Utf8 "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;"; // #44     at 0x0205
125     String #46; // #45     at 0x02A0
126     Utf8 "x: , y: "; // #46     at 0x02A3
127     MethodHandle 6b #48; // #47     at 0x02B0
128     Method #49 #50; // #48     at 0x02B4
129     class #51; // #49     at 0x02B9
130     NameAndType #52 #53; // #50     at 0x02BC
131     Utf8 "java/lang/invoke/ValueBootstrapMethods"; // #51     at 0x02C1
132     Utf8 "makeBootstrapMethod"; // #52     at 0x02EA
133     Utf8 "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"; // #53     at 0x0300
134     Utf8 "InnerClasses"; // #54     at 0x0376
135     class #56; // #55     at 0x0385
136     Utf8 "java/lang/invoke/MethodHandles$Lookup"; // #56     at 0x0388
137     class #58; // #57     at 0x03B0
138     Utf8 "java/lang/invoke/MethodHandles"; // #58     at 0x03B3
139     Utf8 "Lookup"; // #59     at 0x03D4
140   } // Constant Pool
141 
142   0x0130; // access [ ACC_SUPER ACC_FINAL ]
143   #1;// this_cpx
144   #26;// super_cpx
145 
146   [0] { // Interfaces
147   } // Interfaces
148 
149   [2] { // fields
150     { // Member at 0x03E7
151       0x0010; // access
152       #5; // name_cpx
153       #6; // sig_cpx
154       [0] { // Attributes
155       } // Attributes
156     } // Member
157     ;
158     { // Member at 0x03EF
159       0x0010; // access
160       #9; // name_cpx
161       #6; // sig_cpx
162       [0] { // Attributes
163       } // Attributes
164     } // Member
165   } // fields
166 
167   [2] { // methods
168     { // Member at 0x03F9
169       0x0001; // access
170       #28; // name_cpx
171       #29; // sig_cpx
172       [1] { // Attributes
173         Attr(#30, 38) { // Code at 0x0401
174           2; // max_stack
175           1; // max_locals
176           Bytes[14]{
177             0x2AB400032AB40007;
178             0xBA000A0000B0;
179           }
180           [0] { // Traps
181           } // end Traps
182           [1] { // Attributes
183             Attr(#31, 6) { // LineNumberTable at 0x0421
184               [1] { // LineNumberTable
185                 0  9; //  at 0x042D
186               }
187             } // end LineNumberTable
188           } // Attributes
189         } // end Code
190       } // Attributes
191     } // Member
192     ;
193     { // Member at 0x04B5
194       0x0008; // access
195       #34; // name_cpx
196       #35; // sig_cpx
197       [1] { // Attributes
198         Attr(#30, 56) { // Code at 0x04BD
199           2; // max_stack
200           1; // max_locals
201           Bytes[20]{
202             0xCB00014B032A5FCC;
203             0x00034B032A5FCC00;
204             0x074B2AB0;
205           }
206           [0] { // Traps
207           } // end Traps
208           [1] { // Attributes
209             Attr(#31, 18) { // LineNumberTable at 0x04E3
210               [4] { // LineNumberTable
211                 0  4; //  at 0x04EF
212                 4  5; //  at 0x04F3
213                 11  6; //  at 0x04F7
214                 18  7; //  at 0x04FB
215               }
216             } // end LineNumberTable
217           } // Attributes
218         } // end Code
219       } // Attributes
220     } // Member
221   } // methods
222 
223   [3] { // Attributes
224     Attr(#36, 2) { // SourceFile at 0x04FD
225       #37;
226     } // end SourceFile
227     ;
228     Attr(#38, 12) { // BootstrapMethods at 0x0505
229       [2] { // bootstrap_methods
230         {  //  bootstrap_method
231           #39; // bootstrap_method_ref
232           [1] { // bootstrap_arguments
233             #45; //  at 0x0513
234           }  //  bootstrap_arguments
235         }  //  bootstrap_method
236         ;
237         {  //  bootstrap_method
238           #47; // bootstrap_method_ref
239           [0] { // bootstrap_arguments
240           }  //  bootstrap_arguments
241         }  //  bootstrap_method
242       }
243     } // end BootstrapMethods
244     ;
245     Attr(#54, 10) { // InnerClasses at 0x0517
246       [1] { // InnerClasses
247         #55 #57 #59 25; //  at 0x0527
248       }
249     } // end InnerClasses
250   } // Attributes
251 } // end class HiddenPoint