1 /*
  2  * Copyright (c) 2022, 2024, 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 package compiler.valhalla.inlinetypes;
 25 
 26 import compiler.lib.ir_framework.IRNode;
 27 
 28 public class InlineTypeIRNode {
 29     private static final String PREFIX = "_#";
 30     private static final String POSTFIX = "#I_";
 31     public static final String ALLOC_G = PREFIX + "ALLOC_G" + POSTFIX;
 32     static {
 33         IRNode.optoOnly(ALLOC_G, InlineTypeRegexes.ALLOC_G);
 34     }
 35 
 36     public static final String ALLOCA_G = PREFIX + "ALLOCA_G" + POSTFIX;
 37     static {
 38         IRNode.optoOnly(ALLOCA_G, InlineTypeRegexes.ALLOCA_G);
 39     }
 40 
 41     public static final String MYVALUE_ARRAY_KLASS = PREFIX + "MYVALUE_ARRAY_KLASS" + POSTFIX;    static {
 42         IRNode.optoOnly(MYVALUE_ARRAY_KLASS, InlineTypeRegexes.MYVALUE_ARRAY_KLASS);
 43     }
 44 
 45     public static final String ALLOC = PREFIX + "ALLOC" + POSTFIX;
 46     static {
 47         IRNode.optoOnly(ALLOC, InlineTypeRegexes.ALLOC);
 48     }
 49 
 50     public static final String ALLOCA = PREFIX + "ALLOCA" + POSTFIX;
 51     static {
 52         IRNode.optoOnly(ALLOCA, InlineTypeRegexes.ALLOCA);
 53     }
 54 
 55     public static final String LOAD = PREFIX + "LOAD" + POSTFIX;
 56     static {
 57         IRNode.beforeMatching(LOAD, InlineTypeRegexes.LOAD);
 58     }
 59 
 60     public static final String LOADK = PREFIX + "LOADK" + POSTFIX;
 61     static {
 62         IRNode.beforeMatching(LOADK, InlineTypeRegexes.LOADK);
 63     }
 64 
 65     public static final String STORE = PREFIX + "STORE" + POSTFIX;
 66     static {
 67         IRNode.beforeMatching(STORE, InlineTypeRegexes.STORE);
 68     }
 69 
 70     public static final String LOOP = PREFIX + "LOOP" + POSTFIX;
 71     static {
 72         IRNode.beforeMatching(LOOP, InlineTypeRegexes.LOOP);
 73     }
 74 
 75     public static final String COUNTEDLOOP = PREFIX + "COUNTEDLOOP" + POSTFIX;
 76     static {
 77         IRNode.beforeMatching(COUNTEDLOOP, InlineTypeRegexes.COUNTEDLOOP);
 78     }
 79 
 80     public static final String COUNTEDLOOP_MAIN = PREFIX + "COUNTEDLOOP_MAIN" + POSTFIX;
 81     static {
 82         IRNode.beforeMatching(COUNTEDLOOP_MAIN, InlineTypeRegexes.COUNTEDLOOP_MAIN);
 83     }
 84 
 85     public static final String TRAP = PREFIX + "TRAP" + POSTFIX;
 86     static {
 87         IRNode.beforeMatching(TRAP, InlineTypeRegexes.TRAP);
 88     }
 89 
 90     public static final String LINKTOSTATIC = PREFIX + "LINKTOSTATIC" + POSTFIX;
 91     static {
 92         IRNode.beforeMatching(LINKTOSTATIC, InlineTypeRegexes.LINKTOSTATIC);
 93     }
 94 
 95     public static final String NPE = PREFIX + "NPE" + POSTFIX;
 96     static {
 97         IRNode.beforeMatching(NPE, InlineTypeRegexes.NPE);
 98     }
 99 
100     public static final String CALL = PREFIX + "CALL" + POSTFIX;
101     static {
102         IRNode.beforeMatching(CALL, InlineTypeRegexes.CALL);
103     }
104 
105     public static final String CALL_LEAF = PREFIX + "CALL_LEAF" + POSTFIX;
106     static {
107         IRNode.optoOnly(CALL_LEAF, InlineTypeRegexes.CALL_LEAF);
108     }
109 
110     public static final String CALL_LEAF_NOFP = PREFIX + "CALL_LEAF_NOFP" + POSTFIX;
111     static {
112         IRNode.optoOnly(CALL_LEAF_NOFP, InlineTypeRegexes.CALL_LEAF_NOFP);
113     }
114 
115     public static final String CALL_UNSAFE = PREFIX + "CALL_UNSAFE" + POSTFIX;
116     static {
117         IRNode.beforeMatching(CALL_UNSAFE, InlineTypeRegexes.CALL_UNSAFE);
118     }
119 
120     public static final String STORE_INLINE_FIELDS = PREFIX + "STORE_INLINE_FIELDS" + POSTFIX;
121     static {
122         IRNode.beforeMatching(STORE_INLINE_FIELDS, InlineTypeRegexes.STORE_INLINE_FIELDS);
123     }
124 
125     public static final String SCOBJ = PREFIX + "SCOBJ" + POSTFIX;
126     static {
127         IRNode.optoOnly(SCOBJ, InlineTypeRegexes.SCOBJ);
128     }
129 
130     public static final String LOAD_UNKNOWN_INLINE = PREFIX + "LOAD_UNKNOWN_INLINE" + POSTFIX;
131     static {
132         IRNode.beforeMatching(LOAD_UNKNOWN_INLINE, InlineTypeRegexes.LOAD_UNKNOWN_INLINE);
133     }
134 
135     public static final String STORE_UNKNOWN_INLINE = PREFIX + "STORE_UNKNOWN_INLINE" + POSTFIX;
136     static {
137         IRNode.optoOnly(STORE_UNKNOWN_INLINE, InlineTypeRegexes.STORE_UNKNOWN_INLINE);
138     }
139 
140     public static final String INLINE_ARRAY_NULL_GUARD = PREFIX + "INLINE_ARRAY_NULL_GUARD" + POSTFIX;
141     static {
142         IRNode.optoOnly(INLINE_ARRAY_NULL_GUARD, InlineTypeRegexes.INLINE_ARRAY_NULL_GUARD);
143     }
144 
145     public static final String INTRINSIC_SLOW_PATH = PREFIX + "INTRINSIC_SLOW_PATH" + POSTFIX;
146     static {
147         IRNode.optoOnly(INTRINSIC_SLOW_PATH, InlineTypeRegexes.INTRINSIC_SLOW_PATH);
148     }
149 
150     public static final String CLONE_INTRINSIC_SLOW_PATH = PREFIX + "CLONE_INTRINSIC_SLOW_PATH" + POSTFIX;
151     static {
152         IRNode.optoOnly(CLONE_INTRINSIC_SLOW_PATH, InlineTypeRegexes.CLONE_INTRINSIC_SLOW_PATH);
153     }
154 
155     public static final String CLASS_CHECK_TRAP = PREFIX + "CLASS_CHECK_TRAP" + POSTFIX;
156     static {
157         IRNode.beforeMatching(CLASS_CHECK_TRAP, InlineTypeRegexes.CLASS_CHECK_TRAP);
158     }
159 
160     public static final String NULL_CHECK_TRAP = PREFIX + "NULL_CHECK_TRAP" + POSTFIX;
161     static {
162         IRNode.beforeMatching(NULL_CHECK_TRAP, InlineTypeRegexes.NULL_CHECK_TRAP);
163     }
164 
165     public static final String NULL_ASSERT_TRAP = PREFIX + "NULL_ASSERT_TRAP" + POSTFIX;
166     static {
167         IRNode.beforeMatching(NULL_ASSERT_TRAP, InlineTypeRegexes.NULL_ASSERT_TRAP);
168     }
169 
170     public static final String RANGE_CHECK_TRAP = PREFIX + "RANGE_CHECK_TRAP" + POSTFIX;
171     static {
172         IRNode.beforeMatching(RANGE_CHECK_TRAP, InlineTypeRegexes.RANGE_CHECK_TRAP);
173     }
174 
175     public static final String UNHANDLED_TRAP = PREFIX + "UNHANDLED_TRAP" + POSTFIX;
176     static {
177         IRNode.beforeMatching(UNHANDLED_TRAP, InlineTypeRegexes.UNHANDLED_TRAP);
178     }
179 
180     public static final String PREDICATE_TRAP = PREFIX + "PREDICATE_TRAP" + POSTFIX;
181     static {
182         IRNode.beforeMatching(PREDICATE_TRAP, InlineTypeRegexes.PREDICATE_TRAP);
183     }
184 
185     public static final String MEMBAR = PREFIX + "MEMBAR" + POSTFIX;
186     static {
187         IRNode.beforeMatching(MEMBAR, InlineTypeRegexes.MEMBAR);
188     }
189 
190     public static final String CHECKCAST_ARRAYCOPY = PREFIX + "CHECKCAST_ARRAYCOPY" + POSTFIX;
191     static {
192         IRNode.optoOnly(CHECKCAST_ARRAYCOPY, InlineTypeRegexes.CHECKCAST_ARRAYCOPY);
193     }
194 
195     public static final String JLONG_ARRAYCOPY = PREFIX + "JLONG_ARRAYCOPY" + POSTFIX;
196     static {
197         IRNode.optoOnly(JLONG_ARRAYCOPY, InlineTypeRegexes.JLONG_ARRAYCOPY);
198     }
199 
200     public static final String FIELD_ACCESS = PREFIX + "FIELD_ACCESS" + POSTFIX;
201     static {
202         IRNode.optoOnly(FIELD_ACCESS, InlineTypeRegexes.FIELD_ACCESS);
203     }
204 
205     public static final String SUBSTITUTABILITY_TEST = PREFIX + "SUBSTITUTABILITY_TEST" + POSTFIX;
206     static {
207         IRNode.beforeMatching(SUBSTITUTABILITY_TEST, InlineTypeRegexes.SUBSTITUTABILITY_TEST);
208     }
209 
210     public static final String CMPP = PREFIX + "CMPP" + POSTFIX;
211     static {
212         IRNode.beforeMatching(CMPP, InlineTypeRegexes.CMPP);
213     }
214 
215     // Dummy method to call to force the static initializer blocks to be run before starting the IR framework.
216     public static void forceStaticInitialization() {}
217 }