annotate src/share/vm/classfile/vmSymbols.hpp @ 747:93c14e5562c4

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