src/share/vm/classfile/vmSymbols.hpp

Mon, 09 Mar 2009 13:28:46 -0700

author
xdono
date
Mon, 09 Mar 2009 13:28:46 -0700
changeset 1014
0fbdb4381b99
parent 949
c81d2ef51ca3
child 1082
bd441136a5ce
child 1088
e55bcaf3a6a1
permissions
-rw-r--r--

6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair

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

mercurial