1 /*
  2  * Copyright (c) 1997, 2023, 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 
 25 #ifndef SHARE_CLASSFILE_VMSYMBOLS_HPP
 26 #define SHARE_CLASSFILE_VMSYMBOLS_HPP
 27 
 28 #include "classfile/vmIntrinsics.hpp"
 29 #include "jvmci/vmSymbols_jvmci.hpp"
 30 #include "memory/iterator.hpp"
 31 #include "oops/symbol.hpp"
 32 #include "utilities/macros.hpp"
 33 #include "utilities/enumIterator.hpp"
 34 
 35 class SerializeClosure;
 36 
 37 // The class vmSymbols is a name space for fast lookup of
 38 // symbols commonly used in the VM.
 39 //
 40 // Sample usage:
 41 //
 42 //   Symbol* obj       = vmSymbols::java_lang_Object();
 43 
 44 
 45 // Useful sub-macros exported by this header file:
 46 
 47 #define VM_SYMBOL_ENUM_NAME_(name)    name##_enum
 48 #define VM_SYMBOL_ENUM_NAME(name)    vmSymbolID::VM_SYMBOL_ENUM_NAME_(name)
 49 #define VM_INTRINSIC_IGNORE(id, class, name, sig, flags) /*ignored*/
 50 #define VM_SYMBOL_IGNORE(id, name)                       /*ignored*/
 51 #define VM_ALIAS_IGNORE(id, id2)                         /*ignored*/
 52 
 53 // Mapping function names to values. New entries should be added below.
 54 
 55 #define VM_SYMBOLS_DO(template, do_alias)                                                         \
 56   /* commonly used class, package, module names */                                                \
 57   template(java_base,                                 "java.base")                                \
 58   template(java_lang_System,                          "java/lang/System")                         \
 59   template(java_lang_Object,                          "java/lang/Object")                         \
 60   template(java_lang_Class,                           "java/lang/Class")                          \
 61   template(java_lang_Package,                         "java/lang/Package")                        \
 62   template(java_lang_Module,                          "java/lang/Module")                         \
 63   template(java_lang_String,                          "java/lang/String")                         \
 64   template(java_lang_StringLatin1,                    "java/lang/StringLatin1")                   \
 65   template(java_lang_StringUTF16,                     "java/lang/StringUTF16")                    \
 66   template(java_lang_Thread,                          "java/lang/Thread")                         \
 67   template(java_lang_Thread_FieldHolder,              "java/lang/Thread$FieldHolder")             \
 68   template(java_lang_Thread_Constants,                "java/lang/Thread$Constants")               \
 69   template(java_lang_ThreadGroup,                     "java/lang/ThreadGroup")                    \
 70   template(java_lang_BaseVirtualThread,               "java/lang/BaseVirtualThread")              \
 71   template(java_lang_VirtualThread,                   "java/lang/VirtualThread")                  \
 72   template(java_lang_BoundVirtualThread,              "java/lang/ThreadBuilders$BoundVirtualThread") \
 73   template(java_lang_Cloneable,                       "java/lang/Cloneable")                      \
 74   template(java_lang_Throwable,                       "java/lang/Throwable")                      \
 75   template(java_lang_ClassLoader,                     "java/lang/ClassLoader")                    \
 76   template(java_lang_Runnable,                        "java/lang/Runnable")                       \
 77   template(jdk_internal_vm_ContinuationScope,         "jdk/internal/vm/ContinuationScope")        \
 78   template(jdk_internal_vm_StackChunk,                "jdk/internal/vm/StackChunk")               \
 79   template(java_lang_Boolean,                         "java/lang/Boolean")                        \
 80   template(java_lang_Character,                       "java/lang/Character")                      \
 81   template(java_lang_Character_CharacterCache,        "java/lang/Character$CharacterCache")       \
 82   template(java_lang_CharacterDataLatin1,             "java/lang/CharacterDataLatin1")            \
 83   template(java_lang_Float,                           "java/lang/Float")                          \
 84   template(java_lang_Double,                          "java/lang/Double")                         \
 85   template(java_lang_Byte,                            "java/lang/Byte")                           \
 86   template(java_lang_Byte_ByteCache,                  "java/lang/Byte$ByteCache")                 \
 87   template(java_lang_Short,                           "java/lang/Short")                          \
 88   template(java_lang_Short_ShortCache,                "java/lang/Short$ShortCache")               \
 89   template(java_lang_Integer,                         "java/lang/Integer")                        \
 90   template(java_lang_Integer_IntegerCache,            "java/lang/Integer$IntegerCache")           \
 91   template(java_lang_Long,                            "java/lang/Long")                           \
 92   template(java_lang_Long_LongCache,                  "java/lang/Long$LongCache")                 \
 93                                                                                                   \
 94   template(jdk_internal_vm_vector_VectorSupport,      "jdk/internal/vm/vector/VectorSupport")               \
 95   template(jdk_internal_vm_vector_VectorPayload,      "jdk/internal/vm/vector/VectorSupport$VectorPayload") \
 96   template(jdk_internal_vm_vector_Vector,             "jdk/internal/vm/vector/VectorSupport$Vector")        \
 97   template(jdk_internal_vm_vector_VectorMask,         "jdk/internal/vm/vector/VectorSupport$VectorMask")    \
 98   template(jdk_internal_vm_vector_VectorShuffle,      "jdk/internal/vm/vector/VectorSupport$VectorShuffle") \
 99   template(payload_name,                              "payload")                                            \
100   template(ETYPE_name,                                "ETYPE")                                              \
101   template(VLENGTH_name,                              "VLENGTH")                                            \
102                                                                                                   \
103   template(jdk_internal_vm_FillerObject,              "jdk/internal/vm/FillerObject")             \
104                                                                                                   \
105   template(java_lang_Shutdown,                        "java/lang/Shutdown")                       \
106   template(java_lang_ref_Reference,                   "java/lang/ref/Reference")                  \
107   template(java_lang_ref_SoftReference,               "java/lang/ref/SoftReference")              \
108   template(java_lang_ref_WeakReference,               "java/lang/ref/WeakReference")              \
109   template(java_lang_ref_FinalReference,              "java/lang/ref/FinalReference")             \
110   template(java_lang_ref_PhantomReference,            "java/lang/ref/PhantomReference")           \
111   template(java_lang_ref_Finalizer,                   "java/lang/ref/Finalizer")                  \
112   template(java_lang_reflect_AccessibleObject,        "java/lang/reflect/AccessibleObject")       \
113   template(java_lang_reflect_Method,                  "java/lang/reflect/Method")                 \
114   template(java_lang_reflect_Constructor,             "java/lang/reflect/Constructor")            \
115   template(java_lang_reflect_Field,                   "java/lang/reflect/Field")                  \
116   template(java_lang_reflect_Parameter,               "java/lang/reflect/Parameter")              \
117   template(java_lang_reflect_Array,                   "java/lang/reflect/Array")                  \
118   template(java_lang_reflect_RecordComponent,         "java/lang/reflect/RecordComponent")        \
119   template(java_lang_StringBuffer,                    "java/lang/StringBuffer")                   \
120   template(java_lang_StringBuilder,                   "java/lang/StringBuilder")                  \
121   template(java_lang_CharSequence,                    "java/lang/CharSequence")                   \
122   template(java_lang_SecurityManager,                 "java/lang/SecurityManager")                \
123   template(java_lang_ScopedValue,                     "java/lang/ScopedValue")                    \
124   template(java_lang_ScopedValue_Carrier,             "java/lang/ScopedValue$Carrier")            \
125   template(java_security_AccessControlContext,        "java/security/AccessControlContext")       \
126   template(java_security_AccessController,            "java/security/AccessController")           \
127   template(executePrivileged_name,                    "executePrivileged")                        \
128   template(java_security_CodeSource,                  "java/security/CodeSource")                 \
129   template(java_security_ProtectionDomain,            "java/security/ProtectionDomain")           \
130   template(java_security_SecureClassLoader,           "java/security/SecureClassLoader")          \
131   template(java_net_URL,                              "java/net/URL")                             \
132   template(java_net_URLClassLoader,                   "java/net/URLClassLoader")                  \
133   template(java_util_jar_Manifest,                    "java/util/jar/Manifest")                   \
134   template(java_io_OutputStream,                      "java/io/OutputStream")                     \
135   template(java_io_Reader,                            "java/io/Reader")                           \
136   template(java_io_BufferedReader,                    "java/io/BufferedReader")                   \
137   template(java_io_File,                              "java/io/File")                             \
138   template(java_io_FileInputStream,                   "java/io/FileInputStream")                  \
139   template(java_io_ByteArrayInputStream,              "java/io/ByteArrayInputStream")             \
140   template(java_io_Serializable,                      "java/io/Serializable")                     \
141   template(java_nio_Buffer,                           "java/nio/Buffer")                          \
142   template(java_util_Arrays,                          "java/util/Arrays")                         \
143   template(java_util_Objects,                         "java/util/Objects")                        \
144   template(java_util_Properties,                      "java/util/Properties")                     \
145   template(java_util_Vector,                          "java/util/Vector")                         \
146   template(java_util_AbstractList,                    "java/util/AbstractList")                   \
147   template(java_util_Hashtable,                       "java/util/Hashtable")                      \
148   template(java_util_DualPivotQuicksort,              "java/util/DualPivotQuicksort")             \
149   template(java_lang_Compiler,                        "java/lang/Compiler")                       \
150   template(jdk_internal_misc_Signal,                  "jdk/internal/misc/Signal")                 \
151   template(jdk_internal_util_Preconditions,           "jdk/internal/util/Preconditions")          \
152   template(java_lang_AssertionStatusDirectives,       "java/lang/AssertionStatusDirectives")      \
153   template(getBootClassPathEntryForClass_name,        "getBootClassPathEntryForClass")            \
154   template(jdk_internal_vm_PostVMInitHook,            "jdk/internal/vm/PostVMInitHook")           \
155   template(sun_net_www_ParseUtil,                     "sun/net/www/ParseUtil")                    \
156   template(java_util_Iterator,                        "java/util/Iterator")                       \
157   template(java_lang_Record,                          "java/lang/Record")                         \
158   template(sun_instrument_InstrumentationImpl,        "sun/instrument/InstrumentationImpl")       \
159   template(sun_invoke_util_ValueConversions,          "sun/invoke/util/ValueConversions")         \
160                                                                                                   \
161   template(jdk_internal_loader_NativeLibraries,       "jdk/internal/loader/NativeLibraries")      \
162   template(jdk_internal_loader_BuiltinClassLoader,    "jdk/internal/loader/BuiltinClassLoader")   \
163   template(jdk_internal_loader_ClassLoaders_AppClassLoader,      "jdk/internal/loader/ClassLoaders$AppClassLoader")      \
164   template(jdk_internal_loader_ClassLoaders_PlatformClassLoader, "jdk/internal/loader/ClassLoaders$PlatformClassLoader") \
165                                                                                                   \
166   /* Java runtime version access */                                                               \
167   template(java_lang_VersionProps,                    "java/lang/VersionProps")                   \
168   template(java_version_name,                         "java_version")                             \
169   template(java_runtime_name_name,                    "java_runtime_name")                        \
170   template(java_runtime_version_name,                 "java_runtime_version")                     \
171   template(java_runtime_vendor_version_name,          "VENDOR_VERSION")                           \
172   template(java_runtime_vendor_vm_bug_url_name,       "VENDOR_URL_VM_BUG")                        \
173                                                                                                   \
174   /* system initialization */                                                                     \
175   template(initPhase1_name,                           "initPhase1")                               \
176   template(initPhase2_name,                           "initPhase2")                               \
177   template(initPhase3_name,                           "initPhase3")                               \
178   template(java_lang_module_init_signature,           "(Ljava/lang/ClassLoader;Ljava/lang/String;)V") \
179                                                                                                   \
180   /* class file format tags */                                                                    \
181   template(tag_source_file,                           "SourceFile")                               \
182   template(tag_inner_classes,                         "InnerClasses")                             \
183   template(tag_nest_members,                          "NestMembers")                              \
184   template(tag_nest_host,                             "NestHost")                                 \
185   template(tag_preload,                               "Preload")                                  \
186   template(tag_constant_value,                        "ConstantValue")                            \
187   template(tag_code,                                  "Code")                                     \
188   template(tag_exceptions,                            "Exceptions")                               \
189   template(tag_line_number_table,                     "LineNumberTable")                          \
190   template(tag_local_variable_table,                  "LocalVariableTable")                       \
191   template(tag_local_variable_type_table,             "LocalVariableTypeTable")                   \
192   template(tag_method_parameters,                     "MethodParameters")                         \
193   template(tag_stack_map_table,                       "StackMapTable")                            \
194   template(tag_synthetic,                             "Synthetic")                                \
195   template(tag_deprecated,                            "Deprecated")                               \
196   template(tag_source_debug_extension,                "SourceDebugExtension")                     \
197   template(tag_signature,                             "Signature")                                \
198   template(tag_record,                                "Record")                                   \
199   template(tag_runtime_visible_annotations,           "RuntimeVisibleAnnotations")                \
200   template(tag_runtime_invisible_annotations,         "RuntimeInvisibleAnnotations")              \
201   template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations")       \
202   template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations")    \
203   template(tag_annotation_default,                    "AnnotationDefault")                        \
204   template(tag_runtime_visible_type_annotations,      "RuntimeVisibleTypeAnnotations")            \
205   template(tag_runtime_invisible_type_annotations,    "RuntimeInvisibleTypeAnnotations")          \
206   template(tag_enclosing_method,                      "EnclosingMethod")                          \
207   template(tag_bootstrap_methods,                     "BootstrapMethods")                         \
208   template(tag_permitted_subclasses,                  "PermittedSubclasses")                      \
209                                                                                                   \
210   /* exception klasses: at least all exceptions thrown by the VM have entries here */             \
211   template(java_lang_ArithmeticException,             "java/lang/ArithmeticException")            \
212   template(java_lang_ArrayIndexOutOfBoundsException,  "java/lang/ArrayIndexOutOfBoundsException") \
213   template(java_lang_ArrayStoreException,             "java/lang/ArrayStoreException")            \
214   template(java_lang_ClassCastException,              "java/lang/ClassCastException")             \
215   template(java_lang_ClassNotFoundException,          "java/lang/ClassNotFoundException")         \
216   template(java_lang_CloneNotSupportedException,      "java/lang/CloneNotSupportedException")     \
217   template(java_lang_IllegalAccessException,          "java/lang/IllegalAccessException")         \
218   template(java_lang_IllegalArgumentException,        "java/lang/IllegalArgumentException")       \
219   template(java_lang_IllegalStateException,           "java/lang/IllegalStateException")          \
220   template(java_lang_IllegalMonitorStateException,    "java/lang/IllegalMonitorStateException")   \
221   template(java_lang_IllegalThreadStateException,     "java/lang/IllegalThreadStateException")    \
222   template(java_lang_IndexOutOfBoundsException,       "java/lang/IndexOutOfBoundsException")      \
223   template(java_lang_InstantiationException,          "java/lang/InstantiationException")         \
224   template(java_lang_InstantiationError,              "java/lang/InstantiationError")             \
225   template(java_lang_InterruptedException,            "java/lang/InterruptedException")           \
226   template(java_lang_BootstrapMethodError,            "java/lang/BootstrapMethodError")           \
227   template(java_lang_LinkageError,                    "java/lang/LinkageError")                   \
228   template(java_lang_NegativeArraySizeException,      "java/lang/NegativeArraySizeException")     \
229   template(java_lang_NoSuchFieldException,            "java/lang/NoSuchFieldException")           \
230   template(java_lang_NoSuchMethodException,           "java/lang/NoSuchMethodException")          \
231   template(java_lang_NullPointerException,            "java/lang/NullPointerException")           \
232   template(java_lang_StringIndexOutOfBoundsException, "java/lang/StringIndexOutOfBoundsException")\
233   template(java_lang_UnsupportedOperationException,   "java/lang/UnsupportedOperationException")  \
234   template(java_lang_InvalidClassException,           "java/lang/InvalidClassException")          \
235   template(java_lang_reflect_InvocationTargetException, "java/lang/reflect/InvocationTargetException") \
236   template(java_lang_Exception,                       "java/lang/Exception")                      \
237   template(java_lang_RuntimeException,                "java/lang/RuntimeException")               \
238   template(java_io_IOException,                       "java/io/IOException")                      \
239   template(java_security_PrivilegedActionException,   "java/security/PrivilegedActionException")  \
240                                                                                                   \
241   /* error klasses: at least all errors thrown by the VM have entries here */                     \
242   template(java_lang_AbstractMethodError,             "java/lang/AbstractMethodError")            \
243   template(java_lang_ClassCircularityError,           "java/lang/ClassCircularityError")          \
244   template(java_lang_ClassFormatError,                "java/lang/ClassFormatError")               \
245   template(java_lang_UnsupportedClassVersionError,    "java/lang/UnsupportedClassVersionError")   \
246   template(java_lang_Error,                           "java/lang/Error")                          \
247   template(java_lang_ExceptionInInitializerError,     "java/lang/ExceptionInInitializerError")    \
248   template(java_lang_IllegalAccessError,              "java/lang/IllegalAccessError")             \
249   template(java_lang_IncompatibleClassChangeError,    "java/lang/IncompatibleClassChangeError")   \
250   template(java_lang_InternalError,                   "java/lang/InternalError")                  \
251   template(java_lang_NoClassDefFoundError,            "java/lang/NoClassDefFoundError")           \
252   template(java_lang_NoSuchFieldError,                "java/lang/NoSuchFieldError")               \
253   template(java_lang_NoSuchMethodError,               "java/lang/NoSuchMethodError")              \
254   template(java_lang_OutOfMemoryError,                "java/lang/OutOfMemoryError")               \
255   template(java_lang_UnsatisfiedLinkError,            "java/lang/UnsatisfiedLinkError")           \
256   template(java_lang_VerifyError,                     "java/lang/VerifyError")                    \
257   template(java_lang_SecurityException,               "java/lang/SecurityException")              \
258   template(java_lang_VirtualMachineError,             "java/lang/VirtualMachineError")            \
259   template(java_lang_StackOverflowError,              "java/lang/StackOverflowError")             \
260   template(java_lang_StackTraceElement,               "java/lang/StackTraceElement")              \
261                                                                                                   \
262   /* Concurrency support */                                                                       \
263   template(java_util_concurrent_locks_AbstractOwnableSynchronizer,           "java/util/concurrent/locks/AbstractOwnableSynchronizer") \
264   template(java_util_concurrent_atomic_AtomicIntegerFieldUpdater_Impl,       "java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl") \
265   template(java_util_concurrent_atomic_AtomicLongFieldUpdater_CASUpdater,    "java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater") \
266   template(java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater") \
267   template(java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl,     "java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl") \
268   template(jdk_internal_vm_annotation_Contended_signature,                   "Ljdk/internal/vm/annotation/Contended;")    \
269   template(jdk_internal_vm_annotation_ReservedStackAccess_signature,         "Ljdk/internal/vm/annotation/ReservedStackAccess;") \
270   template(jdk_internal_vm_annotation_ImplicitlyConstructible_signature,     "Ljdk/internal/vm/annotation/ImplicitlyConstructible;") \
271   template(jdk_internal_vm_annotation_LooselyConsistentValue_signature,      "Ljdk/internal/vm/annotation/LooselyConsistentValue;") \
272   template(jdk_internal_vm_annotation_NullRestricted_signature,              "Ljdk/internal/vm/annotation/NullRestricted;") \
273   template(jdk_internal_ValueBased_signature,                                "Ljdk/internal/ValueBased;") \
274                                                                                                   \
275   /* class symbols needed by intrinsics */                                                        \
276   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
277                                                                                                   \
278   /* Support for reflection based on dynamic bytecode generation (JDK 1.4 and above) */           \
279                                                                                                   \
280   template(jdk_internal_reflect,                      "jdk/internal/reflect")                     \
281   template(reflect_MethodAccessorImpl,                "jdk/internal/reflect/MethodAccessorImpl")      \
282   template(reflect_DelegatingClassLoader,             "jdk/internal/reflect/DelegatingClassLoader")   \
283   template(reflect_Reflection,                        "jdk/internal/reflect/Reflection")              \
284   template(reflect_CallerSensitive,                   "jdk/internal/reflect/CallerSensitive")         \
285   template(reflect_CallerSensitive_signature,         "Ljdk/internal/reflect/CallerSensitive;")       \
286   template(reflect_DirectConstructorHandleAccessor_NativeAccessor,   "jdk/internal/reflect/DirectConstructorHandleAccessor$NativeAccessor") \
287   template(reflect_SerializationConstructorAccessorImpl,             "jdk/internal/reflect/SerializationConstructorAccessorImpl") \
288   template(checkedExceptions_name,                    "checkedExceptions")                        \
289   template(clazz_name,                                "clazz")                                    \
290   template(exceptionTypes_name,                       "exceptionTypes")                           \
291   template(modifiers_name,                            "modifiers")                                \
292   template(invokeBasic_name,                          "invokeBasic")                              \
293   template(linkToVirtual_name,                        "linkToVirtual")                            \
294   template(linkToStatic_name,                         "linkToStatic")                             \
295   template(linkToSpecial_name,                        "linkToSpecial")                            \
296   template(linkToInterface_name,                      "linkToInterface")                          \
297   template(linkToNative_name,                         "linkToNative")                             \
298   template(compiledLambdaForm_name,                   "<compiledLambdaForm>")  /*fake name*/      \
299   template(star_name,                                 "*") /*not really a name*/                  \
300   template(invoke_name,                               "invoke")                                   \
301   template(parameterTypes_name,                       "parameterTypes")                           \
302   template(returnType_name,                           "returnType")                               \
303   template(signature_name,                            "signature")                                \
304   template(slot_name,                                 "slot")                                     \
305   template(blackhole_name,                            "<blackhole>")  /*fake name*/               \
306                                                                                                   \
307   /* Support for annotations (JDK 1.5 and above) */                                               \
308                                                                                                   \
309   template(annotations_name,                          "annotations")                              \
310   template(index_name,                                "index")                                    \
311   template(executable_name,                           "executable")                               \
312   template(parameter_annotations_name,                "parameterAnnotations")                     \
313   template(annotation_default_name,                   "annotationDefault")                        \
314   template(reflect_ConstantPool,                      "jdk/internal/reflect/ConstantPool")        \
315   template(base_name,                                 "base")                                     \
316   /* Type Annotations (JDK 8 and above) */                                                        \
317   template(type_annotations_name,                     "typeAnnotations")                          \
318                                                                                                   \
319   /* Intrinsic Annotation (JDK 9 and above) */                                                    \
320   template(jdk_internal_vm_annotation_DontInline_signature,  "Ljdk/internal/vm/annotation/DontInline;")  \
321   template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \
322   template(jdk_internal_vm_annotation_Hidden_signature,      "Ljdk/internal/vm/annotation/Hidden;") \
323   template(jdk_internal_misc_Scoped_signature,               "Ljdk/internal/misc/ScopedMemoryAccess$Scoped;") \
324   template(jdk_internal_vm_annotation_IntrinsicCandidate_signature, "Ljdk/internal/vm/annotation/IntrinsicCandidate;") \
325   template(jdk_internal_vm_annotation_Stable_signature,      "Ljdk/internal/vm/annotation/Stable;") \
326                                                                                                   \
327   template(jdk_internal_vm_annotation_ChangesCurrentThread_signature,  "Ljdk/internal/vm/annotation/ChangesCurrentThread;")  \
328   template(jdk_internal_vm_annotation_JvmtiMountTransition_signature,  "Ljdk/internal/vm/annotation/JvmtiMountTransition;")  \
329                                                                                                   \
330   /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
331   template(java_lang_invoke_CallSite,                 "java/lang/invoke/CallSite")                \
332   template(java_lang_invoke_ConstantCallSite,         "java/lang/invoke/ConstantCallSite")        \
333   template(java_lang_invoke_DirectMethodHandle,       "java/lang/invoke/DirectMethodHandle")      \
334   template(java_lang_invoke_MutableCallSite,          "java/lang/invoke/MutableCallSite")         \
335   template(java_lang_invoke_VolatileCallSite,         "java/lang/invoke/VolatileCallSite")        \
336   template(java_lang_invoke_MethodHandle,             "java/lang/invoke/MethodHandle")            \
337   template(java_lang_invoke_VarHandle,                "java/lang/invoke/VarHandle")               \
338   template(java_lang_invoke_MethodType,               "java/lang/invoke/MethodType")              \
339   template(java_lang_invoke_MethodType_signature,     "Ljava/lang/invoke/MethodType;")            \
340   template(java_lang_invoke_ResolvedMethodName_signature, "Ljava/lang/invoke/ResolvedMethodName;")\
341   template(java_lang_invoke_MemberName_signature,     "Ljava/lang/invoke/MemberName;")            \
342   template(java_lang_invoke_LambdaForm_signature,     "Ljava/lang/invoke/LambdaForm;")            \
343   template(java_lang_invoke_MethodHandle_signature,   "Ljava/lang/invoke/MethodHandle;")          \
344   /* internal classes known only to the JVM: */                                                   \
345   template(java_lang_invoke_MemberName,               "java/lang/invoke/MemberName")              \
346   template(java_lang_invoke_ResolvedMethodName,       "java/lang/invoke/ResolvedMethodName")      \
347   template(java_lang_invoke_MethodHandleNatives,      "java/lang/invoke/MethodHandleNatives")     \
348   template(java_lang_invoke_MethodHandleNatives_CallSiteContext, "java/lang/invoke/MethodHandleNatives$CallSiteContext") \
349   template(java_lang_invoke_LambdaForm,               "java/lang/invoke/LambdaForm")              \
350   template(java_lang_invoke_InjectedProfile_signature, "Ljava/lang/invoke/InjectedProfile;")      \
351   template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
352   template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \
353   /* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */         \
354   template(findMethodHandleType_name,                 "findMethodHandleType")                     \
355   template(findMethodHandleType_signature,       "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
356   template(invokeExact_name,                          "invokeExact")                              \
357   template(linkMethodHandleConstant_name,             "linkMethodHandleConstant")                 \
358   template(asFixedArity_name,                         "asFixedArity")                             \
359   template(asFixedArity_signature,                    "()Ljava/lang/invoke/MethodHandle;")        \
360   template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;") \
361   template(linkMethod_name,                           "linkMethod")                               \
362   template(linkMethod_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \
363   template(linkDynamicConstant_name,                  "linkDynamicConstant")                      \
364   template(linkDynamicConstant_signature, "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
365   template(linkCallSite_name,                         "linkCallSite")                             \
366   template(linkCallSite_signature, "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \
367   template(setTargetNormal_name,                      "setTargetNormal")                          \
368   template(setTargetVolatile_name,                    "setTargetVolatile")                        \
369   template(setTarget_signature,                       "(Ljava/lang/invoke/MethodHandle;)V")       \
370   template(DEFAULT_CONTEXT_name,                      "DEFAULT_CONTEXT")                          \
371   NOT_LP64(  do_alias(intptr_signature,               int_signature)  )                           \
372   LP64_ONLY( do_alias(intptr_signature,               long_signature) )                           \
373   /* Foreign API Support */                                                                       \
374   template(jdk_internal_foreign_abi_NativeEntryPoint,                "jdk/internal/foreign/abi/NativeEntryPoint") \
375   template(jdk_internal_foreign_abi_ABIDescriptor,                   "jdk/internal/foreign/abi/ABIDescriptor") \
376   template(jdk_internal_foreign_abi_VMStorage,                       "jdk/internal/foreign/abi/VMStorage") \
377   template(jdk_internal_foreign_abi_VMStorage_signature,             "Ljdk/internal/foreign/abi/VMStorage;") \
378   template(jdk_internal_foreign_abi_VMStorage_array_signature,       "[Ljdk/internal/foreign/abi/VMStorage;") \
379   template(jdk_internal_foreign_abi_VMStorage_array_array_signature, "[[Ljdk/internal/foreign/abi/VMStorage;") \
380   template(jdk_internal_foreign_abi_CallConv,                        "jdk/internal/foreign/abi/UpcallLinker$CallRegs") \
381                                                                                                   \
382   /* Support for JVMCI */                                                                         \
383   JVMCI_VM_SYMBOLS_DO(template, do_alias)                                                         \
384                                                                                                   \
385   template(java_lang_ClassFrameInfo,                  "java/lang/ClassFrameInfo")                 \
386   template(java_lang_StackWalker,                     "java/lang/StackWalker")                    \
387   template(java_lang_StackFrameInfo,                  "java/lang/StackFrameInfo")                 \
388   template(java_lang_LiveStackFrameInfo,              "java/lang/LiveStackFrameInfo")             \
389   template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \
390   template(doStackWalk_signature,                     "(JIIII)Ljava/lang/Object;")                \
391   template(asPrimitive_name,                          "asPrimitive")                              \
392   template(asPrimitive_int_signature,                 "(I)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
393   template(asPrimitive_long_signature,                "(J)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
394                                                                                                   \
395   /* common method and field names */                                                             \
396   template(object_initializer_name,                   "<init>")                                   \
397   template(class_initializer_name,                    "<clinit>")                                 \
398   template(println_name,                              "println")                                  \
399   template(printStackTrace_name,                      "printStackTrace")                          \
400   template(getStackTrace_name,                        "getStackTrace")                            \
401   template(main_name,                                 "main")                                     \
402   template(name_name,                                 "name")                                     \
403   template(priority_name,                             "priority")                                 \
404   template(group_name,                                "group")                                    \
405   template(daemon_name,                               "daemon")                                   \
406   template(run_method_name,                           "run")                                      \
407   template(runWith_method_name,                       "runWith")                                  \
408   template(interrupt_method_name,                     "interrupt")                                \
409   template(exit_method_name,                          "exit")                                     \
410   template(remove_method_name,                        "remove")                                   \
411   template(parent_name,                               "parent")                                   \
412   template(maxPriority_name,                          "maxPriority")                              \
413   template(shutdown_name,                             "shutdown")                                 \
414   template(finalize_method_name,                      "finalize")                                 \
415   template(reference_lock_name,                       "lock")                                     \
416   template(reference_discovered_name,                 "discovered")                               \
417   template(run_finalization_name,                     "runFinalization")                          \
418   template(dispatchUncaughtException_name,            "dispatchUncaughtException")                \
419   template(loadClass_name,                            "loadClass")                                \
420   template(notifyJvmtiStart_name,                     "notifyJvmtiStart")                         \
421   template(notifyJvmtiEnd_name,                       "notifyJvmtiEnd")                           \
422   template(notifyJvmtiMount_name,                     "notifyJvmtiMount")                         \
423   template(notifyJvmtiUnmount_name,                   "notifyJvmtiUnmount")                       \
424   template(notifyJvmtiHideFrames_name,                "notifyJvmtiHideFrames")                    \
425   template(doYield_name,                              "doYield")                                  \
426   template(enter_name,                                "enter")                                    \
427   template(enterSpecial_name,                         "enterSpecial")                             \
428   template(onContinue_name,                           "onContinue0")                              \
429   template(getStacks_name,                            "getStacks")                                \
430   template(onPinned_name,                             "onPinned0")                                \
431   template(scope_name,                                "scope")                                    \
432   template(yieldInfo_name,                            "yieldInfo")                                \
433   template(tail_name,                                 "tail")                                     \
434   template(size_name,                                 "size")                                     \
435   template(argsize_name,                              "argsize")                                  \
436   template(mode_name,                                 "mode")                                     \
437   template(numFrames_name,                            "numFrames")                                \
438   template(numOops_name,                              "numOops")                                  \
439   template(stack_name,                                "stack")                                    \
440   template(maxSize_name,                              "maxSize")                                  \
441   template(reset_name,                                "reset")                                    \
442   template(done_name,                                 "done")                                     \
443   template(mounted_name,                              "mounted")                                  \
444   template(numInterpretedFrames_name,                 "numInterpretedFrames")                     \
445   template(jfrTraceId_name,                           "jfrTraceId")                               \
446   template(fp_name,                                   "fp")                                       \
447   template(sp_name,                                   "sp")                                       \
448   template(pc_name,                                   "pc")                                       \
449   template(cs_name,                                   "cs")                                       \
450   template(refStack_name,                             "refStack")                                 \
451   template(refSP_name,                                "refSP")                                    \
452   template(get_name,                                  "get")                                      \
453   template(refersTo0_name,                            "refersTo0")                                \
454   template(put_name,                                  "put")                                      \
455   template(type_name,                                 "type")                                     \
456   template(findNative_name,                           "findNative")                               \
457   template(deadChild_name,                            "deadChild")                                \
458   template(getFromClass_name,                         "getFromClass")                             \
459   template(dispatch_name,                             "dispatch")                                 \
460   template(bootLoader_name,                           "bootLoader")                               \
461   template(getPlatformClassLoader_name,               "getPlatformClassLoader")                   \
462   template(getSystemClassLoader_name,                 "getSystemClassLoader")                     \
463   template(fillInStackTrace_name,                     "fillInStackTrace")                         \
464   template(getCause_name,                             "getCause")                                 \
465   template(initCause_name,                            "initCause")                                \
466   template(getProperty_name,                          "getProperty")                              \
467   template(context_name,                              "context")                                  \
468   template(contextClassLoader_name,                   "contextClassLoader")                       \
469   template(inheritedAccessControlContext_name,        "inheritedAccessControlContext")            \
470   template(getClassContext_name,                      "getClassContext")                          \
471   template(wait_name,                                 "wait0")                                    \
472   template(checkPackageAccess_name,                   "checkPackageAccess")                       \
473   template(newInstance0_name,                         "newInstance0")                             \
474   template(forName_name,                              "forName")                                  \
475   template(forName0_name,                             "forName0")                                 \
476   template(isJavaIdentifierStart_name,                "isJavaIdentifierStart")                    \
477   template(isJavaIdentifierPart_name,                 "isJavaIdentifierPart")                     \
478   template(cache_field_name,                          "cache")                                    \
479   template(value_name,                                "value")                                    \
480   template(compact_strings_name,                      "COMPACT_STRINGS")                          \
481   template(numberOfLeadingZeros_name,                 "numberOfLeadingZeros")                     \
482   template(numberOfTrailingZeros_name,                "numberOfTrailingZeros")                    \
483   template(bitCount_name,                             "bitCount")                                 \
484   template(profile_name,                              "profile")                                  \
485   template(equals_name,                               "equals")                                   \
486   template(length_name,                               "length")                                   \
487   template(target_name,                               "target")                                   \
488   template(toString_name,                             "toString")                                 \
489   template(values_name,                               "values")                                   \
490   template(receiver_name,                             "receiver")                                 \
491   template(vmtarget_name,                             "vmtarget")                                 \
492   template(vmholder_name,                             "vmholder")                                 \
493   template(method_name,                               "method")                                   \
494   template(vmindex_name,                              "vmindex")                                  \
495   template(vmcount_name,                              "vmcount")                                  \
496   template(flags_name,                                "flags")                                    \
497   template(basicType_name,                            "basicType")                                \
498   template(append_name,                               "append")                                   \
499   template(klass_name,                                "klass")                                    \
500   template(array_klass_name,                          "array_klass")                              \
501   template(mid_name,                                  "mid")                                      \
502   template(cpref_name,                                "cpref")                                    \
503   template(version_name,                              "version")                                  \
504   template(methodName_name,                           "methodName")                               \
505   template(fileName_name,                             "fileName")                                 \
506   template(lineNumber_name,                           "lineNumber")                               \
507   template(oop_size_name,                             "oop_size")                                 \
508   template(static_oop_field_count_name,               "static_oop_field_count")                   \
509   template(protection_domain_name,                    "protection_domain")                        \
510   template(signers_name,                              "signers_name")                             \
511   template(source_file_name,                          "source_file")                              \
512   template(loader_data_name,                          "loader_data")                              \
513   template(cont_name,                                 "cont")                                     \
514   template(vmdependencies_name,                       "vmdependencies")                           \
515   template(last_cleanup_name,                         "last_cleanup")                             \
516   template(loader_name,                               "loader")                                   \
517   template(getModule_name,                            "getModule")                                \
518   template(input_stream_void_signature,               "(Ljava/io/InputStream;)V")                 \
519   template(input_stream_signature,                    "Ljava/io/InputStream;")                    \
520   template(print_stream_signature,                    "Ljava/io/PrintStream;")                    \
521   template(security_manager_signature,                "Ljava/lang/SecurityManager;")              \
522   template(defineOrCheckPackage_name,                 "defineOrCheckPackage")                     \
523   template(defineOrCheckPackage_signature,            "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)Ljava/lang/Package;") \
524   template(getProtectionDomain_name,                  "getProtectionDomain")                      \
525   template(getProtectionDomain_signature,             "(Ljava/security/CodeSource;)Ljava/security/ProtectionDomain;") \
526   template(java_lang_Integer_array_signature,         "[Ljava/lang/Integer;")                     \
527   template(java_lang_Long_array_signature,            "[Ljava/lang/Long;")                        \
528   template(java_lang_Character_array_signature,       "[Ljava/lang/Character;")                   \
529   template(java_lang_Short_array_signature,           "[Ljava/lang/Short;")                       \
530   template(java_lang_Byte_array_signature,            "[Ljava/lang/Byte;")                        \
531   template(java_lang_Boolean_signature,               "Ljava/lang/Boolean;")                      \
532   template(url_code_signer_array_void_signature,      "(Ljava/net/URL;[Ljava/security/CodeSigner;)V") \
533   template(jvmti_thread_state_name,                   "jvmti_thread_state")                       \
534   template(jvmti_VTMS_transition_disable_count_name,  "jvmti_VTMS_transition_disable_count")      \
535   template(jvmti_is_in_VTMS_transition_name,          "jvmti_is_in_VTMS_transition")              \
536   template(module_entry_name,                         "module_entry")                             \
537   template(resolved_references_name,                  "<resolved_references>")                    \
538   template(init_lock_name,                            "<init_lock>")                              \
539   template(default_value_name,                        ".default")                                 \
540   template(empty_marker_name,                         ".empty")                                   \
541   template(address_size_name,                         "ADDRESS_SIZE0")                            \
542   template(page_size_name,                            "PAGE_SIZE")                                \
543   template(big_endian_name,                           "BIG_ENDIAN")                               \
544   template(use_unaligned_access_name,                 "UNALIGNED_ACCESS")                         \
545   template(data_cache_line_flush_size_name,           "DATA_CACHE_LINE_FLUSH_SIZE")               \
546   template(during_unsafe_access_name,                 "during_unsafe_access")                     \
547   template(checkIndex_name,                           "checkIndex")                               \
548   template(jfr_epoch_name,                            "jfr_epoch")                                \
549   template(maxThawingSize_name,                       "maxThawingSize")                           \
550                                                                                                   \
551   /* name symbols needed by intrinsics */                                                         \
552   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
553                                                                                                   \
554   /* common signatures names */                                                                   \
555   template(void_method_signature,                     "()V")                                      \
556   template(void_boolean_signature,                    "()Z")                                      \
557   template(void_byte_signature,                       "()B")                                      \
558   template(void_char_signature,                       "()C")                                      \
559   template(void_short_signature,                      "()S")                                      \
560   template(void_int_signature,                        "()I")                                      \
561   template(void_long_signature,                       "()J")                                      \
562   template(void_float_signature,                      "()F")                                      \
563   template(void_double_signature,                     "()D")                                      \
564   template(bool_void_signature,                       "(Z)V")                                     \
565   template(bool_bool_void_signature,                  "(ZZ)V")                                    \
566   template(int_void_signature,                        "(I)V")                                     \
567   template(int_int_signature,                         "(I)I")                                     \
568   template(char_char_signature,                       "(C)C")                                     \
569   template(short_short_signature,                     "(S)S")                                     \
570   template(int_bool_signature,                        "(I)Z")                                     \
571   template(float_bool_signature,                      "(F)Z")                                     \
572   template(double_bool_signature,                     "(D)Z")                                     \
573   template(float_int_signature,                       "(F)I")                                     \
574   template(double_long_signature,                     "(D)J")                                     \
575   template(double_double_signature,                   "(D)D")                                     \
576   template(float_float_signature,                     "(F)F")                                     \
577   template(int_float_signature,                       "(I)F")                                     \
578   template(long_int_signature,                        "(J)I")                                     \
579   template(long_long_signature,                       "(J)J")                                     \
580   template(long_double_signature,                     "(J)D")                                     \
581   template(long_void_signature,                       "(J)V")                                     \
582   template(byte_signature,                            "B")                                        \
583   template(char_signature,                            "C")                                        \
584   template(double_signature,                          "D")                                        \
585   template(float_signature,                           "F")                                        \
586   template(int_signature,                             "I")                                        \
587   template(long_signature,                            "J")                                        \
588   template(short_signature,                           "S")                                        \
589   template(bool_signature,                            "Z")                                        \
590   template(void_signature,                            "V")                                        \
591   template(bool_array_signature,                      "[Z")                                       \
592   template(byte_array_signature,                      "[B")                                       \
593   template(char_array_signature,                      "[C")                                       \
594   template(int_array_signature,                       "[I")                                       \
595   template(long_array_signature,                      "[J")                                       \
596   template(runnable_signature,                        "Ljava/lang/Runnable;")                     \
597   template(continuation_signature,                    "Ljdk/internal/vm/Continuation;")           \
598   template(continuationscope_signature,               "Ljdk/internal/vm/ContinuationScope;")      \
599   template(stackchunk_signature,                      "Ljdk/internal/vm/StackChunk;")             \
600   template(vthread_signature,                         "Ljava/lang/VirtualThread;")                \
601   template(object_void_signature,                     "(Ljava/lang/Object;)V")                    \
602   template(object_int_signature,                      "(Ljava/lang/Object;)I")                    \
603   template(long_object_long_signature,                "(JLjava/lang/Object;)J")                   \
604   template(object_boolean_signature,                  "(Ljava/lang/Object;)Z")                    \
605   template(object_object_signature,                   "(Ljava/lang/Object;)Ljava/lang/Object;")   \
606   template(string_void_signature,                     "(Ljava/lang/String;)V")                    \
607   template(string_int_signature,                      "(Ljava/lang/String;)I")                    \
608   template(string_byte_array_signature,               "(Ljava/lang/String;)[B")                   \
609   template(string_bool_byte_array_signature,          "(Ljava/lang/String;Z)[B")                  \
610   template(throwable_signature,                       "Ljava/lang/Throwable;")                    \
611   template(throwable_void_signature,                  "(Ljava/lang/Throwable;)V")                 \
612   template(void_throwable_signature,                  "()Ljava/lang/Throwable;")                  \
613   template(class_void_signature,                      "(Ljava/lang/Class;)V")                     \
614   template(class_int_signature,                       "(Ljava/lang/Class;)I")                     \
615   template(class_long_signature,                      "(Ljava/lang/Class;)J")                     \
616   template(class_boolean_signature,                   "(Ljava/lang/Class;)Z")                     \
617   template(class_class_signature,                     "(Ljava/lang/Class;)Ljava/lang/Class;")     \
618   template(throwable_throwable_signature,             "(Ljava/lang/Throwable;)Ljava/lang/Throwable;")             \
619   template(throwable_string_void_signature,           "(Ljava/lang/Throwable;Ljava/lang/String;)V")               \
620   template(string_array_void_signature,               "([Ljava/lang/String;)V")                                   \
621   template(string_array_string_array_void_signature,  "([Ljava/lang/String;[Ljava/lang/String;)V")                \
622   template(thread_throwable_void_signature,           "(Ljava/lang/Thread;Ljava/lang/Throwable;)V")               \
623   template(thread_void_signature,                     "(Ljava/lang/Thread;)V")                                    \
624   template(runnable_void_signature,                   "(Ljava/lang/Runnable;)V")                                   \
625   template(threadgroup_runnable_void_signature,       "(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;)V")           \
626   template(threadgroup_string_void_signature,         "(Ljava/lang/ThreadGroup;Ljava/lang/String;)V")             \
627   template(void_threadgroup_array_signature,          "()[Ljava/lang/ThreadGroup;")                               \
628   template(string_class_signature,                    "(Ljava/lang/String;)Ljava/lang/Class;")                    \
629   template(string_boolean_class_signature,            "(Ljava/lang/String;Z)Ljava/lang/Class;")                   \
630   template(object_object_object_signature,            "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
631   template(object_object_boolean_signature,           "(Ljava/lang/Object;Ljava/lang/Object;)Z") \
632   template(string_string_string_signature,            "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") \
633   template(string_string_signature,                   "(Ljava/lang/String;)Ljava/lang/String;")                   \
634   template(classloader_string_long_signature,         "(Ljava/lang/ClassLoader;Ljava/lang/String;)J")             \
635   template(byte_array_void_signature,                 "([B)V")                                                    \
636   template(char_array_void_signature,                 "([C)V")                                                    \
637   template(int_int_void_signature,                    "(II)V")                                                    \
638   template(long_long_void_signature,                  "(JJ)V")                                                    \
639   template(void_byte_array_signature,                 "()[B")                                                     \
640   template(void_classloader_signature,                "()Ljava/lang/ClassLoader;")                                \
641   template(void_BuiltinClassLoader_signature,         "()Ljdk/internal/loader/BuiltinClassLoader;")               \
642   template(void_object_signature,                     "()Ljava/lang/Object;")                                     \
643   template(void_class_signature,                      "()Ljava/lang/Class;")                                      \
644   template(void_class_array_signature,                "()[Ljava/lang/Class;")                                     \
645   template(void_string_signature,                     "()Ljava/lang/String;")                                     \
646   template(void_module_signature,                     "()Ljava/lang/Module;")                                     \
647   template(object_array_object_signature,             "([Ljava/lang/Object;)Ljava/lang/Object;")                  \
648   template(object_object_array_object_signature,      "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\
649   template(exception_void_signature,                  "(Ljava/lang/Exception;)V")                                 \
650   template(protectiondomain_signature,                "[Ljava/security/ProtectionDomain;")                        \
651   template(accesscontrolcontext_signature,            "Ljava/security/AccessControlContext;")                     \
652   template(class_protectiondomain_signature,          "(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V")     \
653   template(thread_signature,                          "Ljava/lang/Thread;")                                       \
654   template(thread_fieldholder_signature,              "Ljava/lang/Thread$FieldHolder;")                           \
655   template(thread_array_signature,                    "[Ljava/lang/Thread;")                                      \
656   template(threadgroup_signature,                     "Ljava/lang/ThreadGroup;")                                  \
657   template(threadgroup_array_signature,               "[Ljava/lang/ThreadGroup;")                                 \
658   template(class_array_signature,                     "[Ljava/lang/Class;")                                       \
659   template(classloader_signature,                     "Ljava/lang/ClassLoader;")                                  \
660   template(object_signature,                          "Ljava/lang/Object;")                                       \
661   template(object_array_signature,                    "[Ljava/lang/Object;")                                      \
662   template(class_signature,                           "Ljava/lang/Class;")                                        \
663   template(string_signature,                          "Ljava/lang/String;")                                       \
664   template(string_array_signature,                    "[Ljava/lang/String;")                                      \
665   template(reference_signature,                       "Ljava/lang/ref/Reference;")                                \
666   template(referencequeue_signature,                  "Ljava/lang/ref/ReferenceQueue;")                           \
667   template(weakreference_array_signature,             "[Ljava/lang/ref/WeakReference;")                           \
668   template(executable_signature,                      "Ljava/lang/reflect/Executable;")                           \
669   template(module_signature,                          "Ljava/lang/Module;")                                       \
670   template(concurrenthashmap_signature,               "Ljava/util/concurrent/ConcurrentHashMap;")                 \
671   template(String_StringBuilder_signature,            "(Ljava/lang/String;)Ljava/lang/StringBuilder;")            \
672   template(int_StringBuilder_signature,               "(I)Ljava/lang/StringBuilder;")                             \
673   template(char_StringBuilder_signature,              "(C)Ljava/lang/StringBuilder;")                             \
674   template(String_StringBuffer_signature,             "(Ljava/lang/String;)Ljava/lang/StringBuffer;")             \
675   template(int_StringBuffer_signature,                "(I)Ljava/lang/StringBuffer;")                              \
676   template(char_StringBuffer_signature,               "(C)Ljava/lang/StringBuffer;")                              \
677   template(int_String_signature,                      "(I)Ljava/lang/String;")                                    \
678   template(boolean_boolean_int_signature,             "(ZZ)I")                                                    \
679   template(big_integer_shift_worker_signature,        "([I[IIII)V")                                               \
680   template(reflect_method_signature,                  "Ljava/lang/reflect/Method;")                               \
681   template(getStackTrace_signature,                    "()[Ljava/lang/StackTraceElement;")                        \
682                                                                                                                   \
683   /* signature symbols needed by intrinsics */                                                                    \
684   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE)            \
685                                                                                                                   \
686   /* symbol aliases needed by intrinsics */                                                                       \
687   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, do_alias)           \
688                                                                                                                   \
689   /* returned by the C1 compiler in case there's not enough memory to allocate a new symbol*/                     \
690   template(dummy_symbol,                              "illegal symbol")                                           \
691                                                                                                                   \
692   /* used by ClassFormatError when class name is not known yet */                                                 \
693   template(unknown_class_name,                        "<Unknown>")                                                \
694                                                                                                                   \
695   /* JVM monitoring and management support */                                                                     \
696   template(java_lang_StackTraceElement_array,          "[Ljava/lang/StackTraceElement;")                          \
697   template(java_lang_management_ThreadState,           "java/lang/management/ThreadState")                        \
698   template(java_lang_management_MemoryUsage,           "java/lang/management/MemoryUsage")                        \
699   template(java_lang_management_ThreadInfo,            "java/lang/management/ThreadInfo")                         \
700   template(jdk_internal_agent_Agent,                   "jdk/internal/agent/Agent")                                \
701   template(sun_management_Sensor,                      "sun/management/Sensor")                                   \
702   template(sun_management_ManagementFactoryHelper,     "sun/management/ManagementFactoryHelper")                  \
703   template(com_sun_management_internal_DiagnosticCommandImpl,  "com/sun/management/internal/DiagnosticCommandImpl")     \
704   template(com_sun_management_internal_GarbageCollectorExtImpl,"com/sun/management/internal/GarbageCollectorExtImpl")   \
705   template(getDiagnosticCommandMBean_name,             "getDiagnosticCommandMBean")                               \
706   template(getDiagnosticCommandMBean_signature,        "()Lcom/sun/management/DiagnosticCommandMBean;")           \
707   template(getGcInfoBuilder_name,                      "getGcInfoBuilder")                                        \
708   template(getGcInfoBuilder_signature,                 "()Lcom/sun/management/internal/GcInfoBuilder;")           \
709   template(com_sun_management_GcInfo,                  "com/sun/management/GcInfo")                               \
710   template(com_sun_management_GcInfo_constructor_signature, "(Lcom/sun/management/internal/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V") \
711   template(createGCNotification_name,                  "createGCNotification")                                    \
712   template(createGCNotification_signature,             "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/sun/management/GcInfo;)V") \
713   template(createDiagnosticFrameworkNotification_name, "createDiagnosticFrameworkNotification")                   \
714   template(trigger_name,                               "trigger")                                                 \
715   template(clear_name,                                 "clear")                                                   \
716   template(trigger_method_signature,                   "(ILjava/lang/management/MemoryUsage;)V")                  \
717   template(startAgent_name,                            "startAgent")                                              \
718   template(startRemoteAgent_name,                      "startRemoteManagementAgent")                              \
719   template(startLocalAgent_name,                       "startLocalManagementAgent")                               \
720   template(stopRemoteAgent_name,                       "stopRemoteManagementAgent")                               \
721   template(getAgentStatus_name,                        "getManagementAgentStatus")                                \
722   template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \
723   template(java_lang_management_ThreadInfo_with_locks_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;[Ljava/lang/Object;[I[Ljava/lang/Object;)V") \
724   template(long_long_long_long_void_signature,         "(JJJJ)V")                                                 \
725   template(finalizer_histogram_klass,                  "java/lang/ref/FinalizerHistogram")                        \
726   template(void_finalizer_histogram_entry_array_signature,  "()[Ljava/lang/ref/FinalizerHistogram$Entry;")                        \
727   template(get_finalizer_histogram_name,               "getFinalizerHistogram")                                   \
728   template(finalizer_histogram_entry_name_field,       "className")                                               \
729   template(finalizer_histogram_entry_count_field,      "instanceCount")                                           \
730                                                                                                                   \
731   template(java_lang_management_MemoryPoolMXBean,      "java/lang/management/MemoryPoolMXBean")                   \
732   template(java_lang_management_MemoryManagerMXBean,   "java/lang/management/MemoryManagerMXBean")                \
733   template(java_lang_management_GarbageCollectorMXBean,"java/lang/management/GarbageCollectorMXBean")             \
734   template(gcInfoBuilder_name,                         "gcInfoBuilder")                                           \
735   template(createMemoryPool_name,                      "createMemoryPool")                                        \
736   template(createMemoryManager_name,                   "createMemoryManager")                                     \
737   template(createGarbageCollector_name,                "createGarbageCollector")                                  \
738   template(createMemoryPool_signature,                 "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMXBean;") \
739   template(createMemoryManager_signature,              "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMXBean;") \
740   template(createGarbageCollector_signature,           "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMXBean;") \
741   template(addThreadDumpForMonitors_name,              "addThreadDumpForMonitors")                                \
742   template(addThreadDumpForSynchronizers_name,         "addThreadDumpForSynchronizers")                           \
743   template(addThreadDumpForMonitors_signature,         "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;[I)V") \
744   template(addThreadDumpForSynchronizers_signature,    "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;)V")   \
745                                                                                                                   \
746   /* JVMTI/java.lang.instrument support and VM Attach mechanism */                                                \
747   template(jdk_internal_module_Modules,                "jdk/internal/module/Modules")                             \
748   template(jdk_internal_vm_VMSupport,                  "jdk/internal/vm/VMSupport")                               \
749   template(addReads_name,                              "addReads")                                                \
750   template(addReads_signature,                         "(Ljava/lang/Module;Ljava/lang/Module;)V")                 \
751   template(addExports_name,                            "addExports")                                              \
752   template(addOpens_name,                              "addOpens")                                                \
753   template(addExports_signature,                       "(Ljava/lang/Module;Ljava/lang/String;Ljava/lang/Module;)V") \
754   template(addUses_name,                               "addUses")                                                 \
755   template(addUses_signature,                          "(Ljava/lang/Module;Ljava/lang/Class;)V")                  \
756   template(addProvides_name,                           "addProvides")                                             \
757   template(addProvides_signature,                      "(Ljava/lang/Module;Ljava/lang/Class;Ljava/lang/Class;)V") \
758   template(loadModule_name,                            "loadModule")                                              \
759   template(loadModule_signature,                       "(Ljava/lang/String;)Ljava/lang/Module;")                  \
760   template(transformedByAgent_name,                    "transformedByAgent")                                      \
761   template(transformedByAgent_signature,               "(Ljava/lang/Module;)V")                                   \
762   template(appendToClassPathForInstrumentation_name,   "appendToClassPathForInstrumentation")                     \
763   do_alias(appendToClassPathForInstrumentation_signature, string_void_signature)                                  \
764   template(serializePropertiesToByteArray_name,        "serializePropertiesToByteArray")                          \
765   template(serializeAgentPropertiesToByteArray_name,   "serializeAgentPropertiesToByteArray")                     \
766   template(encodeThrowable_name,                       "encodeThrowable")                                         \
767   template(encodeThrowable_signature,                  "(Ljava/lang/Throwable;JI)I")                              \
768   template(decodeAndThrowThrowable_name,               "decodeAndThrowThrowable")                                 \
769   template(encodeAnnotations_name,                     "encodeAnnotations")                                       \
770   template(encodeAnnotations_signature,                "([BLjava/lang/Class;Ljdk/internal/reflect/ConstantPool;Z[Ljava/lang/Class;)[B")\
771   template(decodeAndThrowThrowable_signature,          "(IJZ)V")                                                  \
772   template(classRedefinedCount_name,                   "classRedefinedCount")                                     \
773   template(classLoader_name,                           "classLoader")                                             \
774   template(componentType_name,                         "componentType")                                           \
775   template(primaryType_name,                           "primaryType")                                             \
776   template(secondaryType_name,                         "secondaryType")                                           \
777                                                                                                                   \
778   /* forEachRemaining support */                                                                                  \
779   template(java_util_stream_StreamsRangeIntSpliterator,          "java/util/stream/Streams$RangeIntSpliterator")  \
780                                                                                                                   \
781   /* jfr signatures */                                                                                            \
782   JFR_TEMPLATES(template)                                                                                         \
783                                                                                                                   \
784   /* CDS */                                                                                                       \
785   template(dumpSharedArchive,                               "dumpSharedArchive")                                  \
786   template(dumpSharedArchive_signature,                     "(ZLjava/lang/String;)Ljava/lang/String;")            \
787   template(generateLambdaFormHolderClasses,                 "generateLambdaFormHolderClasses")                    \
788   template(generateLambdaFormHolderClasses_signature,       "([Ljava/lang/String;)[Ljava/lang/Object;")           \
789   template(java_lang_Enum,                                  "java/lang/Enum")                                     \
790   template(java_lang_invoke_Invokers_Holder,                "java/lang/invoke/Invokers$Holder")                   \
791   template(java_lang_invoke_DirectMethodHandle_Holder,      "java/lang/invoke/DirectMethodHandle$Holder")         \
792   template(java_lang_invoke_LambdaForm_Holder,              "java/lang/invoke/LambdaForm$Holder")                 \
793   template(java_lang_invoke_DelegatingMethodHandle_Holder,  "java/lang/invoke/DelegatingMethodHandle$Holder")     \
794   template(jdk_internal_loader_ClassLoaders,                "jdk/internal/loader/ClassLoaders")                   \
795   template(jdk_internal_misc_CDS,                           "jdk/internal/misc/CDS")                              \
796   template(java_util_concurrent_ConcurrentHashMap,          "java/util/concurrent/ConcurrentHashMap")             \
797   template(java_util_ArrayList,                             "java/util/ArrayList")                                \
798   template(toFileURL_name,                                  "toFileURL")                                          \
799   template(toFileURL_signature,                             "(Ljava/lang/String;)Ljava/net/URL;")                 \
800   template(url_void_signature,                              "(Ljava/net/URL;)V")                                  \
801   template(url_array_classloader_void_signature,            "([Ljava/net/URL;Ljava/lang/ClassLoader;)V")          \
802                                                                                                                   \
803   template(java_lang_runtime_ValueObjectMethods,            "java/lang/runtime/ValueObjectMethods")               \
804   template(isSubstitutable_name,                            "isSubstitutable")                                    \
805   template(valueObjectHashCode_name,                        "valueObjectHashCode")                                \
806   template(jdk_internal_value_PrimitiveClass,               "jdk/internal/value/PrimitiveClass")                  \
807   template(jdk_internal_value_ValueClass,                   "jdk/internal/value/ValueClass")                      \
808                                                                                                                   \
809   /* Thread.dump_to_file jcmd */                                                                                  \
810   template(jdk_internal_vm_ThreadDumper,           "jdk/internal/vm/ThreadDumper")                                \
811   template(dumpThreads_name,                       "dumpThreads")                                                 \
812   template(dumpThreadsToJson_name,                 "dumpThreadsToJson")                                           \
813 
814   /*end*/
815 
816 // enum for figuring positions and size of Symbol::_vm_symbols[]
817 enum class vmSymbolID : int {
818   // [FIRST_SID ... LAST_SID] is the iteration range for the *valid* symbols.
819   // NO_SID is used to indicate an invalid symbol. Some implementation code
820   // *may* read _vm_symbols[NO_SID], so it must be a valid array index.
821   NO_SID = 0,                // exclusive lower limit
822 
823   #define VM_SYMBOL_ENUM(name, string) VM_SYMBOL_ENUM_NAME_(name),
824   VM_SYMBOLS_DO(VM_SYMBOL_ENUM, VM_ALIAS_IGNORE)
825   #undef VM_SYMBOL_ENUM
826 
827   SID_LIMIT,                 // exclusive upper limit
828 
829   #define VM_ALIAS_ENUM(name, def) VM_SYMBOL_ENUM_NAME_(name) = VM_SYMBOL_ENUM_NAME_(def),
830   VM_SYMBOLS_DO(VM_SYMBOL_IGNORE, VM_ALIAS_ENUM)
831   #undef VM_ALIAS_ENUM
832 
833   FIRST_SID = NO_SID + 1,    // inclusive lower limit
834   LAST_SID = SID_LIMIT - 1,  // inclusive upper limit
835 };
836 
837 ENUMERATOR_RANGE(vmSymbolID, vmSymbolID::FIRST_SID, vmSymbolID::LAST_SID)
838 
839 class vmSymbols: AllStatic {
840   friend class vmIntrinsics;
841   friend class VMStructs;
842   friend class JVMCIVMStructs;
843 
844   static const int NO_SID    = static_cast<int>(vmSymbolID::NO_SID);    // exclusive lower limit
845   static const int FIRST_SID = static_cast<int>(vmSymbolID::FIRST_SID); // inclusive lower limit
846   static const int LAST_SID  = static_cast<int>(vmSymbolID::FIRST_SID); // inclusive upper limit
847   static const int SID_LIMIT = static_cast<int>(vmSymbolID::SID_LIMIT); // exclusive upper limit
848 
849  public:
850   static constexpr bool is_valid_id(int id) {
851     return (id >= FIRST_SID && id < SID_LIMIT);
852   }
853   static constexpr bool is_valid_id(vmSymbolID sid) {
854     return is_valid_id(static_cast<int>(sid));
855   }
856 
857   static constexpr vmSymbolID as_SID(int id) {
858     assert(is_valid_id(id), "must be");
859     return static_cast<vmSymbolID>(id);
860   }
861 
862   static constexpr int as_int(vmSymbolID sid) {
863     assert(is_valid_id(sid), "must be");
864     return static_cast<int>(sid);
865   }
866 
867   static constexpr int number_of_symbols() {
868     static_assert(NO_SID == 0, "must be a valid array index");
869     static_assert(FIRST_SID == 1, "must not be the same as NO_SID");
870     return SID_LIMIT;
871   }
872 
873   enum {
874     log2_SID_LIMIT = 11         // checked by an assert at start-up
875   };
876 
877  private:
878 
879   // Field signatures indexed by BasicType.
880   static Symbol* _type_signatures[T_VOID+1];
881 
882  public:
883   // Initialization
884   static void initialize();
885   // Accessing
886   #define VM_SYMBOL_DECLARE(name, ignore)                 \
887     static Symbol* name() {                               \
888       return Symbol::_vm_symbols[static_cast<int>(VM_SYMBOL_ENUM_NAME(name))]; \
889     }
890   VM_SYMBOLS_DO(VM_SYMBOL_DECLARE, VM_SYMBOL_DECLARE)
891   #undef VM_SYMBOL_DECLARE
892 
893   // Sharing support
894   static void symbols_do(SymbolClosure* f);
895   static void metaspace_pointers_do(MetaspaceClosure *it);
896   static void serialize(SerializeClosure* soc);
897 
898   static Symbol* type_signature(BasicType t) {
899     assert((uint)t < T_VOID+1, "range check");
900     assert(_type_signatures[t] != nullptr, "domain check");
901     return _type_signatures[t];
902   }
903 
904   static Symbol* symbol_at(vmSymbolID id) {
905     return Symbol::vm_symbol_at(id);
906   }
907 
908   // Returns symbol's vmSymbolID if one is assigned, else vmSymbolID::NO_SID.
909   static vmSymbolID find_sid(const Symbol* symbol);
910   static vmSymbolID find_sid(const char* symbol_name);
911 
912 #ifndef PRODUCT
913   // No need for this in the product:
914   static const char* name_for(vmSymbolID sid);
915 #endif //PRODUCT
916 };
917 
918 #endif // SHARE_CLASSFILE_VMSYMBOLS_HPP