1 /*
  2  * Copyright (c) 2020, 2022, 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 {
 42   0xCAFEBABE;
 43   0; // minor version
 44   63; // version
 45   [40] { // Constant Pool
 46     ; // first element is empty
 47     class #2; // #1     at 0x0A
 48     Utf8 "HiddenPoint"; // #2     at 0x0D
 49     Field #1 #4; // #3     at 0x1B
 50     NameAndType #5 #6; // #4     at 0x20
 51     Utf8 "x"; // #5     at 0x25
 52     Utf8 "I"; // #6     at 0x29
 53     Field #1 #8; // #7     at 0x2D
 54     NameAndType #9 #6; // #8     at 0x32
 55     Utf8 "y"; // #9     at 0x37
 56     InvokeDynamic 0s #11; // #10     at 0x3B
 57     NameAndType #12 #13; // #11     at 0x40
 58     Utf8 "makeConcatWithConstants"; // #12     at 0x45
 59     Utf8 "(II)Ljava/lang/String;"; // #13     at 0x5F
 60     class #15; // #14     at 0x78
 61     Utf8 "java/lang/Object"; // #15     at 0x7B
 62     Utf8 "getValue"; // #16     at 0x8E
 63     Utf8 "()Ljava/lang/String;"; // #17     at 0x99
 64     Utf8 "Code"; // #18     at 0xB0
 65     Utf8 "LineNumberTable"; // #19     at 0xB7
 66     Utf8 "<init>"; // #20     at 0xC9
 67     Utf8 "()Ljava/lang/Object;"; // #21     at 0xD2
 68     Utf8 "SourceFile"; // #22     at 0xE4
 69     Utf8 "HiddenPoint.java"; // #23     at 0xF1
 70     Utf8 "BootstrapMethods"; // #24     at 0x0104
 71     MethodHandle 6b #26; // #25     at 0x0117
 72     Method #27 #28; // #26     at 0x011B
 73     class #29; // #27     at 0x0120
 74     NameAndType #12 #30; // #28     at 0x0123
 75     Utf8 "java/lang/invoke/StringConcatFactory"; // #29     at 0x0128
 76     Utf8 "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;"; // #30     at 0x014F
 77     String #32; // #31     at 0x01EA
 78     Utf8 "x: , y: "; // #32     at 0x01ED
 79     Utf8 "InnerClasses"; // #33     at 0x01FA
 80     class #35; // #34     at 0x0209
 81     Utf8 "java/lang/invoke/MethodHandles$Lookup"; // #35     at 0x020C
 82     class #37; // #36     at 0x0234
 83     Utf8 "java/lang/invoke/MethodHandles"; // #37     at 0x0237
 84     Utf8 "Lookup"; // #38     at 0x0258
 85     Utf8 "Preload"; // #39     at 0x0261
 86   } // Constant Pool
 87 
 88   0x0050; // access [ ACC_VALUE ACC_FINAL ]
 89   #1;// this_cpx
 90   #14;// super_cpx
 91 
 92   [0] { // Interfaces
 93   } // Interfaces
 94 
 95   [2] { // Fields
 96     {  // field at 0x0275
 97       0x0010; // access
 98       #5; // name_index       : x
 99       #6; // descriptor_index : I
100       [0] { // Attributes
101       } // Attributes
102     }
103     ;
104     {  // field at 0x027D
105       0x0010; // access
106       #9; // name_index       : y
107       #6; // descriptor_index : I
108       [0] { // Attributes
109       } // Attributes
110     }
111   } // Fields
112 
113   [2] { // Methods
114     {  // method at 0x0287
115       0x0001; // access
116       #16; // name_index       : getValue
117       #17; // descriptor_index : ()Ljava/lang/String;
118       [1] { // Attributes
119         Attr(#18, 38) { // Code at 0x028F
120           2; // max_stack
121           1; // max_locals
122           Bytes[14]{
123             0x2AB400032AB40007;
124             0xBA000A0000B0;
125           }
126           [0] { // Traps
127           } // end Traps
128           [1] { // Attributes
129             Attr(#19, 6) { // LineNumberTable at 0x02AF
130               [1] { // line_number_table
131                 0  10; //  at 0x02BB
132               }
133             } // end LineNumberTable
134           } // Attributes
135         } // end Code
136       } // Attributes
137     }
138     ;
139     {  // method at 0x02BB
140       0x0008; // access
141       #20; // name_index       : <init>
142       #21; // descriptor_index : ()LHiddenPoint;
143       [1] { // Attributes
144         Attr(#18, 56) { // Code at 0x02C3
145           2; // max_stack
146           1; // max_locals
147           Bytes[20]{
148             0xCB00014B032A5FCC;
149             0x00034B032A5FCC00;
150             0x074B2AB0;
151           }
152           [0] { // Traps
153           } // end Traps
154           [1] { // Attributes
155             Attr(#19, 18) { // LineNumberTable at 0x02E9
156               [4] { // line_number_table
157                 0  5; //  at 0x02F5
158                 4  6; //  at 0x02F9
159                 11  7; //  at 0x02FD
160                 18  8; //  at 0x0301
161               }
162             } // end LineNumberTable
163           } // Attributes
164         } // end Code
165       } // Attributes
166     }
167   } // Methods
168 
169   [4] { // Attributes
170     Attr(#22, 2) { // SourceFile at 0x0303
171       #23;
172     } // end SourceFile
173     ;
174     Attr(#24, 8) { // BootstrapMethods at 0x030B
175       [1] { // bootstrap_methods
176         {  //  bootstrap_method
177           #25; // bootstrap_method_ref
178           [1] { // bootstrap_arguments
179             #31; //  at 0x0319
180           }  //  bootstrap_arguments
181         }  //  bootstrap_method
182       }
183     } // end BootstrapMethods
184     ;
185     Attr(#33, 10) { // InnerClasses at 0x0319
186       [1] { // classes
187         #34 #36 #38 25; //  at 0x0329
188       }
189     } // end InnerClasses
190     ;
191     Attr(#39, 4) { // Preload at 0x0329
192       0x00010001;
193     } // end Preload
194   } // Attributes
195 } // end class HiddenPoint