1 /*
   2  * Copyright (c) 1997, 2011, 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_VM_CLASSFILE_VMSYMBOLS_HPP
  26 #define SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
  27 
  28 #include "oops/symbol.hpp"
  29 #include "memory/iterator.hpp"
  30 
  31 // The class vmSymbols is a name space for fast lookup of
  32 // symbols commonly used in the VM.
  33 //
  34 // Sample usage:
  35 //
  36 //   Symbol* obj       = vmSymbols::java_lang_Object();
  37 
  38 
  39 // Useful sub-macros exported by this header file:
  40 
  41 #define VM_SYMBOL_ENUM_NAME(name)    name##_enum
  42 #define VM_INTRINSIC_IGNORE(id, class, name, sig, flags) /*ignored*/
  43 #define VM_SYMBOL_IGNORE(id, name)                       /*ignored*/
  44 #define VM_ALIAS_IGNORE(id, id2)                         /*ignored*/
  45 
  46 
  47 // Mapping function names to values. New entries should be added below.
  48 
  49 #define VM_SYMBOLS_DO(template, do_alias)                                                         \
  50   /* commonly used class names */                                                                 \
  51   template(java_lang_System,                          "java/lang/System")                         \
  52   template(java_lang_Object,                          "java/lang/Object")                         \
  53   template(java_lang_Class,                           "java/lang/Class")                          \
  54   template(java_lang_String,                          "java/lang/String")                         \
  55   template(java_lang_StringValue,                     "java/lang/StringValue")                    \
  56   template(java_lang_StringCache,                     "java/lang/StringValue$StringCache")        \
  57   template(java_lang_Thread,                          "java/lang/Thread")                         \
  58   template(java_lang_ThreadGroup,                     "java/lang/ThreadGroup")                    \
  59   template(java_lang_Cloneable,                       "java/lang/Cloneable")                      \
  60   template(java_lang_Throwable,                       "java/lang/Throwable")                      \
  61   template(java_lang_ClassLoader,                     "java/lang/ClassLoader")                    \
  62   template(java_lang_ClassLoader_NativeLibrary,       "java/lang/ClassLoader\x024NativeLibrary")  \
  63   template(java_lang_ThreadDeath,                     "java/lang/ThreadDeath")                    \
  64   template(java_lang_Boolean,                         "java/lang/Boolean")                        \
  65   template(java_lang_Character,                       "java/lang/Character")                      \
  66   template(java_lang_Character_CharacterCache,        "java/lang/Character$CharacterCache")       \
  67   template(java_lang_Float,                           "java/lang/Float")                          \
  68   template(java_lang_Double,                          "java/lang/Double")                         \
  69   template(java_lang_Byte,                            "java/lang/Byte")                           \
  70   template(java_lang_Byte_Cache,                      "java/lang/Byte$ByteCache")                 \
  71   template(java_lang_Short,                           "java/lang/Short")                          \
  72   template(java_lang_Short_ShortCache,                "java/lang/Short$ShortCache")               \
  73   template(java_lang_Integer,                         "java/lang/Integer")                        \
  74   template(java_lang_Integer_IntegerCache,            "java/lang/Integer$IntegerCache")           \
  75   template(java_lang_Long,                            "java/lang/Long")                           \
  76   template(java_lang_Long_LongCache,                  "java/lang/Long$LongCache")                 \
  77   template(java_lang_Shutdown,                        "java/lang/Shutdown")                       \
  78   template(java_lang_ref_Reference,                   "java/lang/ref/Reference")                  \
  79   template(java_lang_ref_SoftReference,               "java/lang/ref/SoftReference")              \
  80   template(java_lang_ref_WeakReference,               "java/lang/ref/WeakReference")              \
  81   template(java_lang_ref_FinalReference,              "java/lang/ref/FinalReference")             \
  82   template(java_lang_ref_PhantomReference,            "java/lang/ref/PhantomReference")           \
  83   template(java_lang_ref_Finalizer,                   "java/lang/ref/Finalizer")                  \
  84   template(java_lang_reflect_AccessibleObject,        "java/lang/reflect/AccessibleObject")       \
  85   template(java_lang_reflect_Method,                  "java/lang/reflect/Method")                 \
  86   template(java_lang_reflect_Constructor,             "java/lang/reflect/Constructor")            \
  87   template(java_lang_reflect_Field,                   "java/lang/reflect/Field")                  \
  88   template(java_lang_reflect_Array,                   "java/lang/reflect/Array")                  \
  89   template(java_lang_StringBuffer,                    "java/lang/StringBuffer")                   \
  90   template(java_lang_StringBuilder,                   "java/lang/StringBuilder")                  \
  91   template(java_lang_CharSequence,                    "java/lang/CharSequence")                   \
  92   template(java_security_AccessControlContext,        "java/security/AccessControlContext")       \
  93   template(java_security_ProtectionDomain,            "java/security/ProtectionDomain")           \
  94   template(java_io_OutputStream,                      "java/io/OutputStream")                     \
  95   template(java_io_Reader,                            "java/io/Reader")                           \
  96   template(java_io_BufferedReader,                    "java/io/BufferedReader")                   \
  97   template(java_io_FileInputStream,                   "java/io/FileInputStream")                  \
  98   template(java_io_ByteArrayInputStream,              "java/io/ByteArrayInputStream")             \
  99   template(java_io_Serializable,                      "java/io/Serializable")                     \
 100   template(java_util_Arrays,                          "java/util/Arrays")                         \
 101   template(java_util_Properties,                      "java/util/Properties")                     \
 102   template(java_util_Vector,                          "java/util/Vector")                         \
 103   template(java_util_AbstractList,                    "java/util/AbstractList")                   \
 104   template(java_util_Hashtable,                       "java/util/Hashtable")                      \
 105   template(java_util_HashMap,                         "java/util/HashMap")                        \
 106   template(java_lang_Compiler,                        "java/lang/Compiler")                       \
 107   template(sun_misc_Signal,                           "sun/misc/Signal")                          \
 108   template(java_lang_AssertionStatusDirectives,       "java/lang/AssertionStatusDirectives")      \
 109   template(sun_jkernel_DownloadManager,               "sun/jkernel/DownloadManager")              \
 110   template(getBootClassPathEntryForClass_name,        "getBootClassPathEntryForClass")            \
 111   template(setBootClassLoaderHook_name,               "setBootClassLoaderHook")                   \
 112   template(sun_misc_PostVMInitHook,                   "sun/misc/PostVMInitHook")                  \
 113                                                                                                   \
 114   /* class file format tags */                                                                    \
 115   template(tag_source_file,                           "SourceFile")                               \
 116   template(tag_inner_classes,                         "InnerClasses")                             \
 117   template(tag_constant_value,                        "ConstantValue")                            \
 118   template(tag_code,                                  "Code")                                     \
 119   template(tag_exceptions,                            "Exceptions")                               \
 120   template(tag_line_number_table,                     "LineNumberTable")                          \
 121   template(tag_local_variable_table,                  "LocalVariableTable")                       \
 122   template(tag_local_variable_type_table,             "LocalVariableTypeTable")                   \
 123   template(tag_stack_map_table,                       "StackMapTable")                            \
 124   template(tag_synthetic,                             "Synthetic")                                \
 125   template(tag_deprecated,                            "Deprecated")                               \
 126   template(tag_source_debug_extension,                "SourceDebugExtension")                     \
 127   template(tag_signature,                             "Signature")                                \
 128   template(tag_runtime_visible_annotations,           "RuntimeVisibleAnnotations")                \
 129   template(tag_runtime_invisible_annotations,         "RuntimeInvisibleAnnotations")              \
 130   template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations")       \
 131   template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations")    \
 132   template(tag_annotation_default,                    "AnnotationDefault")                        \
 133   template(tag_enclosing_method,                      "EnclosingMethod")                          \
 134   template(tag_bootstrap_methods,                     "BootstrapMethods")                         \
 135                                                                                                   \
 136   /* exception klasses: at least all exceptions thrown by the VM have entries here */             \
 137   template(java_lang_ArithmeticException,             "java/lang/ArithmeticException")            \
 138   template(java_lang_ArrayIndexOutOfBoundsException,  "java/lang/ArrayIndexOutOfBoundsException") \
 139   template(java_lang_ArrayStoreException,             "java/lang/ArrayStoreException")            \
 140   template(java_lang_ClassCastException,              "java/lang/ClassCastException")             \
 141   template(java_lang_ClassNotFoundException,          "java/lang/ClassNotFoundException")         \
 142   template(java_lang_CloneNotSupportedException,      "java/lang/CloneNotSupportedException")     \
 143   template(java_lang_IllegalAccessException,          "java/lang/IllegalAccessException")         \
 144   template(java_lang_IllegalArgumentException,        "java/lang/IllegalArgumentException")       \
 145   template(java_lang_IllegalStateException,           "java/lang/IllegalStateException")          \
 146   template(java_lang_IllegalMonitorStateException,    "java/lang/IllegalMonitorStateException")   \
 147   template(java_lang_IllegalThreadStateException,     "java/lang/IllegalThreadStateException")    \
 148   template(java_lang_IndexOutOfBoundsException,       "java/lang/IndexOutOfBoundsException")      \
 149   template(java_lang_InstantiationException,          "java/lang/InstantiationException")         \
 150   template(java_lang_InstantiationError,              "java/lang/InstantiationError")             \
 151   template(java_lang_InterruptedException,            "java/lang/InterruptedException")           \
 152   template(java_lang_LinkageError,                    "java/lang/LinkageError")                   \
 153   template(java_lang_NegativeArraySizeException,      "java/lang/NegativeArraySizeException")     \
 154   template(java_lang_NoSuchFieldException,            "java/lang/NoSuchFieldException")           \
 155   template(java_lang_NoSuchMethodException,           "java/lang/NoSuchMethodException")          \
 156   template(java_lang_NullPointerException,            "java/lang/NullPointerException")           \
 157   template(java_lang_StringIndexOutOfBoundsException, "java/lang/StringIndexOutOfBoundsException")\
 158   template(java_lang_InvalidClassException,           "java/lang/InvalidClassException")          \
 159   template(java_lang_reflect_InvocationTargetException, "java/lang/reflect/InvocationTargetException") \
 160   template(java_lang_Exception,                       "java/lang/Exception")                      \
 161   template(java_lang_RuntimeException,                "java/lang/RuntimeException")               \
 162   template(java_io_IOException,                       "java/io/IOException")                      \
 163   template(java_security_PrivilegedActionException,   "java/security/PrivilegedActionException")  \
 164                                                                                                   \
 165   /* error klasses: at least all errors thrown by the VM have entries here */                     \
 166   template(java_lang_AbstractMethodError,             "java/lang/AbstractMethodError")            \
 167   template(java_lang_ClassCircularityError,           "java/lang/ClassCircularityError")          \
 168   template(java_lang_ClassFormatError,                "java/lang/ClassFormatError")               \
 169   template(java_lang_UnsupportedClassVersionError,    "java/lang/UnsupportedClassVersionError")   \
 170   template(java_lang_Error,                           "java/lang/Error")                          \
 171   template(java_lang_ExceptionInInitializerError,     "java/lang/ExceptionInInitializerError")    \
 172   template(java_lang_IllegalAccessError,              "java/lang/IllegalAccessError")             \
 173   template(java_lang_IncompatibleClassChangeError,    "java/lang/IncompatibleClassChangeError")   \
 174   template(java_lang_InternalError,                   "java/lang/InternalError")                  \
 175   template(java_lang_NoClassDefFoundError,            "java/lang/NoClassDefFoundError")           \
 176   template(java_lang_NoSuchFieldError,                "java/lang/NoSuchFieldError")               \
 177   template(java_lang_NoSuchMethodError,               "java/lang/NoSuchMethodError")              \
 178   template(java_lang_OutOfMemoryError,                "java/lang/OutOfMemoryError")               \
 179   template(java_lang_UnsatisfiedLinkError,            "java/lang/UnsatisfiedLinkError")           \
 180   template(java_lang_VerifyError,                     "java/lang/VerifyError")                    \
 181   template(java_lang_SecurityException,               "java/lang/SecurityException")              \
 182   template(java_lang_VirtualMachineError,             "java/lang/VirtualMachineError")            \
 183   template(java_lang_StackOverflowError,              "java/lang/StackOverflowError")             \
 184   template(java_lang_StackTraceElement,               "java/lang/StackTraceElement")              \
 185   template(java_util_concurrent_locks_AbstractOwnableSynchronizer,   "java/util/concurrent/locks/AbstractOwnableSynchronizer") \
 186                                                                                                   \
 187   /* class symbols needed by intrinsics */                                                        \
 188   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
 189                                                                                                   \
 190   /* Support for reflection based on dynamic bytecode generation (JDK 1.4 and above) */           \
 191                                                                                                   \
 192   template(sun_reflect_FieldInfo,                     "sun/reflect/FieldInfo")                    \
 193   template(sun_reflect_MethodInfo,                    "sun/reflect/MethodInfo")                   \
 194   template(sun_reflect_MagicAccessorImpl,             "sun/reflect/MagicAccessorImpl")            \
 195   template(sun_reflect_MethodAccessorImpl,            "sun/reflect/MethodAccessorImpl")           \
 196   template(sun_reflect_ConstructorAccessorImpl,       "sun/reflect/ConstructorAccessorImpl")      \
 197   template(sun_reflect_SerializationConstructorAccessorImpl, "sun/reflect/SerializationConstructorAccessorImpl") \
 198   template(sun_reflect_DelegatingClassLoader,         "sun/reflect/DelegatingClassLoader")        \
 199   template(sun_reflect_Reflection,                    "sun/reflect/Reflection")                   \
 200   template(checkedExceptions_name,                    "checkedExceptions")                        \
 201   template(clazz_name,                                "clazz")                                    \
 202   template(exceptionTypes_name,                       "exceptionTypes")                           \
 203   template(modifiers_name,                            "modifiers")                                \
 204   template(newConstructor_name,                       "newConstructor")                           \
 205   template(newConstructor_signature,                  "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Constructor;") \
 206   template(newField_name,                             "newField")                                 \
 207   template(newField_signature,                        "(Lsun/reflect/FieldInfo;)Ljava/lang/reflect/Field;") \
 208   template(newMethod_name,                            "newMethod")                                \
 209   template(newMethod_signature,                       "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Method;") \
 210   /* the following two names must be in order: */                                                 \
 211   template(invokeExact_name,                          "invokeExact")                              \
 212   template(invokeGeneric_name,                        "invokeGeneric")                            \
 213   template(invokeVarargs_name,                        "invokeVarargs")                            \
 214   template(star_name,                                 "*") /*not really a name*/                  \
 215   template(invoke_name,                               "invoke")                                   \
 216   template(override_name,                             "override")                                 \
 217   template(parameterTypes_name,                       "parameterTypes")                           \
 218   template(returnType_name,                           "returnType")                               \
 219   template(signature_name,                            "signature")                                \
 220   template(slot_name,                                 "slot")                                     \
 221                                                                                                   \
 222   /* Support for annotations (JDK 1.5 and above) */                                               \
 223                                                                                                   \
 224   template(annotations_name,                          "annotations")                              \
 225   template(parameter_annotations_name,                "parameterAnnotations")                     \
 226   template(annotation_default_name,                   "annotationDefault")                        \
 227   template(sun_reflect_ConstantPool,                  "sun/reflect/ConstantPool")                 \
 228   template(constantPoolOop_name,                      "constantPoolOop")                          \
 229   template(sun_reflect_UnsafeStaticFieldAccessorImpl, "sun/reflect/UnsafeStaticFieldAccessorImpl")\
 230   template(base_name,                                 "base")                                     \
 231                                                                                                   \
 232   /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */                                   \
 233   template(java_dyn_InvokeDynamic,                    "java/dyn/InvokeDynamic")                   \
 234   template(java_dyn_Linkage,                          "java/dyn/Linkage")                         \
 235   template(java_dyn_CallSite,                         "java/dyn/CallSite")                        \
 236   template(java_dyn_MethodHandle,                     "java/dyn/MethodHandle")                    \
 237   template(java_dyn_MethodType,                       "java/dyn/MethodType")                      \
 238   template(java_dyn_WrongMethodTypeException,         "java/dyn/WrongMethodTypeException")        \
 239   template(java_dyn_MethodType_signature,             "Ljava/dyn/MethodType;")                    \
 240   template(java_dyn_MethodHandle_signature,           "Ljava/dyn/MethodHandle;")                  \
 241   /* internal classes known only to the JVM: */                                                   \
 242   template(java_dyn_MethodTypeForm,                   "java/dyn/MethodTypeForm")                  \
 243   template(java_dyn_MethodTypeForm_signature,         "Ljava/dyn/MethodTypeForm;")                \
 244   template(sun_dyn_MemberName,                        "sun/dyn/MemberName")                       \
 245   template(sun_dyn_MemberName_signature,              "Lsun/dyn/MemberName;")                     \
 246   template(sun_dyn_MethodHandleImpl,                  "sun/dyn/MethodHandleImpl")                 \
 247   template(sun_dyn_MethodHandleNatives,               "sun/dyn/MethodHandleNatives")              \
 248   template(sun_dyn_AdapterMethodHandle,               "sun/dyn/AdapterMethodHandle")              \
 249   template(sun_dyn_BoundMethodHandle,                 "sun/dyn/BoundMethodHandle")                \
 250   template(sun_dyn_DirectMethodHandle,                "sun/dyn/DirectMethodHandle")               \
 251   /* internal up-calls made only by the JVM, via class sun.dyn.MethodHandleNatives: */            \
 252   template(findMethodHandleType_name,                 "findMethodHandleType")                     \
 253   template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/dyn/MethodType;") \
 254   template(notifyGenericMethodType_name,              "notifyGenericMethodType")                  \
 255   template(notifyGenericMethodType_signature,         "(Ljava/dyn/MethodType;)V")                 \
 256   template(linkMethodHandleConstant_name,             "linkMethodHandleConstant")                 \
 257   template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/dyn/MethodHandle;") \
 258   template(makeDynamicCallSite_name,                  "makeDynamicCallSite")                      \
 259   template(makeDynamicCallSite_signature, "(Ljava/dyn/MethodHandle;Ljava/lang/String;Ljava/dyn/MethodType;Ljava/lang/Object;Lsun/dyn/MemberName;I)Ljava/dyn/CallSite;") \
 260   NOT_LP64(  do_alias(machine_word_signature,         int_signature)  )                           \
 261   LP64_ONLY( do_alias(machine_word_signature,         long_signature) )                           \
 262                                                                                                   \
 263   /* common method and field names */                                                             \
 264   template(object_initializer_name,                   "<init>")                                   \
 265   template(class_initializer_name,                    "<clinit>")                                 \
 266   template(println_name,                              "println")                                  \
 267   template(printStackTrace_name,                      "printStackTrace")                          \
 268   template(main_name,                                 "main")                                     \
 269   template(name_name,                                 "name")                                     \
 270   template(priority_name,                             "priority")                                 \
 271   template(stillborn_name,                            "stillborn")                                \
 272   template(group_name,                                "group")                                    \
 273   template(daemon_name,                               "daemon")                                   \
 274   template(eetop_name,                                "eetop")                                    \
 275   template(thread_status_name,                        "threadStatus")                             \
 276   template(run_method_name,                           "run")                                      \
 277   template(exit_method_name,                          "exit")                                     \
 278   template(add_method_name,                           "add")                                      \
 279   template(parent_name,                               "parent")                                   \
 280   template(threads_name,                              "threads")                                  \
 281   template(groups_name,                               "groups")                                   \
 282   template(maxPriority_name,                          "maxPriority")                              \
 283   template(destroyed_name,                            "destroyed")                                \
 284   template(vmAllowSuspension_name,                    "vmAllowSuspension")                        \
 285   template(nthreads_name,                             "nthreads")                                 \
 286   template(ngroups_name,                              "ngroups")                                  \
 287   template(shutdown_method_name,                      "shutdown")                                 \
 288   template(finalize_method_name,                      "finalize")                                 \
 289   template(reference_lock_name,                       "lock")                                     \
 290   template(reference_discovered_name,                 "discovered")                               \
 291   template(run_finalizers_on_exit_name,               "runFinalizersOnExit")                      \
 292   template(uncaughtException_name,                    "uncaughtException")                        \
 293   template(dispatchUncaughtException_name,            "dispatchUncaughtException")                \
 294   template(initializeSystemClass_name,                "initializeSystemClass")                    \
 295   template(loadClass_name,                            "loadClass")                                \
 296   template(loadClassInternal_name,                    "loadClassInternal")                        \
 297   template(get_name,                                  "get")                                      \
 298   template(put_name,                                  "put")                                      \
 299   template(type_name,                                 "type")                                     \
 300   template(findNative_name,                           "findNative")                               \
 301   template(deadChild_name,                            "deadChild")                                \
 302   template(addClass_name,                             "addClass")                                 \
 303   template(getFromClass_name,                         "getFromClass")                             \
 304   template(dispatch_name,                             "dispatch")                                 \
 305   template(getSystemClassLoader_name,                 "getSystemClassLoader")                     \
 306   template(fillInStackTrace_name,                     "fillInStackTrace")                         \
 307   template(getCause_name,                             "getCause")                                 \
 308   template(initCause_name,                            "initCause")                                \
 309   template(setProperty_name,                          "setProperty")                              \
 310   template(getProperty_name,                          "getProperty")                              \
 311   template(context_name,                              "context")                                  \
 312   template(privilegedContext_name,                    "privilegedContext")                        \
 313   template(contextClassLoader_name,                   "contextClassLoader")                       \
 314   template(inheritedAccessControlContext_name,        "inheritedAccessControlContext")            \
 315   template(isPrivileged_name,                         "isPrivileged")                             \
 316   template(wait_name,                                 "wait")                                     \
 317   template(checkPackageAccess_name,                   "checkPackageAccess")                       \
 318   template(stackSize_name,                            "stackSize")                                \
 319   template(thread_id_name,                            "tid")                                      \
 320   template(newInstance0_name,                         "newInstance0")                             \
 321   template(limit_name,                                "limit")                                    \
 322   template(forName_name,                              "forName")                                  \
 323   template(forName0_name,                             "forName0")                                 \
 324   template(isJavaIdentifierStart_name,                "isJavaIdentifierStart")                    \
 325   template(isJavaIdentifierPart_name,                 "isJavaIdentifierPart")                     \
 326   template(exclusive_owner_thread_name,               "exclusiveOwnerThread")                     \
 327   template(park_blocker_name,                         "parkBlocker")                              \
 328   template(park_event_name,                           "nativeParkEventPointer")                   \
 329   template(cache_field_name,                          "cache")                                    \
 330   template(value_name,                                "value")                                    \
 331   template(frontCacheEnabled_name,                    "frontCacheEnabled")                        \
 332   template(stringCacheEnabled_name,                   "stringCacheEnabled")                       \
 333   template(numberOfLeadingZeros_name,                 "numberOfLeadingZeros")                     \
 334   template(numberOfTrailingZeros_name,                "numberOfTrailingZeros")                    \
 335   template(bitCount_name,                             "bitCount")                                 \
 336   template(profile_name,                              "profile")                                  \
 337   template(equals_name,                               "equals")                                   \
 338   template(target_name,                               "target")                                   \
 339   template(toString_name,                             "toString")                                 \
 340   template(values_name,                               "values")                                   \
 341   template(receiver_name,                             "receiver")                                 \
 342   template(vmmethod_name,                             "vmmethod")                                 \
 343   template(vmtarget_name,                             "vmtarget")                                 \
 344   template(vmentry_name,                              "vmentry")                                  \
 345   template(vmslots_name,                              "vmslots")                                  \
 346   template(vmindex_name,                              "vmindex")                                  \
 347   template(vmargslot_name,                            "vmargslot")                                \
 348   template(flags_name,                                "flags")                                    \
 349   template(argument_name,                             "argument")                                 \
 350   template(conversion_name,                           "conversion")                               \
 351   template(rtype_name,                                "rtype")                                    \
 352   template(ptypes_name,                               "ptypes")                                   \
 353   template(form_name,                                 "form")                                     \
 354   template(erasedType_name,                           "erasedType")                               \
 355   template(genericInvoker_name,                       "genericInvoker")                           \
 356   template(append_name,                               "append")                                   \
 357                                                                                                   \
 358   /* non-intrinsic name/signature pairs: */                                                       \
 359   template(register_method_name,                      "register")                                 \
 360   do_alias(register_method_signature,         object_void_signature)                              \
 361                                                                                                   \
 362   /* name symbols needed by intrinsics */                                                         \
 363   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
 364                                                                                                   \
 365   /* common signatures names */                                                                   \
 366   template(void_method_signature,                     "()V")                                      \
 367   template(void_boolean_signature,                    "()Z")                                      \
 368   template(void_byte_signature,                       "()B")                                      \
 369   template(void_char_signature,                       "()C")                                      \
 370   template(void_short_signature,                      "()S")                                      \
 371   template(void_int_signature,                        "()I")                                      \
 372   template(void_long_signature,                       "()J")                                      \
 373   template(void_float_signature,                      "()F")                                      \
 374   template(void_double_signature,                     "()D")                                      \
 375   template(int_void_signature,                        "(I)V")                                     \
 376   template(int_int_signature,                         "(I)I")                                     \
 377   template(char_char_signature,                       "(C)C")                                     \
 378   template(short_short_signature,                     "(S)S")                                     \
 379   template(int_bool_signature,                        "(I)Z")                                     \
 380   template(float_int_signature,                       "(F)I")                                     \
 381   template(double_long_signature,                     "(D)J")                                     \
 382   template(double_double_signature,                   "(D)D")                                     \
 383   template(int_float_signature,                       "(I)F")                                     \
 384   template(long_int_signature,                        "(J)I")                                     \
 385   template(long_long_signature,                       "(J)J")                                     \
 386   template(long_double_signature,                     "(J)D")                                     \
 387   template(byte_signature,                            "B")                                        \
 388   template(char_signature,                            "C")                                        \
 389   template(double_signature,                          "D")                                        \
 390   template(float_signature,                           "F")                                        \
 391   template(int_signature,                             "I")                                        \
 392   template(long_signature,                            "J")                                        \
 393   template(short_signature,                           "S")                                        \
 394   template(bool_signature,                            "Z")                                        \
 395   template(void_signature,                            "V")                                        \
 396   template(byte_array_signature,                      "[B")                                       \
 397   template(char_array_signature,                      "[C")                                       \
 398   template(object_void_signature,                     "(Ljava/lang/Object;)V")                    \
 399   template(object_int_signature,                      "(Ljava/lang/Object;)I")                    \
 400   template(object_boolean_signature,                  "(Ljava/lang/Object;)Z")                    \
 401   template(string_void_signature,                     "(Ljava/lang/String;)V")                    \
 402   template(string_int_signature,                      "(Ljava/lang/String;)I")                    \
 403   template(throwable_void_signature,                  "(Ljava/lang/Throwable;)V")                 \
 404   template(void_throwable_signature,                  "()Ljava/lang/Throwable;")                  \
 405   template(throwable_throwable_signature,             "(Ljava/lang/Throwable;)Ljava/lang/Throwable;")             \
 406   template(class_void_signature,                      "(Ljava/lang/Class;)V")                     \
 407   template(class_int_signature,                       "(Ljava/lang/Class;)I")                     \
 408   template(class_boolean_signature,                   "(Ljava/lang/Class;)Z")                     \
 409   template(throwable_string_void_signature,           "(Ljava/lang/Throwable;Ljava/lang/String;)V")               \
 410   template(string_array_void_signature,               "([Ljava/lang/String;)V")                                   \
 411   template(string_array_string_array_void_signature,  "([Ljava/lang/String;[Ljava/lang/String;)V")                \
 412   template(thread_throwable_void_signature,           "(Ljava/lang/Thread;Ljava/lang/Throwable;)V")               \
 413   template(thread_void_signature,                     "(Ljava/lang/Thread;)V")                                    \
 414   template(threadgroup_runnable_void_signature,       "(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;)V")           \
 415   template(threadgroup_string_void_signature,         "(Ljava/lang/ThreadGroup;Ljava/lang/String;)V")             \
 416   template(string_class_signature,                    "(Ljava/lang/String;)Ljava/lang/Class;")                    \
 417   template(object_object_object_signature,            "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
 418   template(string_string_string_signature,            "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") \
 419   template(string_string_signature,                   "(Ljava/lang/String;)Ljava/lang/String;")                   \
 420   template(classloader_string_long_signature,         "(Ljava/lang/ClassLoader;Ljava/lang/String;)J")             \
 421   template(byte_array_void_signature,                 "([B)V")                                                    \
 422   template(char_array_void_signature,                 "([C)V")                                                    \
 423   template(int_int_void_signature,                    "(II)V")                                                    \
 424   template(long_long_void_signature,                  "(JJ)V")                                                    \
 425   template(void_classloader_signature,                "()Ljava/lang/ClassLoader;")                                \
 426   template(void_object_signature,                     "()Ljava/lang/Object;")                                     \
 427   template(void_class_signature,                      "()Ljava/lang/Class;")                                      \
 428   template(void_string_signature,                     "()Ljava/lang/String;")                                     \
 429   template(object_array_object_signature,             "([Ljava/lang/Object;)Ljava/lang/Object;")                  \
 430   template(object_object_array_object_signature,      "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\
 431   template(exception_void_signature,                  "(Ljava/lang/Exception;)V")                                 \
 432   template(protectiondomain_signature,                "[Ljava/security/ProtectionDomain;")                        \
 433   template(accesscontrolcontext_signature,            "Ljava/security/AccessControlContext;")                     \
 434   template(class_protectiondomain_signature,          "(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V")     \
 435   template(thread_signature,                          "Ljava/lang/Thread;")                                       \
 436   template(thread_array_signature,                    "[Ljava/lang/Thread;")                                      \
 437   template(threadgroup_signature,                     "Ljava/lang/ThreadGroup;")                                  \
 438   template(threadgroup_array_signature,               "[Ljava/lang/ThreadGroup;")                                 \
 439   template(class_array_signature,                     "[Ljava/lang/Class;")                                       \
 440   template(classloader_signature,                     "Ljava/lang/ClassLoader;")                                  \
 441   template(object_signature,                          "Ljava/lang/Object;")                                       \
 442   template(class_signature,                           "Ljava/lang/Class;")                                        \
 443   template(string_signature,                          "Ljava/lang/String;")                                       \
 444   template(reference_signature,                       "Ljava/lang/ref/Reference;")                                \
 445   template(concurrenthashmap_signature,               "Ljava/util/concurrent/ConcurrentHashMap;")                 \
 446   template(String_StringBuilder_signature,            "(Ljava/lang/String;)Ljava/lang/StringBuilder;")            \
 447   template(int_StringBuilder_signature,               "(I)Ljava/lang/StringBuilder;")                             \
 448   template(char_StringBuilder_signature,              "(C)Ljava/lang/StringBuilder;")                             \
 449   template(String_StringBuffer_signature,             "(Ljava/lang/String;)Ljava/lang/StringBuffer;")             \
 450   template(int_StringBuffer_signature,                "(I)Ljava/lang/StringBuffer;")                              \
 451   template(char_StringBuffer_signature,               "(C)Ljava/lang/StringBuffer;")                              \
 452   template(int_String_signature,                      "(I)Ljava/lang/String;")                                    \
 453   /* signature symbols needed by intrinsics */                                                                    \
 454   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE)            \
 455                                                                                                                   \
 456   /* symbol aliases needed by intrinsics */                                                                       \
 457   VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, do_alias)           \
 458                                                                                                                   \
 459   /* returned by the C1 compiler in case there's not enough memory to allocate a new symbol*/                     \
 460   template(dummy_symbol,                              "illegal symbol")                                           \
 461                                                                                                                   \
 462   /* used by ClassFormatError when class name is not known yet */                                                 \
 463   template(unknown_class_name,                        "<Unknown>")                                                \
 464                                                                                                                   \
 465   /* used to identify class loaders handling parallel class loading */                                            \
 466   template(parallelCapable_name,                      "parallelLockMap")                                          \
 467                                                                                                                   \
 468   /* JVM monitoring and management support */                                                                     \
 469   template(java_lang_StackTraceElement_array,          "[Ljava/lang/StackTraceElement;")                          \
 470   template(java_lang_management_ThreadState,           "java/lang/management/ThreadState")                        \
 471   template(java_lang_management_MemoryUsage,           "java/lang/management/MemoryUsage")                        \
 472   template(java_lang_management_ThreadInfo,            "java/lang/management/ThreadInfo")                         \
 473   template(sun_management_ManagementFactory,           "sun/management/ManagementFactory")                        \
 474   template(sun_management_Sensor,                      "sun/management/Sensor")                                   \
 475   template(sun_management_Agent,                       "sun/management/Agent")                                    \
 476   template(createMemoryPoolMBean_name,                 "createMemoryPoolMBean")                                   \
 477   template(createMemoryManagerMBean_name,              "createMemoryManagerMBean")                                \
 478   template(createGarbageCollectorMBean_name,           "createGarbageCollectorMBean")                             \
 479   template(createMemoryPoolMBean_signature,            "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMBean;") \
 480   template(createMemoryManagerMBean_signature,         "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMBean;") \
 481   template(createGarbageCollectorMBean_signature,      "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMBean;") \
 482   template(trigger_name,                               "trigger")                                                 \
 483   template(clear_name,                                 "clear")                                                   \
 484   template(trigger_method_signature,                   "(ILjava/lang/management/MemoryUsage;)V")                                                 \
 485   template(startAgent_name,                            "startAgent")                                              \
 486   template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \
 487   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") \
 488   template(long_long_long_long_void_signature,         "(JJJJ)V")                                                 \
 489                                                                                                                   \
 490   template(java_lang_management_MemoryPoolMXBean,      "java/lang/management/MemoryPoolMXBean")                   \
 491   template(java_lang_management_MemoryManagerMXBean,   "java/lang/management/MemoryManagerMXBean")                \
 492   template(java_lang_management_GarbageCollectorMXBean,"java/lang/management/GarbageCollectorMXBean")             \
 493   template(createMemoryPool_name,                      "createMemoryPool")                                        \
 494   template(createMemoryManager_name,                   "createMemoryManager")                                     \
 495   template(createGarbageCollector_name,                "createGarbageCollector")                                  \
 496   template(createMemoryPool_signature,                 "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMXBean;") \
 497   template(createMemoryManager_signature,              "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMXBean;") \
 498   template(createGarbageCollector_signature,           "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMXBean;") \
 499   template(addThreadDumpForMonitors_name,              "addThreadDumpForMonitors")                                \
 500   template(addThreadDumpForSynchronizers_name,         "addThreadDumpForSynchronizers")                           \
 501   template(addThreadDumpForMonitors_signature,         "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;[I)V") \
 502   template(addThreadDumpForSynchronizers_signature,    "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;)V")   \
 503                                                                                                                   \
 504   /* JVMTI/java.lang.instrument support and VM Attach mechanism */                                                \
 505   template(sun_misc_VMSupport,                         "sun/misc/VMSupport")                                      \
 506   template(appendToClassPathForInstrumentation_name,   "appendToClassPathForInstrumentation")                     \
 507   do_alias(appendToClassPathForInstrumentation_signature, string_void_signature)                                  \
 508   template(serializePropertiesToByteArray_name,        "serializePropertiesToByteArray")                          \
 509   template(serializePropertiesToByteArray_signature,   "()[B")                                                    \
 510   template(serializeAgentPropertiesToByteArray_name,   "serializeAgentPropertiesToByteArray")                     \
 511   template(classRedefinedCount_name,                   "classRedefinedCount")                                     \
 512   /*end*/
 513 
 514 
 515 
 516 // Here are all the intrinsics known to the runtime and the CI.
 517 // Each intrinsic consists of a public enum name (like _hashCode),
 518 // followed by a specification of its klass, name, and signature:
 519 //    template(<id>,  <klass>,  <name>, <sig>, <FCODE>)
 520 //
 521 // If you add an intrinsic here, you must also define its name
 522 // and signature as members of the VM symbols.  The VM symbols for
 523 // the intrinsic name and signature may be defined above.
 524 //
 525 // Because the VM_SYMBOLS_DO macro makes reference to VM_INTRINSICS_DO,
 526 // you can also define an intrinsic's name and/or signature locally to the
 527 // intrinsic, if this makes sense.  (It often does make sense.)
 528 //
 529 // For example:
 530 //    do_intrinsic(_foo,  java_lang_Object,  foo_name, foo_signature, F_xx)
 531 //     do_name(     foo_name, "foo")
 532 //     do_signature(foo_signature, "()F")
 533 // klass      = vmSymbols::java_lang_Object()
 534 // name       = vmSymbols::foo_name()
 535 // signature  = vmSymbols::foo_signature()
 536 //
 537 // The name and/or signature might be a "well known" symbol
 538 // like "equal" or "()I", in which case there will be no local
 539 // re-definition of the symbol.
 540 //
 541 // The do_class, do_name, and do_signature calls are all used for the
 542 // same purpose:  Define yet another VM symbol.  They could all be merged
 543 // into a common 'do_symbol' call, but it seems useful to record our
 544 // intentions here about kinds of symbols (class vs. name vs. signature).
 545 //
 546 // The F_xx is one of the Flags enum; see below.
 547 //
 548 // for Emacs: (let ((c-backslash-column 120) (c-backslash-max-column 120)) (c-backslash-region (point) (point-max) nil t))
 549 #define VM_INTRINSICS_DO(do_intrinsic, do_class, do_name, do_signature, do_alias)                                       \
 550   do_intrinsic(_hashCode,                 java_lang_Object,       hashCode_name, void_int_signature,             F_R)   \
 551    do_name(     hashCode_name,                                   "hashCode")                                            \
 552   do_intrinsic(_getClass,                 java_lang_Object,       getClass_name, void_class_signature,           F_R)   \
 553    do_name(     getClass_name,                                   "getClass")                                            \
 554   do_intrinsic(_clone,                    java_lang_Object,       clone_name, void_object_signature,             F_R)   \
 555    do_name(     clone_name,                                      "clone")                                               \
 556                                                                                                                         \
 557   /* Math & StrictMath intrinsics are defined in terms of just a few signatures: */                                     \
 558   do_class(java_lang_Math,                "java/lang/Math")                                                             \
 559   do_class(java_lang_StrictMath,          "java/lang/StrictMath")                                                       \
 560   do_signature(double2_double_signature,  "(DD)D")                                                                      \
 561   do_signature(int2_int_signature,        "(II)I")                                                                      \
 562                                                                                                                         \
 563   /* here are the math names, all together: */                                                                          \
 564   do_name(abs_name,"abs")       do_name(sin_name,"sin")         do_name(cos_name,"cos")                                 \
 565   do_name(tan_name,"tan")       do_name(atan2_name,"atan2")     do_name(sqrt_name,"sqrt")                               \
 566   do_name(log_name,"log")       do_name(log10_name,"log10")     do_name(pow_name,"pow")                                 \
 567   do_name(exp_name,"exp")       do_name(min_name,"min")         do_name(max_name,"max")                                 \
 568                                                                                                                         \
 569   do_intrinsic(_dabs,                     java_lang_Math,         abs_name,   double_double_signature,           F_S)   \
 570   do_intrinsic(_dsin,                     java_lang_Math,         sin_name,   double_double_signature,           F_S)   \
 571   do_intrinsic(_dcos,                     java_lang_Math,         cos_name,   double_double_signature,           F_S)   \
 572   do_intrinsic(_dtan,                     java_lang_Math,         tan_name,   double_double_signature,           F_S)   \
 573   do_intrinsic(_datan2,                   java_lang_Math,         atan2_name, double2_double_signature,          F_S)   \
 574   do_intrinsic(_dsqrt,                    java_lang_Math,         sqrt_name,  double_double_signature,           F_S)   \
 575   do_intrinsic(_dlog,                     java_lang_Math,         log_name,   double_double_signature,           F_S)   \
 576   do_intrinsic(_dlog10,                   java_lang_Math,         log10_name, double_double_signature,           F_S)   \
 577   do_intrinsic(_dpow,                     java_lang_Math,         pow_name,   double2_double_signature,          F_S)   \
 578   do_intrinsic(_dexp,                     java_lang_Math,         exp_name,   double_double_signature,           F_S)   \
 579   do_intrinsic(_min,                      java_lang_Math,         min_name,   int2_int_signature,                F_S)   \
 580   do_intrinsic(_max,                      java_lang_Math,         max_name,   int2_int_signature,                F_S)   \
 581                                                                                                                         \
 582   do_intrinsic(_floatToRawIntBits,        java_lang_Float,        floatToRawIntBits_name,   float_int_signature, F_S)   \
 583    do_name(     floatToRawIntBits_name,                          "floatToRawIntBits")                                   \
 584   do_intrinsic(_floatToIntBits,           java_lang_Float,        floatToIntBits_name,      float_int_signature, F_S)   \
 585    do_name(     floatToIntBits_name,                             "floatToIntBits")                                      \
 586   do_intrinsic(_intBitsToFloat,           java_lang_Float,        intBitsToFloat_name,      int_float_signature, F_S)   \
 587    do_name(     intBitsToFloat_name,                             "intBitsToFloat")                                      \
 588   do_intrinsic(_doubleToRawLongBits,      java_lang_Double,       doubleToRawLongBits_name, double_long_signature, F_S) \
 589    do_name(     doubleToRawLongBits_name,                        "doubleToRawLongBits")                                 \
 590   do_intrinsic(_doubleToLongBits,         java_lang_Double,       doubleToLongBits_name,    double_long_signature, F_S) \
 591    do_name(     doubleToLongBits_name,                           "doubleToLongBits")                                    \
 592   do_intrinsic(_longBitsToDouble,         java_lang_Double,       longBitsToDouble_name,    long_double_signature, F_S) \
 593    do_name(     longBitsToDouble_name,                           "longBitsToDouble")                                    \
 594                                                                                                                         \
 595   do_intrinsic(_numberOfLeadingZeros_i,   java_lang_Integer,      numberOfLeadingZeros_name,int_int_signature,   F_S)   \
 596   do_intrinsic(_numberOfLeadingZeros_l,   java_lang_Long,         numberOfLeadingZeros_name,long_int_signature,  F_S)   \
 597                                                                                                                         \
 598   do_intrinsic(_numberOfTrailingZeros_i,  java_lang_Integer,      numberOfTrailingZeros_name,int_int_signature,  F_S)   \
 599   do_intrinsic(_numberOfTrailingZeros_l,  java_lang_Long,         numberOfTrailingZeros_name,long_int_signature, F_S)   \
 600                                                                                                                         \
 601   do_intrinsic(_bitCount_i,               java_lang_Integer,      bitCount_name,            int_int_signature,   F_S)   \
 602   do_intrinsic(_bitCount_l,               java_lang_Long,         bitCount_name,            long_int_signature,  F_S)   \
 603                                                                                                                         \
 604   do_intrinsic(_reverseBytes_i,           java_lang_Integer,      reverseBytes_name,        int_int_signature,   F_S)   \
 605    do_name(     reverseBytes_name,                               "reverseBytes")                                        \
 606   do_intrinsic(_reverseBytes_l,           java_lang_Long,         reverseBytes_name,        long_long_signature, F_S)   \
 607     /*  (symbol reverseBytes_name defined above) */                                                                     \
 608   do_intrinsic(_reverseBytes_c,           java_lang_Character,    reverseBytes_name,        char_char_signature, F_S)   \
 609     /*  (symbol reverseBytes_name defined above) */                                                                     \
 610   do_intrinsic(_reverseBytes_s,           java_lang_Short,        reverseBytes_name,        short_short_signature, F_S) \
 611     /*  (symbol reverseBytes_name defined above) */                                                                     \
 612                                                                                                                         \
 613   do_intrinsic(_identityHashCode,         java_lang_System,       identityHashCode_name, object_int_signature,   F_S)   \
 614    do_name(     identityHashCode_name,                           "identityHashCode")                                    \
 615   do_intrinsic(_currentTimeMillis,        java_lang_System,       currentTimeMillis_name, void_long_signature,   F_S)   \
 616                                                                                                                         \
 617    do_name(     currentTimeMillis_name,                          "currentTimeMillis")                                   \
 618   do_intrinsic(_nanoTime,                 java_lang_System,       nanoTime_name,          void_long_signature,   F_S)   \
 619    do_name(     nanoTime_name,                                   "nanoTime")                                            \
 620                                                                                                                         \
 621   do_intrinsic(_arraycopy,                java_lang_System,       arraycopy_name, arraycopy_signature,           F_S)   \
 622    do_name(     arraycopy_name,                                  "arraycopy")                                           \
 623    do_signature(arraycopy_signature,                             "(Ljava/lang/Object;ILjava/lang/Object;II)V")          \
 624   do_intrinsic(_isInterrupted,            java_lang_Thread,       isInterrupted_name, isInterrupted_signature,   F_R)   \
 625    do_name(     isInterrupted_name,                              "isInterrupted")                                       \
 626    do_signature(isInterrupted_signature,                         "(Z)Z")                                                \
 627   do_intrinsic(_currentThread,            java_lang_Thread,       currentThread_name, currentThread_signature,   F_S)   \
 628    do_name(     currentThread_name,                              "currentThread")                                       \
 629    do_signature(currentThread_signature,                         "()Ljava/lang/Thread;")                                \
 630                                                                                                                         \
 631   /* reflective intrinsics, for java/lang/Class, etc. */                                                                \
 632   do_intrinsic(_isAssignableFrom,         java_lang_Class,        isAssignableFrom_name, class_boolean_signature, F_RN) \
 633    do_name(     isAssignableFrom_name,                           "isAssignableFrom")                                    \
 634   do_intrinsic(_isInstance,               java_lang_Class,        isInstance_name, object_boolean_signature,     F_RN)  \
 635    do_name(     isInstance_name,                                 "isInstance")                                          \
 636   do_intrinsic(_getModifiers,             java_lang_Class,        getModifiers_name, void_int_signature,         F_RN)  \
 637    do_name(     getModifiers_name,                               "getModifiers")                                        \
 638   do_intrinsic(_isInterface,              java_lang_Class,        isInterface_name, void_boolean_signature,      F_RN)  \
 639    do_name(     isInterface_name,                                "isInterface")                                         \
 640   do_intrinsic(_isArray,                  java_lang_Class,        isArray_name, void_boolean_signature,          F_RN)  \
 641    do_name(     isArray_name,                                    "isArray")                                             \
 642   do_intrinsic(_isPrimitive,              java_lang_Class,        isPrimitive_name, void_boolean_signature,      F_RN)  \
 643    do_name(     isPrimitive_name,                                "isPrimitive")                                         \
 644   do_intrinsic(_getSuperclass,            java_lang_Class,        getSuperclass_name, void_class_signature,      F_RN)  \
 645    do_name(     getSuperclass_name,                              "getSuperclass")                                       \
 646   do_intrinsic(_getComponentType,         java_lang_Class,        getComponentType_name, void_class_signature,   F_RN)  \
 647    do_name(     getComponentType_name,                           "getComponentType")                                    \
 648                                                                                                                         \
 649   do_intrinsic(_getClassAccessFlags,      sun_reflect_Reflection, getClassAccessFlags_name, class_int_signature, F_SN)  \
 650    do_name(     getClassAccessFlags_name,                        "getClassAccessFlags")                                 \
 651   do_intrinsic(_getLength,                java_lang_reflect_Array, getLength_name, object_int_signature,         F_SN)  \
 652    do_name(     getLength_name,                                   "getLength")                                          \
 653                                                                                                                         \
 654   do_intrinsic(_getCallerClass,           sun_reflect_Reflection, getCallerClass_name, getCallerClass_signature, F_SN)  \
 655    do_name(     getCallerClass_name,                             "getCallerClass")                                      \
 656    do_signature(getCallerClass_signature,                        "(I)Ljava/lang/Class;")                                \
 657                                                                                                                         \
 658   do_intrinsic(_newArray,                 java_lang_reflect_Array, newArray_name, newArray_signature,            F_SN)  \
 659    do_name(     newArray_name,                                    "newArray")                                           \
 660    do_signature(newArray_signature,                               "(Ljava/lang/Class;I)Ljava/lang/Object;")             \
 661                                                                                                                         \
 662   do_intrinsic(_copyOf,                   java_util_Arrays,       copyOf_name, copyOf_signature,                 F_S)   \
 663    do_name(     copyOf_name,                                     "copyOf")                                              \
 664    do_signature(copyOf_signature,             "([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;")             \
 665                                                                                                                         \
 666   do_intrinsic(_copyOfRange,              java_util_Arrays,       copyOfRange_name, copyOfRange_signature,       F_S)   \
 667    do_name(     copyOfRange_name,                                "copyOfRange")                                         \
 668    do_signature(copyOfRange_signature,        "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;")            \
 669                                                                                                                         \
 670   do_intrinsic(_equalsC,                  java_util_Arrays,       equals_name,    equalsC_signature,             F_S)   \
 671    do_signature(equalsC_signature,                               "([C[C)Z")                                             \
 672                                                                                                                         \
 673   do_intrinsic(_compareTo,                java_lang_String,       compareTo_name, string_int_signature,          F_R)   \
 674    do_name(     compareTo_name,                                  "compareTo")                                           \
 675   do_intrinsic(_indexOf,                  java_lang_String,       indexOf_name, string_int_signature,            F_R)   \
 676    do_name(     indexOf_name,                                    "indexOf")                                             \
 677   do_intrinsic(_equals,                   java_lang_String,       equals_name, object_boolean_signature,         F_R)   \
 678                                                                                                                         \
 679   do_class(java_nio_Buffer,               "java/nio/Buffer")                                                            \
 680   do_intrinsic(_checkIndex,               java_nio_Buffer,        checkIndex_name, int_int_signature,            F_R)   \
 681    do_name(     checkIndex_name,                                 "checkIndex")                                          \
 682                                                                                                                         \
 683   do_class(sun_misc_AtomicLongCSImpl,     "sun/misc/AtomicLongCSImpl")                                                  \
 684   do_intrinsic(_get_AtomicLong,           sun_misc_AtomicLongCSImpl, get_name, void_long_signature,              F_R)   \
 685   /*   (symbols get_name and void_long_signature defined above) */                                                      \
 686                                                                                                                         \
 687   do_intrinsic(_attemptUpdate,            sun_misc_AtomicLongCSImpl, attemptUpdate_name, attemptUpdate_signature, F_R)  \
 688    do_name(     attemptUpdate_name,                                 "attemptUpdate")                                    \
 689    do_signature(attemptUpdate_signature,                            "(JJ)Z")                                            \
 690                                                                                                                         \
 691   /* support for sun.misc.Unsafe */                                                                                     \
 692   do_class(sun_misc_Unsafe,               "sun/misc/Unsafe")                                                            \
 693                                                                                                                         \
 694   do_intrinsic(_allocateInstance,         sun_misc_Unsafe,        allocateInstance_name, allocateInstance_signature, F_RN) \
 695    do_name(     allocateInstance_name,                           "allocateInstance")                                    \
 696    do_signature(allocateInstance_signature,   "(Ljava/lang/Class;)Ljava/lang/Object;")                                  \
 697   do_intrinsic(_copyMemory,               sun_misc_Unsafe,        copyMemory_name, copyMemory_signature,         F_RN)  \
 698    do_name(     copyMemory_name,                                 "copyMemory")                                          \
 699    do_signature(copyMemory_signature,         "(Ljava/lang/Object;JLjava/lang/Object;JJ)V")                             \
 700   do_intrinsic(_park,                     sun_misc_Unsafe,        park_name, park_signature,                     F_RN)  \
 701    do_name(     park_name,                                       "park")                                                \
 702    do_signature(park_signature,                                  "(ZJ)V")                                               \
 703   do_intrinsic(_unpark,                   sun_misc_Unsafe,        unpark_name, unpark_signature,                 F_RN)  \
 704    do_name(     unpark_name,                                     "unpark")                                              \
 705    do_alias(    unpark_signature,                               /*(LObject;)V*/ object_void_signature)                  \
 706                                                                                                                         \
 707   /* unsafe memory references (there are a lot of them...) */                                                           \
 708   do_signature(getObject_signature,       "(Ljava/lang/Object;J)Ljava/lang/Object;")                                    \
 709   do_signature(putObject_signature,       "(Ljava/lang/Object;JLjava/lang/Object;)V")                                   \
 710   do_signature(getBoolean_signature,      "(Ljava/lang/Object;J)Z")                                                     \
 711   do_signature(putBoolean_signature,      "(Ljava/lang/Object;JZ)V")                                                    \
 712   do_signature(getByte_signature,         "(Ljava/lang/Object;J)B")                                                     \
 713   do_signature(putByte_signature,         "(Ljava/lang/Object;JB)V")                                                    \
 714   do_signature(getShort_signature,        "(Ljava/lang/Object;J)S")                                                     \
 715   do_signature(putShort_signature,        "(Ljava/lang/Object;JS)V")                                                    \
 716   do_signature(getChar_signature,         "(Ljava/lang/Object;J)C")                                                     \
 717   do_signature(putChar_signature,         "(Ljava/lang/Object;JC)V")                                                    \
 718   do_signature(getInt_signature,          "(Ljava/lang/Object;J)I")                                                     \
 719   do_signature(putInt_signature,          "(Ljava/lang/Object;JI)V")                                                    \
 720   do_signature(getLong_signature,         "(Ljava/lang/Object;J)J")                                                     \
 721   do_signature(putLong_signature,         "(Ljava/lang/Object;JJ)V")                                                    \
 722   do_signature(getFloat_signature,        "(Ljava/lang/Object;J)F")                                                     \
 723   do_signature(putFloat_signature,        "(Ljava/lang/Object;JF)V")                                                    \
 724   do_signature(getDouble_signature,       "(Ljava/lang/Object;J)D")                                                     \
 725   do_signature(putDouble_signature,       "(Ljava/lang/Object;JD)V")                                                    \
 726                                                                                                                         \
 727   do_name(getObject_name,"getObject")           do_name(putObject_name,"putObject")                                     \
 728   do_name(getBoolean_name,"getBoolean")         do_name(putBoolean_name,"putBoolean")                                   \
 729   do_name(getByte_name,"getByte")               do_name(putByte_name,"putByte")                                         \
 730   do_name(getShort_name,"getShort")             do_name(putShort_name,"putShort")                                       \
 731   do_name(getChar_name,"getChar")               do_name(putChar_name,"putChar")                                         \
 732   do_name(getInt_name,"getInt")                 do_name(putInt_name,"putInt")                                           \
 733   do_name(getLong_name,"getLong")               do_name(putLong_name,"putLong")                                         \
 734   do_name(getFloat_name,"getFloat")             do_name(putFloat_name,"putFloat")                                       \
 735   do_name(getDouble_name,"getDouble")           do_name(putDouble_name,"putDouble")                                     \
 736                                                                                                                         \
 737   do_intrinsic(_getObject,                sun_misc_Unsafe,        getObject_name, getObject_signature,           F_RN)  \
 738   do_intrinsic(_getBoolean,               sun_misc_Unsafe,        getBoolean_name, getBoolean_signature,         F_RN)  \
 739   do_intrinsic(_getByte,                  sun_misc_Unsafe,        getByte_name, getByte_signature,               F_RN)  \
 740   do_intrinsic(_getShort,                 sun_misc_Unsafe,        getShort_name, getShort_signature,             F_RN)  \
 741   do_intrinsic(_getChar,                  sun_misc_Unsafe,        getChar_name, getChar_signature,               F_RN)  \
 742   do_intrinsic(_getInt,                   sun_misc_Unsafe,        getInt_name, getInt_signature,                 F_RN)  \
 743   do_intrinsic(_getLong,                  sun_misc_Unsafe,        getLong_name, getLong_signature,               F_RN)  \
 744   do_intrinsic(_getFloat,                 sun_misc_Unsafe,        getFloat_name, getFloat_signature,             F_RN)  \
 745   do_intrinsic(_getDouble,                sun_misc_Unsafe,        getDouble_name, getDouble_signature,           F_RN)  \
 746   do_intrinsic(_putObject,                sun_misc_Unsafe,        putObject_name, putObject_signature,           F_RN)  \
 747   do_intrinsic(_putBoolean,               sun_misc_Unsafe,        putBoolean_name, putBoolean_signature,         F_RN)  \
 748   do_intrinsic(_putByte,                  sun_misc_Unsafe,        putByte_name, putByte_signature,               F_RN)  \
 749   do_intrinsic(_putShort,                 sun_misc_Unsafe,        putShort_name, putShort_signature,             F_RN)  \
 750   do_intrinsic(_putChar,                  sun_misc_Unsafe,        putChar_name, putChar_signature,               F_RN)  \
 751   do_intrinsic(_putInt,                   sun_misc_Unsafe,        putInt_name, putInt_signature,                 F_RN)  \
 752   do_intrinsic(_putLong,                  sun_misc_Unsafe,        putLong_name, putLong_signature,               F_RN)  \
 753   do_intrinsic(_putFloat,                 sun_misc_Unsafe,        putFloat_name, putFloat_signature,             F_RN)  \
 754   do_intrinsic(_putDouble,                sun_misc_Unsafe,        putDouble_name, putDouble_signature,           F_RN)  \
 755                                                                                                                         \
 756   do_name(getObjectVolatile_name,"getObjectVolatile")   do_name(putObjectVolatile_name,"putObjectVolatile")             \
 757   do_name(getBooleanVolatile_name,"getBooleanVolatile") do_name(putBooleanVolatile_name,"putBooleanVolatile")           \
 758   do_name(getByteVolatile_name,"getByteVolatile")       do_name(putByteVolatile_name,"putByteVolatile")                 \
 759   do_name(getShortVolatile_name,"getShortVolatile")     do_name(putShortVolatile_name,"putShortVolatile")               \
 760   do_name(getCharVolatile_name,"getCharVolatile")       do_name(putCharVolatile_name,"putCharVolatile")                 \
 761   do_name(getIntVolatile_name,"getIntVolatile")         do_name(putIntVolatile_name,"putIntVolatile")                   \
 762   do_name(getLongVolatile_name,"getLongVolatile")       do_name(putLongVolatile_name,"putLongVolatile")                 \
 763   do_name(getFloatVolatile_name,"getFloatVolatile")     do_name(putFloatVolatile_name,"putFloatVolatile")               \
 764   do_name(getDoubleVolatile_name,"getDoubleVolatile")   do_name(putDoubleVolatile_name,"putDoubleVolatile")             \
 765                                                                                                                         \
 766   do_intrinsic(_getObjectVolatile,        sun_misc_Unsafe,        getObjectVolatile_name, getObject_signature,   F_RN)  \
 767   do_intrinsic(_getBooleanVolatile,       sun_misc_Unsafe,        getBooleanVolatile_name, getBoolean_signature, F_RN)  \
 768   do_intrinsic(_getByteVolatile,          sun_misc_Unsafe,        getByteVolatile_name, getByte_signature,       F_RN)  \
 769   do_intrinsic(_getShortVolatile,         sun_misc_Unsafe,        getShortVolatile_name, getShort_signature,     F_RN)  \
 770   do_intrinsic(_getCharVolatile,          sun_misc_Unsafe,        getCharVolatile_name, getChar_signature,       F_RN)  \
 771   do_intrinsic(_getIntVolatile,           sun_misc_Unsafe,        getIntVolatile_name, getInt_signature,         F_RN)  \
 772   do_intrinsic(_getLongVolatile,          sun_misc_Unsafe,        getLongVolatile_name, getLong_signature,       F_RN)  \
 773   do_intrinsic(_getFloatVolatile,         sun_misc_Unsafe,        getFloatVolatile_name, getFloat_signature,     F_RN)  \
 774   do_intrinsic(_getDoubleVolatile,        sun_misc_Unsafe,        getDoubleVolatile_name, getDouble_signature,   F_RN)  \
 775   do_intrinsic(_putObjectVolatile,        sun_misc_Unsafe,        putObjectVolatile_name, putObject_signature,   F_RN)  \
 776   do_intrinsic(_putBooleanVolatile,       sun_misc_Unsafe,        putBooleanVolatile_name, putBoolean_signature, F_RN)  \
 777   do_intrinsic(_putByteVolatile,          sun_misc_Unsafe,        putByteVolatile_name, putByte_signature,       F_RN)  \
 778   do_intrinsic(_putShortVolatile,         sun_misc_Unsafe,        putShortVolatile_name, putShort_signature,     F_RN)  \
 779   do_intrinsic(_putCharVolatile,          sun_misc_Unsafe,        putCharVolatile_name, putChar_signature,       F_RN)  \
 780   do_intrinsic(_putIntVolatile,           sun_misc_Unsafe,        putIntVolatile_name, putInt_signature,         F_RN)  \
 781   do_intrinsic(_putLongVolatile,          sun_misc_Unsafe,        putLongVolatile_name, putLong_signature,       F_RN)  \
 782   do_intrinsic(_putFloatVolatile,         sun_misc_Unsafe,        putFloatVolatile_name, putFloat_signature,     F_RN)  \
 783   do_intrinsic(_putDoubleVolatile,        sun_misc_Unsafe,        putDoubleVolatile_name, putDouble_signature,   F_RN)  \
 784                                                                                                                         \
 785   /* %%% these are redundant except perhaps for getAddress, but Unsafe has native methods for them */                   \
 786   do_signature(getByte_raw_signature,     "(J)B")                                                                       \
 787   do_signature(putByte_raw_signature,     "(JB)V")                                                                      \
 788   do_signature(getShort_raw_signature,    "(J)S")                                                                       \
 789   do_signature(putShort_raw_signature,    "(JS)V")                                                                      \
 790   do_signature(getChar_raw_signature,     "(J)C")                                                                       \
 791   do_signature(putChar_raw_signature,     "(JC)V")                                                                      \
 792   do_signature(putInt_raw_signature,      "(JI)V")                                                                      \
 793       do_alias(getLong_raw_signature,    /*(J)J*/ long_long_signature)                                                  \
 794       do_alias(putLong_raw_signature,    /*(JJ)V*/ long_long_void_signature)                                            \
 795   do_signature(getFloat_raw_signature,    "(J)F")                                                                       \
 796   do_signature(putFloat_raw_signature,    "(JF)V")                                                                      \
 797       do_alias(getDouble_raw_signature,  /*(J)D*/ long_double_signature)                                                \
 798   do_signature(putDouble_raw_signature,   "(JD)V")                                                                      \
 799       do_alias(getAddress_raw_signature, /*(J)J*/ long_long_signature)                                                  \
 800       do_alias(putAddress_raw_signature, /*(JJ)V*/ long_long_void_signature)                                            \
 801                                                                                                                         \
 802    do_name(    getAddress_name,           "getAddress")                                                                 \
 803    do_name(    putAddress_name,           "putAddress")                                                                 \
 804                                                                                                                         \
 805   do_intrinsic(_getByte_raw,              sun_misc_Unsafe,        getByte_name, getByte_raw_signature,           F_RN)  \
 806   do_intrinsic(_getShort_raw,             sun_misc_Unsafe,        getShort_name, getShort_raw_signature,         F_RN)  \
 807   do_intrinsic(_getChar_raw,              sun_misc_Unsafe,        getChar_name, getChar_raw_signature,           F_RN)  \
 808   do_intrinsic(_getInt_raw,               sun_misc_Unsafe,        getInt_name, long_int_signature,               F_RN)  \
 809   do_intrinsic(_getLong_raw,              sun_misc_Unsafe,        getLong_name, getLong_raw_signature,           F_RN)  \
 810   do_intrinsic(_getFloat_raw,             sun_misc_Unsafe,        getFloat_name, getFloat_raw_signature,         F_RN)  \
 811   do_intrinsic(_getDouble_raw,            sun_misc_Unsafe,        getDouble_name, getDouble_raw_signature,       F_RN)  \
 812   do_intrinsic(_getAddress_raw,           sun_misc_Unsafe,        getAddress_name, getAddress_raw_signature,     F_RN)  \
 813   do_intrinsic(_putByte_raw,              sun_misc_Unsafe,        putByte_name, putByte_raw_signature,           F_RN)  \
 814   do_intrinsic(_putShort_raw,             sun_misc_Unsafe,        putShort_name, putShort_raw_signature,         F_RN)  \
 815   do_intrinsic(_putChar_raw,              sun_misc_Unsafe,        putChar_name, putChar_raw_signature,           F_RN)  \
 816   do_intrinsic(_putInt_raw,               sun_misc_Unsafe,        putInt_name, putInt_raw_signature,             F_RN)  \
 817   do_intrinsic(_putLong_raw,              sun_misc_Unsafe,        putLong_name, putLong_raw_signature,           F_RN)  \
 818   do_intrinsic(_putFloat_raw,             sun_misc_Unsafe,        putFloat_name, putFloat_raw_signature,         F_RN)  \
 819   do_intrinsic(_putDouble_raw,            sun_misc_Unsafe,        putDouble_name, putDouble_raw_signature,       F_RN)  \
 820   do_intrinsic(_putAddress_raw,           sun_misc_Unsafe,        putAddress_name, putAddress_raw_signature,     F_RN)  \
 821                                                                                                                         \
 822   do_intrinsic(_compareAndSwapObject,     sun_misc_Unsafe,        compareAndSwapObject_name, compareAndSwapObject_signature, F_RN) \
 823    do_name(     compareAndSwapObject_name,                       "compareAndSwapObject")                                \
 824    do_signature(compareAndSwapObject_signature,  "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z")          \
 825   do_intrinsic(_compareAndSwapLong,       sun_misc_Unsafe,        compareAndSwapLong_name, compareAndSwapLong_signature, F_RN) \
 826    do_name(     compareAndSwapLong_name,                         "compareAndSwapLong")                                  \
 827    do_signature(compareAndSwapLong_signature,                    "(Ljava/lang/Object;JJJ)Z")                            \
 828   do_intrinsic(_compareAndSwapInt,        sun_misc_Unsafe,        compareAndSwapInt_name, compareAndSwapInt_signature, F_RN) \
 829    do_name(     compareAndSwapInt_name,                          "compareAndSwapInt")                                   \
 830    do_signature(compareAndSwapInt_signature,                     "(Ljava/lang/Object;JII)Z")                            \
 831   do_intrinsic(_putOrderedObject,         sun_misc_Unsafe,        putOrderedObject_name, putOrderedObject_signature, F_RN) \
 832    do_name(     putOrderedObject_name,                           "putOrderedObject")                                    \
 833    do_alias(    putOrderedObject_signature,                     /*(LObject;JLObject;)V*/ putObject_signature)           \
 834   do_intrinsic(_putOrderedLong,           sun_misc_Unsafe,        putOrderedLong_name, putOrderedLong_signature, F_RN)  \
 835    do_name(     putOrderedLong_name,                             "putOrderedLong")                                      \
 836    do_alias(    putOrderedLong_signature,                       /*(Ljava/lang/Object;JJ)V*/ putLong_signature)          \
 837   do_intrinsic(_putOrderedInt,            sun_misc_Unsafe,        putOrderedInt_name, putOrderedInt_signature,   F_RN)  \
 838    do_name(     putOrderedInt_name,                              "putOrderedInt")                                       \
 839    do_alias(    putOrderedInt_signature,                        /*(Ljava/lang/Object;JI)V*/ putInt_signature)           \
 840                                                                                                                         \
 841   /* prefetch_signature is shared by all prefetch variants */                                                           \
 842   do_signature( prefetch_signature,        "(Ljava/lang/Object;J)V")                                                    \
 843                                                                                                                         \
 844   do_intrinsic(_prefetchRead,             sun_misc_Unsafe,        prefetchRead_name, prefetch_signature,         F_RN)  \
 845    do_name(     prefetchRead_name,                               "prefetchRead")                                        \
 846   do_intrinsic(_prefetchWrite,            sun_misc_Unsafe,        prefetchWrite_name, prefetch_signature,        F_RN)  \
 847    do_name(     prefetchWrite_name,                              "prefetchWrite")                                       \
 848   do_intrinsic(_prefetchReadStatic,       sun_misc_Unsafe,        prefetchReadStatic_name, prefetch_signature,   F_SN)  \
 849    do_name(     prefetchReadStatic_name,                         "prefetchReadStatic")                                  \
 850   do_intrinsic(_prefetchWriteStatic,      sun_misc_Unsafe,        prefetchWriteStatic_name, prefetch_signature,  F_SN)  \
 851    do_name(     prefetchWriteStatic_name,                        "prefetchWriteStatic")                                 \
 852     /*== LAST_COMPILER_INLINE*/                                                                                         \
 853     /*the compiler does have special inlining code for these; bytecode inline is just fine */                           \
 854                                                                                                                         \
 855   do_intrinsic(_fillInStackTrace,         java_lang_Throwable, fillInStackTrace_name, void_throwable_signature,  F_RNY) \
 856                                                                                                                           \
 857   do_intrinsic(_StringBuilder_void,   java_lang_StringBuilder, object_initializer_name, void_method_signature,     F_R)   \
 858   do_intrinsic(_StringBuilder_int,    java_lang_StringBuilder, object_initializer_name, int_void_signature,        F_R)   \
 859   do_intrinsic(_StringBuilder_String, java_lang_StringBuilder, object_initializer_name, string_void_signature,     F_R)   \
 860                                                                                                                           \
 861   do_intrinsic(_StringBuilder_append_char,   java_lang_StringBuilder, append_name, char_StringBuilder_signature,   F_R)   \
 862   do_intrinsic(_StringBuilder_append_int,    java_lang_StringBuilder, append_name, int_StringBuilder_signature,    F_R)   \
 863   do_intrinsic(_StringBuilder_append_String, java_lang_StringBuilder, append_name, String_StringBuilder_signature, F_R)   \
 864                                                                                                                           \
 865   do_intrinsic(_StringBuilder_toString, java_lang_StringBuilder, toString_name, void_string_signature,             F_R)   \
 866                                                                                                                           \
 867   do_intrinsic(_StringBuffer_void,   java_lang_StringBuffer, object_initializer_name, void_method_signature,       F_R)   \
 868   do_intrinsic(_StringBuffer_int,    java_lang_StringBuffer, object_initializer_name, int_void_signature,          F_R)   \
 869   do_intrinsic(_StringBuffer_String, java_lang_StringBuffer, object_initializer_name, string_void_signature,       F_R)   \
 870                                                                                                                           \
 871   do_intrinsic(_StringBuffer_append_char,   java_lang_StringBuffer, append_name, char_StringBuffer_signature,      F_Y)   \
 872   do_intrinsic(_StringBuffer_append_int,    java_lang_StringBuffer, append_name, int_StringBuffer_signature,       F_Y)   \
 873   do_intrinsic(_StringBuffer_append_String, java_lang_StringBuffer, append_name, String_StringBuffer_signature,    F_Y)   \
 874                                                                                                                           \
 875   do_intrinsic(_StringBuffer_toString,  java_lang_StringBuffer, toString_name, void_string_signature,              F_Y)   \
 876                                                                                                                           \
 877   do_intrinsic(_Integer_toString,      java_lang_Integer, toString_name, int_String_signature,                     F_S)   \
 878                                                                                                                           \
 879   do_intrinsic(_String_String, java_lang_String, object_initializer_name, string_void_signature,                   F_R)   \
 880                                                                                                                           \
 881   do_intrinsic(_Object_init,              java_lang_Object, object_initializer_name, void_method_signature,        F_R)   \
 882   /*    (symbol object_initializer_name defined above) */                                                                 \
 883                                                                                                                           \
 884   do_intrinsic(_invoke,                   java_lang_reflect_Method, invoke_name, object_object_array_object_signature, F_R) \
 885   /*   (symbols invoke_name and invoke_signature defined above) */                                                      \
 886   do_intrinsic(_checkSpreadArgument,      sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \
 887    do_name(    checkSpreadArgument_name,       "checkSpreadArgument")                                                   \
 888    do_name(    checkSpreadArgument_signature,  "(Ljava/lang/Object;I)V")                                                \
 889   do_intrinsic(_invokeExact,              java_dyn_MethodHandle, invokeExact_name,   object_array_object_signature, F_RN) \
 890   do_intrinsic(_invokeGeneric,            java_dyn_MethodHandle, invokeGeneric_name, object_array_object_signature, F_RN) \
 891   do_intrinsic(_invokeVarargs,            java_dyn_MethodHandle, invokeVarargs_name, object_array_object_signature, F_R)  \
 892   do_intrinsic(_invokeDynamic,            java_dyn_InvokeDynamic, star_name,         object_array_object_signature, F_SN) \
 893                                                                                                                         \
 894   /* unboxing methods: */                                                                                               \
 895   do_intrinsic(_booleanValue,             java_lang_Boolean,      booleanValue_name, void_boolean_signature, F_R)       \
 896    do_name(     booleanValue_name,       "booleanValue")                                                                \
 897   do_intrinsic(_byteValue,                java_lang_Byte,         byteValue_name, void_byte_signature, F_R)             \
 898    do_name(     byteValue_name,          "byteValue")                                                                   \
 899   do_intrinsic(_charValue,                java_lang_Character,    charValue_name, void_char_signature, F_R)             \
 900    do_name(     charValue_name,          "charValue")                                                                   \
 901   do_intrinsic(_shortValue,               java_lang_Short,        shortValue_name, void_short_signature, F_R)           \
 902    do_name(     shortValue_name,         "shortValue")                                                                  \
 903   do_intrinsic(_intValue,                 java_lang_Integer,      intValue_name, void_int_signature, F_R)               \
 904    do_name(     intValue_name,           "intValue")                                                                    \
 905   do_intrinsic(_longValue,                java_lang_Long,         longValue_name, void_long_signature, F_R)             \
 906    do_name(     longValue_name,          "longValue")                                                                   \
 907   do_intrinsic(_floatValue,               java_lang_Float,        floatValue_name, void_float_signature, F_R)           \
 908    do_name(     floatValue_name,         "floatValue")                                                                  \
 909   do_intrinsic(_doubleValue,              java_lang_Double,       doubleValue_name, void_double_signature, F_R)         \
 910    do_name(     doubleValue_name,        "doubleValue")                                                                 \
 911                                                                                                                         \
 912   /* boxing methods: */                                                                                                 \
 913    do_name(    valueOf_name,              "valueOf")                                                                    \
 914   do_intrinsic(_Boolean_valueOf,          java_lang_Boolean,      valueOf_name, Boolean_valueOf_signature, F_S)         \
 915    do_name(     Boolean_valueOf_signature,                       "(Z)Ljava/lang/Boolean;")                              \
 916   do_intrinsic(_Byte_valueOf,             java_lang_Byte,         valueOf_name, Byte_valueOf_signature, F_S)            \
 917    do_name(     Byte_valueOf_signature,                          "(B)Ljava/lang/Byte;")                                 \
 918   do_intrinsic(_Character_valueOf,        java_lang_Character,    valueOf_name, Character_valueOf_signature, F_S)       \
 919    do_name(     Character_valueOf_signature,                     "(C)Ljava/lang/Character;")                            \
 920   do_intrinsic(_Short_valueOf,            java_lang_Short,        valueOf_name, Short_valueOf_signature, F_S)           \
 921    do_name(     Short_valueOf_signature,                         "(S)Ljava/lang/Short;")                                \
 922   do_intrinsic(_Integer_valueOf,          java_lang_Integer,      valueOf_name, Integer_valueOf_signature, F_S)         \
 923    do_name(     Integer_valueOf_signature,                       "(I)Ljava/lang/Integer;")                              \
 924   do_intrinsic(_Long_valueOf,             java_lang_Long,         valueOf_name, Long_valueOf_signature, F_S)            \
 925    do_name(     Long_valueOf_signature,                          "(J)Ljava/lang/Long;")                                 \
 926   do_intrinsic(_Float_valueOf,            java_lang_Float,        valueOf_name, Float_valueOf_signature, F_S)           \
 927    do_name(     Float_valueOf_signature,                         "(F)Ljava/lang/Float;")                                \
 928   do_intrinsic(_Double_valueOf,           java_lang_Double,       valueOf_name, Double_valueOf_signature, F_S)          \
 929    do_name(     Double_valueOf_signature,                        "(D)Ljava/lang/Double;")                               \
 930                                                                                                                         \
 931     /*end*/
 932 
 933 
 934 
 935 
 936 // Class vmSymbols
 937 
 938 class vmSymbols: AllStatic {
 939  friend class vmIntrinsics;
 940  public:
 941   // enum for figuring positions and size of array holding Symbol*s
 942   enum SID {
 943     NO_SID = 0,
 944 
 945     #define VM_SYMBOL_ENUM(name, string) VM_SYMBOL_ENUM_NAME(name),
 946     VM_SYMBOLS_DO(VM_SYMBOL_ENUM, VM_ALIAS_IGNORE)
 947     #undef VM_SYMBOL_ENUM
 948 
 949     SID_LIMIT,
 950 
 951     #define VM_ALIAS_ENUM(name, def) VM_SYMBOL_ENUM_NAME(name) = VM_SYMBOL_ENUM_NAME(def),
 952     VM_SYMBOLS_DO(VM_SYMBOL_IGNORE, VM_ALIAS_ENUM)
 953     #undef VM_ALIAS_ENUM
 954 
 955     FIRST_SID = NO_SID + 1
 956   };
 957   enum {
 958     log2_SID_LIMIT = 10         // checked by an assert at start-up
 959   };
 960 
 961  private:
 962   // The symbol array
 963   static Symbol* _symbols[];
 964 
 965   // Field signatures indexed by BasicType.
 966   static Symbol* _type_signatures[T_VOID+1];
 967 
 968  public:
 969   // Initialization
 970   static void initialize(TRAPS);
 971   // Accessing
 972   #define VM_SYMBOL_DECLARE(name, ignore)                 \
 973     static Symbol* name() {                               \
 974       return _symbols[VM_SYMBOL_ENUM_NAME(name)];         \
 975     }
 976   VM_SYMBOLS_DO(VM_SYMBOL_DECLARE, VM_SYMBOL_DECLARE)
 977   #undef VM_SYMBOL_DECLARE
 978 
 979   // Sharing support
 980   static void symbols_do(SymbolClosure* f);
 981   static void serialize(SerializeOopClosure* soc);
 982 
 983   static Symbol* type_signature(BasicType t) {
 984     assert((uint)t < T_VOID+1, "range check");
 985     assert(_type_signatures[t] != NULL, "domain check");
 986     return _type_signatures[t];
 987   }
 988   // inverse of type_signature; returns T_OBJECT if s is not recognized
 989   static BasicType signature_type(Symbol* s);
 990 
 991   static Symbol* symbol_at(SID id) {
 992     assert(id >= FIRST_SID && id < SID_LIMIT, "oob");
 993     assert(_symbols[id] != NULL, "init");
 994     return _symbols[id];
 995   }
 996 
 997   // Returns symbol's SID if one is assigned, else NO_SID.
 998   static SID find_sid(Symbol* symbol);
 999 
1000 #ifndef PRODUCT
1001   // No need for this in the product:
1002   static const char* name_for(SID sid);
1003 #endif //PRODUCT
1004 };
1005 
1006 // VM Intrinsic ID's uniquely identify some very special methods
1007 class vmIntrinsics: AllStatic {
1008   friend class vmSymbols;
1009   friend class ciObjectFactory;
1010 
1011  public:
1012   // Accessing
1013   enum ID {
1014     _none = 0,                      // not an intrinsic (default answer)
1015 
1016     #define VM_INTRINSIC_ENUM(id, klass, name, sig, flags)  id,
1017     VM_INTRINSICS_DO(VM_INTRINSIC_ENUM,
1018                      VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE)
1019     #undef VM_INTRINSIC_ENUM
1020 
1021     ID_LIMIT,
1022     LAST_COMPILER_INLINE = _prefetchWriteStatic,
1023     FIRST_ID = _none + 1
1024   };
1025 
1026   enum Flags {
1027     // AccessFlags syndromes relevant to intrinsics.
1028     F_none = 0,
1029     F_R,                        // !static ?native !synchronized (R="regular")
1030     F_S,                        //  static ?native !synchronized
1031     F_Y,                        // !static ?native  synchronized
1032     F_RN,                       // !static  native !synchronized
1033     F_SN,                       //  static  native !synchronized
1034     F_RNY,                      // !static  native  synchronized
1035 
1036     FLAG_LIMIT
1037   };
1038   enum {
1039     log2_FLAG_LIMIT = 4         // checked by an assert at start-up
1040   };
1041 
1042 public:
1043   static ID ID_from(int raw_id) {
1044     assert(raw_id >= (int)_none && raw_id < (int)ID_LIMIT,
1045            "must be a valid intrinsic ID");
1046     return (ID)raw_id;
1047   }
1048 
1049   static const char* name_at(ID id);
1050 
1051 private:
1052   static ID find_id_impl(vmSymbols::SID holder,
1053                          vmSymbols::SID name,
1054                          vmSymbols::SID sig,
1055                          jshort flags);
1056 
1057 public:
1058   // Given a method's class, name, signature, and access flags, report its ID.
1059   static ID find_id(vmSymbols::SID holder,
1060                     vmSymbols::SID name,
1061                     vmSymbols::SID sig,
1062                     jshort flags) {
1063     ID id = find_id_impl(holder, name, sig, flags);
1064 #ifdef ASSERT
1065     // ID _none does not hold the following asserts.
1066     if (id == _none)  return id;
1067 #endif
1068     assert(    class_for(id) == holder, "correct id");
1069     assert(     name_for(id) == name,   "correct id");
1070     assert(signature_for(id) == sig,    "correct id");
1071     return id;
1072   }
1073 
1074   static void verify_method(ID actual_id, methodOop m) PRODUCT_RETURN;
1075 
1076   // Find out the symbols behind an intrinsic:
1077   static vmSymbols::SID     class_for(ID id);
1078   static vmSymbols::SID      name_for(ID id);
1079   static vmSymbols::SID signature_for(ID id);
1080   static Flags              flags_for(ID id);
1081 
1082   static const char* short_name_as_C_string(ID id, char* buf, int size);
1083 
1084   // Access to intrinsic methods:
1085   static methodOop method_for(ID id);
1086 
1087   // Wrapper object methods:
1088   static ID for_boxing(BasicType type);
1089   static ID for_unboxing(BasicType type);
1090 
1091   // Raw conversion:
1092   static ID for_raw_conversion(BasicType src, BasicType dest);
1093 };
1094 
1095 #endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP