1 /* 2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_CLASSFILE_VMSYMBOLS_HPP 26 #define SHARE_VM_CLASSFILE_VMSYMBOLS_HPP 27 28 #include "classfile/vmSymbols_ext.hpp" 29 #include "oops/symbol.hpp" 30 #include "memory/iterator.hpp" 31 #include "trace/traceMacros.hpp" 32 #include "jvmci/vmSymbols_jvmci.hpp" 33 34 // The class vmSymbols is a name space for fast lookup of 35 // symbols commonly used in the VM. 36 // 37 // Sample usage: 38 // 39 // Symbol* obj = vmSymbols::java_lang_Object(); 40 41 42 // Useful sub-macros exported by this header file: 43 44 #define VM_SYMBOL_ENUM_NAME(name) name##_enum 45 #define VM_INTRINSIC_IGNORE(id, class, name, sig, flags) /*ignored*/ 46 #define VM_SYMBOL_IGNORE(id, name) /*ignored*/ 47 #define VM_ALIAS_IGNORE(id, id2) /*ignored*/ 48 49 // Mapping function names to values. New entries should be added below. 50 51 #define VM_SYMBOLS_DO(template, do_alias) \ 52 /* commonly used class names */ \ 53 template(java_lang_System, "java/lang/System") \ 54 template(java_lang_Object, "java/lang/Object") \ 55 template(java_lang_Class, "java/lang/Class") \ 56 template(java_lang_String, "java/lang/String") \ 57 template(java_lang_StringLatin1, "java/lang/StringLatin1") \ 58 template(java_lang_StringUTF16, "java/lang/StringUTF16") \ 59 template(java_lang_Thread, "java/lang/Thread") \ 60 template(java_lang_ThreadGroup, "java/lang/ThreadGroup") \ 61 template(java_lang_Cloneable, "java/lang/Cloneable") \ 62 template(java_lang_Throwable, "java/lang/Throwable") \ 63 template(java_lang_ClassLoader, "java/lang/ClassLoader") \ 64 template(java_lang_ClassLoader_NativeLibrary, "java/lang/ClassLoader\x024NativeLibrary") \ 65 template(java_lang_ThreadDeath, "java/lang/ThreadDeath") \ 66 template(java_lang_Boolean, "java/lang/Boolean") \ 67 template(java_lang_Character, "java/lang/Character") \ 68 template(java_lang_Character_CharacterCache, "java/lang/Character$CharacterCache") \ 69 template(java_lang_Float, "java/lang/Float") \ 70 template(java_lang_Double, "java/lang/Double") \ 71 template(java_lang_Byte, "java/lang/Byte") \ 72 template(java_lang_Byte_ByteCache, "java/lang/Byte$ByteCache") \ 73 template(java_lang_Short, "java/lang/Short") \ 74 template(java_lang_Short_ShortCache, "java/lang/Short$ShortCache") \ 75 template(java_lang_Integer, "java/lang/Integer") \ 76 template(java_lang_Integer_IntegerCache, "java/lang/Integer$IntegerCache") \ 77 template(java_lang_Long, "java/lang/Long") \ 78 template(java_lang_Long_LongCache, "java/lang/Long$LongCache") \ 79 template(java_lang_Shutdown, "java/lang/Shutdown") \ 80 template(java_lang_ref_Reference, "java/lang/ref/Reference") \ 81 template(java_lang_ref_SoftReference, "java/lang/ref/SoftReference") \ 82 template(java_lang_ref_WeakReference, "java/lang/ref/WeakReference") \ 83 template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \ 84 template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \ 85 template(sun_misc_Cleaner, "sun/misc/Cleaner") \ 86 template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \ 87 template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \ 88 template(java_lang_reflect_Method, "java/lang/reflect/Method") \ 89 template(java_lang_reflect_Constructor, "java/lang/reflect/Constructor") \ 90 template(java_lang_reflect_Field, "java/lang/reflect/Field") \ 91 template(java_lang_reflect_Parameter, "java/lang/reflect/Parameter") \ 92 template(java_lang_reflect_Array, "java/lang/reflect/Array") \ 93 template(java_lang_StringBuffer, "java/lang/StringBuffer") \ 94 template(java_lang_StringBuilder, "java/lang/StringBuilder") \ 95 template(java_lang_CharSequence, "java/lang/CharSequence") \ 96 template(java_lang_SecurityManager, "java/lang/SecurityManager") \ 97 template(java_security_AccessControlContext, "java/security/AccessControlContext") \ 98 template(java_security_CodeSource, "java/security/CodeSource") \ 99 template(java_security_ProtectionDomain, "java/security/ProtectionDomain") \ 100 template(java_security_SecureClassLoader, "java/security/SecureClassLoader") \ 101 template(java_net_URLClassLoader, "java/net/URLClassLoader") \ 102 template(java_net_URL, "java/net/URL") \ 103 template(java_util_jar_Manifest, "java/util/jar/Manifest") \ 104 template(impliesCreateAccessControlContext_name, "impliesCreateAccessControlContext") \ 105 template(java_io_OutputStream, "java/io/OutputStream") \ 106 template(java_io_Reader, "java/io/Reader") \ 107 template(java_io_BufferedReader, "java/io/BufferedReader") \ 108 template(java_io_File, "java/io/File") \ 109 template(java_io_FileInputStream, "java/io/FileInputStream") \ 110 template(java_io_ByteArrayInputStream, "java/io/ByteArrayInputStream") \ 111 template(java_io_Serializable, "java/io/Serializable") \ 112 template(java_util_Arrays, "java/util/Arrays") \ 113 template(java_util_Properties, "java/util/Properties") \ 114 template(java_util_Vector, "java/util/Vector") \ 115 template(java_util_AbstractList, "java/util/AbstractList") \ 116 template(java_util_Hashtable, "java/util/Hashtable") \ 117 template(java_lang_Compiler, "java/lang/Compiler") \ 118 template(sun_misc_Signal, "sun/misc/Signal") \ 119 template(sun_misc_Launcher, "sun/misc/Launcher") \ 120 template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \ 121 template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \ 122 template(sun_misc_PostVMInitHook, "sun/misc/PostVMInitHook") \ 123 template(sun_misc_Launcher_ExtClassLoader, "sun/misc/Launcher$ExtClassLoader") \ 124 \ 125 /* Java runtime version access */ \ 126 template(sun_misc_Version, "sun/misc/Version") \ 127 template(java_runtime_name_name, "java_runtime_name") \ 128 template(java_runtime_version_name, "java_runtime_version") \ 129 \ 130 /* class file format tags */ \ 131 template(tag_source_file, "SourceFile") \ 132 template(tag_inner_classes, "InnerClasses") \ 133 template(tag_constant_value, "ConstantValue") \ 134 template(tag_code, "Code") \ 135 template(tag_exceptions, "Exceptions") \ 136 template(tag_line_number_table, "LineNumberTable") \ 137 template(tag_local_variable_table, "LocalVariableTable") \ 138 template(tag_local_variable_type_table, "LocalVariableTypeTable") \ 139 template(tag_method_parameters, "MethodParameters") \ 140 template(tag_stack_map_table, "StackMapTable") \ 141 template(tag_synthetic, "Synthetic") \ 142 template(tag_deprecated, "Deprecated") \ 143 template(tag_source_debug_extension, "SourceDebugExtension") \ 144 template(tag_signature, "Signature") \ 145 template(tag_runtime_visible_annotations, "RuntimeVisibleAnnotations") \ 146 template(tag_runtime_invisible_annotations, "RuntimeInvisibleAnnotations") \ 147 template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations") \ 148 template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations") \ 149 template(tag_annotation_default, "AnnotationDefault") \ 150 template(tag_runtime_visible_type_annotations, "RuntimeVisibleTypeAnnotations") \ 151 template(tag_runtime_invisible_type_annotations, "RuntimeInvisibleTypeAnnotations") \ 152 template(tag_enclosing_method, "EnclosingMethod") \ 153 template(tag_bootstrap_methods, "BootstrapMethods") \ 154 \ 155 /* exception klasses: at least all exceptions thrown by the VM have entries here */ \ 156 template(java_lang_ArithmeticException, "java/lang/ArithmeticException") \ 157 template(java_lang_ArrayIndexOutOfBoundsException, "java/lang/ArrayIndexOutOfBoundsException") \ 158 template(java_lang_ArrayStoreException, "java/lang/ArrayStoreException") \ 159 template(java_lang_ClassCastException, "java/lang/ClassCastException") \ 160 template(java_lang_ClassNotFoundException, "java/lang/ClassNotFoundException") \ 161 template(java_lang_CloneNotSupportedException, "java/lang/CloneNotSupportedException") \ 162 template(java_lang_IllegalAccessException, "java/lang/IllegalAccessException") \ 163 template(java_lang_IllegalArgumentException, "java/lang/IllegalArgumentException") \ 164 template(java_lang_IllegalStateException, "java/lang/IllegalStateException") \ 165 template(java_lang_IllegalMonitorStateException, "java/lang/IllegalMonitorStateException") \ 166 template(java_lang_IllegalThreadStateException, "java/lang/IllegalThreadStateException") \ 167 template(java_lang_IndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException") \ 168 template(java_lang_InstantiationException, "java/lang/InstantiationException") \ 169 template(java_lang_InstantiationError, "java/lang/InstantiationError") \ 170 template(java_lang_InterruptedException, "java/lang/InterruptedException") \ 171 template(java_lang_BootstrapMethodError, "java/lang/BootstrapMethodError") \ 172 template(java_lang_LinkageError, "java/lang/LinkageError") \ 173 template(java_lang_NegativeArraySizeException, "java/lang/NegativeArraySizeException") \ 174 template(java_lang_NoSuchFieldException, "java/lang/NoSuchFieldException") \ 175 template(java_lang_NoSuchMethodException, "java/lang/NoSuchMethodException") \ 176 template(java_lang_NullPointerException, "java/lang/NullPointerException") \ 177 template(java_lang_StringIndexOutOfBoundsException, "java/lang/StringIndexOutOfBoundsException")\ 178 template(java_lang_UnsupportedOperationException, "java/lang/UnsupportedOperationException") \ 179 template(java_lang_InvalidClassException, "java/lang/InvalidClassException") \ 180 template(java_lang_reflect_InvocationTargetException, "java/lang/reflect/InvocationTargetException") \ 181 template(java_lang_Exception, "java/lang/Exception") \ 182 template(java_lang_RuntimeException, "java/lang/RuntimeException") \ 183 template(java_io_IOException, "java/io/IOException") \ 184 template(java_security_PrivilegedActionException, "java/security/PrivilegedActionException") \ 185 \ 186 /* error klasses: at least all errors thrown by the VM have entries here */ \ 187 template(java_lang_AbstractMethodError, "java/lang/AbstractMethodError") \ 188 template(java_lang_ClassCircularityError, "java/lang/ClassCircularityError") \ 189 template(java_lang_ClassFormatError, "java/lang/ClassFormatError") \ 190 template(java_lang_UnsupportedClassVersionError, "java/lang/UnsupportedClassVersionError") \ 191 template(java_lang_Error, "java/lang/Error") \ 192 template(java_lang_ExceptionInInitializerError, "java/lang/ExceptionInInitializerError") \ 193 template(java_lang_IllegalAccessError, "java/lang/IllegalAccessError") \ 194 template(java_lang_IncompatibleClassChangeError, "java/lang/IncompatibleClassChangeError") \ 195 template(java_lang_InternalError, "java/lang/InternalError") \ 196 template(java_lang_NoClassDefFoundError, "java/lang/NoClassDefFoundError") \ 197 template(java_lang_NoSuchFieldError, "java/lang/NoSuchFieldError") \ 198 template(java_lang_NoSuchMethodError, "java/lang/NoSuchMethodError") \ 199 template(java_lang_OutOfMemoryError, "java/lang/OutOfMemoryError") \ 200 template(java_lang_UnsatisfiedLinkError, "java/lang/UnsatisfiedLinkError") \ 201 template(java_lang_VerifyError, "java/lang/VerifyError") \ 202 template(java_lang_SecurityException, "java/lang/SecurityException") \ 203 template(java_lang_VirtualMachineError, "java/lang/VirtualMachineError") \ 204 template(java_lang_StackOverflowError, "java/lang/StackOverflowError") \ 205 template(java_lang_StackTraceElement, "java/lang/StackTraceElement") \ 206 \ 207 /* Concurrency support */ \ 208 template(java_util_concurrent_locks_AbstractOwnableSynchronizer, "java/util/concurrent/locks/AbstractOwnableSynchronizer") \ 209 template(java_util_concurrent_atomic_AtomicIntegerFieldUpdater_Impl, "java/util/concurrent/atomic/AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl") \ 210 template(java_util_concurrent_atomic_AtomicLongFieldUpdater_CASUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater") \ 211 template(java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater") \ 212 template(java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl, "java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl") \ 213 template(sun_misc_Contended_signature, "Lsun/misc/Contended;") \ 214 \ 215 /* class symbols needed by intrinsics */ \ 216 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \ 217 \ 218 /* Support for reflection based on dynamic bytecode generation (JDK 1.4 and above) */ \ 219 \ 220 template(sun_reflect_FieldInfo, "sun/reflect/FieldInfo") \ 221 template(sun_reflect_MethodInfo, "sun/reflect/MethodInfo") \ 222 template(sun_reflect_MagicAccessorImpl, "sun/reflect/MagicAccessorImpl") \ 223 template(sun_reflect_MethodAccessorImpl, "sun/reflect/MethodAccessorImpl") \ 224 template(sun_reflect_ConstructorAccessorImpl, "sun/reflect/ConstructorAccessorImpl") \ 225 template(sun_reflect_SerializationConstructorAccessorImpl, "sun/reflect/SerializationConstructorAccessorImpl") \ 226 template(sun_reflect_DelegatingClassLoader, "sun/reflect/DelegatingClassLoader") \ 227 template(sun_reflect_Reflection, "sun/reflect/Reflection") \ 228 template(sun_reflect_CallerSensitive, "sun/reflect/CallerSensitive") \ 229 template(sun_reflect_CallerSensitive_signature, "Lsun/reflect/CallerSensitive;") \ 230 template(checkedExceptions_name, "checkedExceptions") \ 231 template(clazz_name, "clazz") \ 232 template(exceptionTypes_name, "exceptionTypes") \ 233 template(modifiers_name, "modifiers") \ 234 template(newConstructor_name, "newConstructor") \ 235 template(newConstructor_signature, "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Constructor;") \ 236 template(newField_name, "newField") \ 237 template(newField_signature, "(Lsun/reflect/FieldInfo;)Ljava/lang/reflect/Field;") \ 238 template(newMethod_name, "newMethod") \ 239 template(newMethod_signature, "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Method;") \ 240 template(invokeBasic_name, "invokeBasic") \ 241 template(linkToVirtual_name, "linkToVirtual") \ 242 template(linkToStatic_name, "linkToStatic") \ 243 template(linkToSpecial_name, "linkToSpecial") \ 244 template(linkToInterface_name, "linkToInterface") \ 245 template(compiledLambdaForm_name, "<compiledLambdaForm>") /*fake name*/ \ 246 template(star_name, "*") /*not really a name*/ \ 247 template(invoke_name, "invoke") \ 248 template(override_name, "override") \ 249 template(parameterTypes_name, "parameterTypes") \ 250 template(returnType_name, "returnType") \ 251 template(signature_name, "signature") \ 252 template(slot_name, "slot") \ 253 \ 254 /* Support for annotations (JDK 1.5 and above) */ \ 255 \ 256 template(annotations_name, "annotations") \ 257 template(index_name, "index") \ 258 template(executable_name, "executable") \ 259 template(parameter_annotations_name, "parameterAnnotations") \ 260 template(annotation_default_name, "annotationDefault") \ 261 template(sun_reflect_ConstantPool, "sun/reflect/ConstantPool") \ 262 template(ConstantPool_name, "constantPoolOop") \ 263 template(sun_reflect_UnsafeStaticFieldAccessorImpl, "sun/reflect/UnsafeStaticFieldAccessorImpl")\ 264 template(base_name, "base") \ 265 /* Type Annotations (JDK 8 and above) */ \ 266 template(type_annotations_name, "typeAnnotations") \ 267 \ 268 /* Intrinsic Annotation (JDK 9 and above) */ \ 269 template(jdk_internal_HotSpotIntrinsicCandidate_signature, "Ljdk/internal/HotSpotIntrinsicCandidate;") \ 270 /* Accessor Annotation (Prototype) */ \ 271 template(java_lang_reflect_Accessor_signature, "Ljava/lang/reflect/Accessor;") \ 272 \ 273 /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \ 274 template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \ 275 template(java_lang_invoke_ConstantCallSite, "java/lang/invoke/ConstantCallSite") \ 276 template(java_lang_invoke_DirectMethodHandle, "java/lang/invoke/DirectMethodHandle") \ 277 template(java_lang_invoke_MutableCallSite, "java/lang/invoke/MutableCallSite") \ 278 template(java_lang_invoke_VolatileCallSite, "java/lang/invoke/VolatileCallSite") \ 279 template(java_lang_invoke_MethodHandle, "java/lang/invoke/MethodHandle") \ 280 template(java_lang_invoke_MethodType, "java/lang/invoke/MethodType") \ 281 template(java_lang_invoke_MethodType_signature, "Ljava/lang/invoke/MethodType;") \ 282 template(java_lang_invoke_MemberName_signature, "Ljava/lang/invoke/MemberName;") \ 283 template(java_lang_invoke_LambdaForm_signature, "Ljava/lang/invoke/LambdaForm;") \ 284 template(java_lang_invoke_MethodHandle_signature, "Ljava/lang/invoke/MethodHandle;") \ 285 /* internal classes known only to the JVM: */ \ 286 template(java_lang_invoke_MemberName, "java/lang/invoke/MemberName") \ 287 template(java_lang_invoke_MethodHandleNatives, "java/lang/invoke/MethodHandleNatives") \ 288 template(java_lang_invoke_MethodHandleNatives_CallSiteContext, "java/lang/invoke/MethodHandleNatives$CallSiteContext") \ 289 template(java_lang_invoke_LambdaForm, "java/lang/invoke/LambdaForm") \ 290 template(java_lang_invoke_ForceInline_signature, "Ljava/lang/invoke/ForceInline;") \ 291 template(java_lang_invoke_DontInline_signature, "Ljava/lang/invoke/DontInline;") \ 292 template(java_lang_invoke_InjectedProfile_signature, "Ljava/lang/invoke/InjectedProfile;") \ 293 template(java_lang_invoke_Stable_signature, "Ljava/lang/invoke/Stable;") \ 294 template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \ 295 template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;") \ 296 template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \ 297 /* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */ \ 298 template(findMethodHandleType_name, "findMethodHandleType") \ 299 template(findMethodHandleType_signature, "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \ 300 template(linkMethodHandleConstant_name, "linkMethodHandleConstant") \ 301 template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;") \ 302 template(linkMethod_name, "linkMethod") \ 303 template(linkMethod_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \ 304 template(linkCallSite_name, "linkCallSite") \ 305 template(linkCallSite_signature, "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \ 306 template(setTargetNormal_name, "setTargetNormal") \ 307 template(setTargetVolatile_name, "setTargetVolatile") \ 308 template(setTarget_signature, "(Ljava/lang/invoke/MethodHandle;)V") \ 309 template(DEFAULT_CONTEXT_name, "DEFAULT_CONTEXT") \ 310 NOT_LP64( do_alias(intptr_signature, int_signature) ) \ 311 LP64_ONLY( do_alias(intptr_signature, long_signature) ) \ 312 \ 313 /* Support for JVMCI */ \ 314 JVMCI_VM_SYMBOLS_DO(template, do_alias) \ 315 \ 316 template(java_lang_StackWalker, "java/lang/StackWalker") \ 317 template(java_lang_StackFrameInfo, "java/lang/StackFrameInfo") \ 318 template(java_lang_LiveStackFrameInfo, "java/lang/LiveStackFrameInfo") \ 319 template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \ 320 template(doStackWalk_name, "doStackWalk") \ 321 template(doStackWalk_signature, "(JIIII)Ljava/lang/Object;") \ 322 template(asPrimitive_name, "asPrimitive") \ 323 template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 324 template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 325 template(asPrimitive_short_signature, "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 326 template(asPrimitive_byte_signature, "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 327 template(asPrimitive_char_signature, "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 328 template(asPrimitive_float_signature, "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 329 template(asPrimitive_double_signature, "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 330 template(asPrimitive_boolean_signature, "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ 331 \ 332 /* common method and field names */ \ 333 template(object_initializer_name, "<init>") \ 334 template(class_initializer_name, "<clinit>") \ 335 template(println_name, "println") \ 336 template(printStackTrace_name, "printStackTrace") \ 337 template(main_name, "main") \ 338 template(name_name, "name") \ 339 template(priority_name, "priority") \ 340 template(stillborn_name, "stillborn") \ 341 template(group_name, "group") \ 342 template(daemon_name, "daemon") \ 343 template(eetop_name, "eetop") \ 344 template(thread_status_name, "threadStatus") \ 345 template(run_method_name, "run") \ 346 template(exit_method_name, "exit") \ 347 template(add_method_name, "add") \ 348 template(remove_method_name, "remove") \ 349 template(parent_name, "parent") \ 350 template(threads_name, "threads") \ 351 template(groups_name, "groups") \ 352 template(maxPriority_name, "maxPriority") \ 353 template(destroyed_name, "destroyed") \ 354 template(vmAllowSuspension_name, "vmAllowSuspension") \ 355 template(nthreads_name, "nthreads") \ 356 template(ngroups_name, "ngroups") \ 357 template(shutdown_method_name, "shutdown") \ 358 template(finalize_method_name, "finalize") \ 359 template(reference_lock_name, "lock") \ 360 template(reference_discovered_name, "discovered") \ 361 template(run_finalization_name, "runFinalization") \ 362 template(run_finalizers_on_exit_name, "runFinalizersOnExit") \ 363 template(dispatchUncaughtException_name, "dispatchUncaughtException") \ 364 template(initializeSystemClass_name, "initializeSystemClass") \ 365 template(loadClass_name, "loadClass") \ 366 template(loadClassInternal_name, "loadClassInternal") \ 367 template(get_name, "get") \ 368 template(put_name, "put") \ 369 template(type_name, "type") \ 370 template(findNative_name, "findNative") \ 371 template(deadChild_name, "deadChild") \ 372 template(addClass_name, "addClass") \ 373 template(throwIllegalAccessError_name, "throwIllegalAccessError") \ 374 template(getFromClass_name, "getFromClass") \ 375 template(dispatch_name, "dispatch") \ 376 template(getSystemClassLoader_name, "getSystemClassLoader") \ 377 template(fillInStackTrace_name, "fillInStackTrace") \ 378 template(getCause_name, "getCause") \ 379 template(initCause_name, "initCause") \ 380 template(setProperty_name, "setProperty") \ 381 template(getProperty_name, "getProperty") \ 382 template(context_name, "context") \ 383 template(privilegedContext_name, "privilegedContext") \ 384 template(contextClassLoader_name, "contextClassLoader") \ 385 template(inheritedAccessControlContext_name, "inheritedAccessControlContext") \ 386 template(isPrivileged_name, "isPrivileged") \ 387 template(isAuthorized_name, "isAuthorized") \ 388 template(getClassContext_name, "getClassContext") \ 389 template(wait_name, "wait") \ 390 template(checkPackageAccess_name, "checkPackageAccess") \ 391 template(stackSize_name, "stackSize") \ 392 template(thread_id_name, "tid") \ 393 template(newInstance0_name, "newInstance0") \ 394 template(limit_name, "limit") \ 395 template(member_name, "member") \ 396 template(forName_name, "forName") \ 397 template(forName0_name, "forName0") \ 398 template(isJavaIdentifierStart_name, "isJavaIdentifierStart") \ 399 template(isJavaIdentifierPart_name, "isJavaIdentifierPart") \ 400 template(exclusive_owner_thread_name, "exclusiveOwnerThread") \ 401 template(park_blocker_name, "parkBlocker") \ 402 template(park_event_name, "nativeParkEventPointer") \ 403 template(cache_field_name, "cache") \ 404 template(value_name, "value") \ 405 template(hash_name, "hash") \ 406 template(coder_name, "coder") \ 407 template(compact_strings_name, "COMPACT_STRINGS") \ 408 template(numberOfLeadingZeros_name, "numberOfLeadingZeros") \ 409 template(numberOfTrailingZeros_name, "numberOfTrailingZeros") \ 410 template(bitCount_name, "bitCount") \ 411 template(profile_name, "profile") \ 412 template(equals_name, "equals") \ 413 template(length_name, "length") \ 414 template(target_name, "target") \ 415 template(toString_name, "toString") \ 416 template(values_name, "values") \ 417 template(receiver_name, "receiver") \ 418 template(vmtarget_name, "vmtarget") \ 419 template(next_target_name, "next_target") \ 420 template(vmloader_name, "vmloader") \ 421 template(vmindex_name, "vmindex") \ 422 template(vmcount_name, "vmcount") \ 423 template(vmentry_name, "vmentry") \ 424 template(flags_name, "flags") \ 425 template(rtype_name, "rtype") \ 426 template(ptypes_name, "ptypes") \ 427 template(form_name, "form") \ 428 template(basicType_name, "basicType") \ 429 template(append_name, "append") \ 430 template(klass_name, "klass") \ 431 template(array_klass_name, "array_klass") \ 432 template(declaringClass_name, "declaringClass") \ 433 template(memberName_name, "memberName") \ 434 template(mid_name, "mid") \ 435 template(cpref_name, "cpref") \ 436 template(version_name, "version") \ 437 template(bci_name, "bci") \ 438 template(methodName_name, "methodName") \ 439 template(fileName_name, "fileName") \ 440 template(lineNumber_name, "lineNumber") \ 441 template(monitors_name, "monitors") \ 442 template(locals_name, "locals") \ 443 template(operands_name, "operands") \ 444 template(oop_size_name, "oop_size") \ 445 template(static_oop_field_count_name, "static_oop_field_count") \ 446 template(protection_domain_name, "protection_domain") \ 447 template(signers_name, "signers_name") \ 448 template(loader_data_name, "loader_data") \ 449 template(vmdependencies_name, "vmdependencies") \ 450 template(input_stream_void_signature, "(Ljava/io/InputStream;)V") \ 451 template(getFileURL_name, "getFileURL") \ 452 template(getFileURL_signature, "(Ljava/io/File;)Ljava/net/URL;") \ 453 template(definePackageInternal_name, "definePackageInternal") \ 454 template(definePackageInternal_signature, "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)V") \ 455 template(getProtectionDomain_name, "getProtectionDomain") \ 456 template(getProtectionDomain_signature, "(Ljava/security/CodeSource;)Ljava/security/ProtectionDomain;") \ 457 template(url_code_signer_array_void_signature, "(Ljava/net/URL;[Ljava/security/CodeSigner;)V") \ 458 \ 459 /* non-intrinsic name/signature pairs: */ \ 460 template(register_method_name, "register") \ 461 do_alias(register_method_signature, object_void_signature) \ 462 \ 463 /* name symbols needed by intrinsics */ \ 464 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \ 465 \ 466 /* common signatures names */ \ 467 template(void_method_signature, "()V") \ 468 template(void_boolean_signature, "()Z") \ 469 template(void_byte_signature, "()B") \ 470 template(void_char_signature, "()C") \ 471 template(void_short_signature, "()S") \ 472 template(void_int_signature, "()I") \ 473 template(void_long_signature, "()J") \ 474 template(void_float_signature, "()F") \ 475 template(void_double_signature, "()D") \ 476 template(bool_void_signature, "(Z)V") \ 477 template(int_void_signature, "(I)V") \ 478 template(int_int_signature, "(I)I") \ 479 template(char_char_signature, "(C)C") \ 480 template(short_short_signature, "(S)S") \ 481 template(int_bool_signature, "(I)Z") \ 482 template(float_int_signature, "(F)I") \ 483 template(double_long_signature, "(D)J") \ 484 template(double_double_signature, "(D)D") \ 485 template(int_float_signature, "(I)F") \ 486 template(long_int_signature, "(J)I") \ 487 template(long_long_signature, "(J)J") \ 488 template(long_double_signature, "(J)D") \ 489 template(byte_signature, "B") \ 490 template(char_signature, "C") \ 491 template(double_signature, "D") \ 492 template(float_signature, "F") \ 493 template(int_signature, "I") \ 494 template(long_signature, "J") \ 495 template(short_signature, "S") \ 496 template(bool_signature, "Z") \ 497 template(void_signature, "V") \ 498 template(byte_array_signature, "[B") \ 499 template(char_array_signature, "[C") \ 500 template(int_array_signature, "[I") \ 501 template(object_void_signature, "(Ljava/lang/Object;)V") \ 502 template(object_int_signature, "(Ljava/lang/Object;)I") \ 503 template(object_boolean_signature, "(Ljava/lang/Object;)Z") \ 504 template(object_object_signature, "(Ljava/lang/Object;)Ljava/lang/Object;") \ 505 template(string_void_signature, "(Ljava/lang/String;)V") \ 506 template(string_int_signature, "(Ljava/lang/String;)I") \ 507 template(throwable_void_signature, "(Ljava/lang/Throwable;)V") \ 508 template(void_throwable_signature, "()Ljava/lang/Throwable;") \ 509 template(throwable_throwable_signature, "(Ljava/lang/Throwable;)Ljava/lang/Throwable;") \ 510 template(class_void_signature, "(Ljava/lang/Class;)V") \ 511 template(class_int_signature, "(Ljava/lang/Class;)I") \ 512 template(class_long_signature, "(Ljava/lang/Class;)J") \ 513 template(class_boolean_signature, "(Ljava/lang/Class;)Z") \ 514 template(throwable_string_void_signature, "(Ljava/lang/Throwable;Ljava/lang/String;)V") \ 515 template(string_array_void_signature, "([Ljava/lang/String;)V") \ 516 template(string_array_string_array_void_signature, "([Ljava/lang/String;[Ljava/lang/String;)V") \ 517 template(thread_throwable_void_signature, "(Ljava/lang/Thread;Ljava/lang/Throwable;)V") \ 518 template(thread_void_signature, "(Ljava/lang/Thread;)V") \ 519 template(threadgroup_runnable_void_signature, "(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;)V") \ 520 template(threadgroup_string_void_signature, "(Ljava/lang/ThreadGroup;Ljava/lang/String;)V") \ 521 template(string_class_signature, "(Ljava/lang/String;)Ljava/lang/Class;") \ 522 template(object_object_object_signature, "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \ 523 template(string_string_string_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") \ 524 template(string_string_signature, "(Ljava/lang/String;)Ljava/lang/String;") \ 525 template(classloader_string_long_signature, "(Ljava/lang/ClassLoader;Ljava/lang/String;)J") \ 526 template(byte_array_void_signature, "([B)V") \ 527 template(char_array_void_signature, "([C)V") \ 528 template(int_int_void_signature, "(II)V") \ 529 template(long_long_void_signature, "(JJ)V") \ 530 template(void_classloader_signature, "()Ljava/lang/ClassLoader;") \ 531 template(void_object_signature, "()Ljava/lang/Object;") \ 532 template(void_class_signature, "()Ljava/lang/Class;") \ 533 template(void_class_array_signature, "()[Ljava/lang/Class;") \ 534 template(void_string_signature, "()Ljava/lang/String;") \ 535 template(object_array_object_signature, "([Ljava/lang/Object;)Ljava/lang/Object;") \ 536 template(object_object_array_object_signature, "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\ 537 template(exception_void_signature, "(Ljava/lang/Exception;)V") \ 538 template(protectiondomain_signature, "[Ljava/security/ProtectionDomain;") \ 539 template(accesscontrolcontext_signature, "Ljava/security/AccessControlContext;") \ 540 template(class_protectiondomain_signature, "(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V") \ 541 template(thread_signature, "Ljava/lang/Thread;") \ 542 template(thread_array_signature, "[Ljava/lang/Thread;") \ 543 template(threadgroup_signature, "Ljava/lang/ThreadGroup;") \ 544 template(threadgroup_array_signature, "[Ljava/lang/ThreadGroup;") \ 545 template(class_array_signature, "[Ljava/lang/Class;") \ 546 template(classloader_signature, "Ljava/lang/ClassLoader;") \ 547 template(object_signature, "Ljava/lang/Object;") \ 548 template(object_array_signature, "[Ljava/lang/Object;") \ 549 template(class_signature, "Ljava/lang/Class;") \ 550 template(string_signature, "Ljava/lang/String;") \ 551 template(reference_signature, "Ljava/lang/ref/Reference;") \ 552 template(sun_misc_Cleaner_signature, "Lsun/misc/Cleaner;") \ 553 template(executable_signature, "Ljava/lang/reflect/Executable;") \ 554 template(concurrenthashmap_signature, "Ljava/util/concurrent/ConcurrentHashMap;") \ 555 template(String_StringBuilder_signature, "(Ljava/lang/String;)Ljava/lang/StringBuilder;") \ 556 template(int_StringBuilder_signature, "(I)Ljava/lang/StringBuilder;") \ 557 template(char_StringBuilder_signature, "(C)Ljava/lang/StringBuilder;") \ 558 template(String_StringBuffer_signature, "(Ljava/lang/String;)Ljava/lang/StringBuffer;") \ 559 template(int_StringBuffer_signature, "(I)Ljava/lang/StringBuffer;") \ 560 template(char_StringBuffer_signature, "(C)Ljava/lang/StringBuffer;") \ 561 template(int_String_signature, "(I)Ljava/lang/String;") \ 562 template(codesource_permissioncollection_signature, "(Ljava/security/CodeSource;Ljava/security/PermissionCollection;)V") \ 563 /* signature symbols needed by intrinsics */ \ 564 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE) \ 565 \ 566 /* symbol aliases needed by intrinsics */ \ 567 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, do_alias) \ 568 \ 569 /* returned by the C1 compiler in case there's not enough memory to allocate a new symbol*/ \ 570 template(dummy_symbol, "illegal symbol") \ 571 \ 572 /* used by ClassFormatError when class name is not known yet */ \ 573 template(unknown_class_name, "<Unknown>") \ 574 \ 575 /* used to identify class loaders handling parallel class loading */ \ 576 template(parallelCapable_name, "parallelLockMap") \ 577 \ 578 /* JVM monitoring and management support */ \ 579 template(java_lang_StackTraceElement_array, "[Ljava/lang/StackTraceElement;") \ 580 template(java_lang_management_ThreadState, "java/lang/management/ThreadState") \ 581 template(java_lang_management_MemoryUsage, "java/lang/management/MemoryUsage") \ 582 template(java_lang_management_ThreadInfo, "java/lang/management/ThreadInfo") \ 583 template(sun_management_Sensor, "sun/management/Sensor") \ 584 template(sun_management_Agent, "sun/management/Agent") \ 585 template(com_sun_management_internal_DiagnosticCommandImpl, "com/sun/management/internal/DiagnosticCommandImpl") \ 586 template(com_sun_management_internal_GarbageCollectorExtImpl,"com/sun/management/internal/GarbageCollectorExtImpl") \ 587 template(sun_management_ManagementFactoryHelper, "sun/management/ManagementFactoryHelper") \ 588 template(getDiagnosticCommandMBean_name, "getDiagnosticCommandMBean") \ 589 template(getDiagnosticCommandMBean_signature, "()Lcom/sun/management/DiagnosticCommandMBean;") \ 590 template(getGcInfoBuilder_name, "getGcInfoBuilder") \ 591 template(getGcInfoBuilder_signature, "()Lcom/sun/management/internal/GcInfoBuilder;") \ 592 template(com_sun_management_GcInfo, "com/sun/management/GcInfo") \ 593 template(com_sun_management_GcInfo_constructor_signature, "(Lcom/sun/management/internal/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V") \ 594 template(createGCNotification_name, "createGCNotification") \ 595 template(createGCNotification_signature, "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/sun/management/GcInfo;)V") \ 596 template(createDiagnosticFrameworkNotification_name, "createDiagnosticFrameworkNotification") \ 597 template(createMemoryPoolMBean_name, "createMemoryPoolMBean") \ 598 template(createMemoryManagerMBean_name, "createMemoryManagerMBean") \ 599 template(createGarbageCollectorMBean_name, "createGarbageCollectorMBean") \ 600 template(createMemoryPoolMBean_signature, "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMBean;") \ 601 template(createMemoryManagerMBean_signature, "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMBean;") \ 602 template(createGarbageCollectorMBean_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMBean;") \ 603 template(trigger_name, "trigger") \ 604 template(clear_name, "clear") \ 605 template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \ 606 template(startAgent_name, "startAgent") \ 607 template(startRemoteAgent_name, "startRemoteManagementAgent") \ 608 template(startLocalAgent_name, "startLocalManagementAgent") \ 609 template(stopRemoteAgent_name, "stopRemoteManagementAgent") \ 610 template(getAgentStatus_name, "getManagementAgentStatus") \ 611 template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \ 612 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") \ 613 template(long_long_long_long_void_signature, "(JJJJ)V") \ 614 template(finalizer_histogram_klass, "java/lang/ref/FinalizerHistogram") \ 615 template(void_finalizer_histogram_entry_array_signature, "()[Ljava/lang/ref/FinalizerHistogram$Entry;") \ 616 template(get_finalizer_histogram_name, "getFinalizerHistogram") \ 617 template(finalizer_histogram_entry_name_field, "className") \ 618 template(finalizer_histogram_entry_count_field, "instanceCount") \ 619 \ 620 template(java_lang_management_MemoryPoolMXBean, "java/lang/management/MemoryPoolMXBean") \ 621 template(java_lang_management_MemoryManagerMXBean, "java/lang/management/MemoryManagerMXBean") \ 622 template(java_lang_management_GarbageCollectorMXBean,"java/lang/management/GarbageCollectorMXBean") \ 623 template(gcInfoBuilder_name, "gcInfoBuilder") \ 624 template(createMemoryPool_name, "createMemoryPool") \ 625 template(createMemoryManager_name, "createMemoryManager") \ 626 template(createGarbageCollector_name, "createGarbageCollector") \ 627 template(createMemoryPool_signature, "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMXBean;") \ 628 template(createMemoryManager_signature, "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMXBean;") \ 629 template(createGarbageCollector_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMXBean;") \ 630 template(addThreadDumpForMonitors_name, "addThreadDumpForMonitors") \ 631 template(addThreadDumpForSynchronizers_name, "addThreadDumpForSynchronizers") \ 632 template(addThreadDumpForMonitors_signature, "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;[I)V") \ 633 template(addThreadDumpForSynchronizers_signature, "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;)V") \ 634 \ 635 /* JVMTI/java.lang.instrument support and VM Attach mechanism */ \ 636 template(sun_misc_VMSupport, "sun/misc/VMSupport") \ 637 template(appendToClassPathForInstrumentation_name, "appendToClassPathForInstrumentation") \ 638 do_alias(appendToClassPathForInstrumentation_signature, string_void_signature) \ 639 template(serializePropertiesToByteArray_name, "serializePropertiesToByteArray") \ 640 template(serializePropertiesToByteArray_signature, "()[B") \ 641 template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \ 642 template(classRedefinedCount_name, "classRedefinedCount") \ 643 template(classLoader_name, "classLoader") \ 644 template(componentType_name, "componentType") \ 645 \ 646 /* forEachRemaining support */ \ 647 template(java_util_stream_StreamsRangeIntSpliterator, "java/util/stream/Streams$RangeIntSpliterator") \ 648 \ 649 /* trace signatures */ \ 650 TRACE_TEMPLATES(template) \ 651 \ 652 /* extensions */ \ 653 VM_SYMBOLS_DO_EXT(template, do_alias) \ 654 \ 655 /*end*/ 656 657 // Here are all the intrinsics known to the runtime and the CI. 658 // Each intrinsic consists of a public enum name (like _hashCode), 659 // followed by a specification of its klass, name, and signature: 660 // template(<id>, <klass>, <name>, <sig>, <FCODE>) 661 // 662 // If you add an intrinsic here, you must also define its name 663 // and signature as members of the VM symbols. The VM symbols for 664 // the intrinsic name and signature may be defined above. 665 // 666 // Because the VM_SYMBOLS_DO macro makes reference to VM_INTRINSICS_DO, 667 // you can also define an intrinsic's name and/or signature locally to the 668 // intrinsic, if this makes sense. (It often does make sense.) 669 // 670 // For example: 671 // do_intrinsic(_foo, java_lang_Object, foo_name, foo_signature, F_xx) 672 // do_name( foo_name, "foo") 673 // do_signature(foo_signature, "()F") 674 // klass = vmSymbols::java_lang_Object() 675 // name = vmSymbols::foo_name() 676 // signature = vmSymbols::foo_signature() 677 // 678 // The name and/or signature might be a "well known" symbol 679 // like "equal" or "()I", in which case there will be no local 680 // re-definition of the symbol. 681 // 682 // The do_class, do_name, and do_signature calls are all used for the 683 // same purpose: Define yet another VM symbol. They could all be merged 684 // into a common 'do_symbol' call, but it seems useful to record our 685 // intentions here about kinds of symbols (class vs. name vs. signature). 686 // 687 // The F_xx is one of the Flags enum; see below. 688 // 689 // for Emacs: (let ((c-backslash-column 120) (c-backslash-max-column 120)) (c-backslash-region (point) (point-max) nil t)) 690 // 691 // 692 // There are two types of intrinsic methods: (1) Library intrinsics and (2) bytecode intrinsics. 693 // 694 // (1) A library intrinsic method may be replaced with hand-crafted assembly code, 695 // with hand-crafted compiler IR, or with a combination of the two. The semantics 696 // of the replacement code may differ from the semantics of the replaced code. 697 // 698 // (2) Bytecode intrinsic methods are not replaced by special code, but they are 699 // treated in some other special way by the compiler. For example, the compiler 700 // may delay inlining for some String-related intrinsic methods (e.g., some methods 701 // defined in the StringBuilder and StringBuffer classes, see 702 // Compile::should_delay_string_inlining() for more details). 703 // 704 // Due to the difference between the semantics of an intrinsic method as defined 705 // in the (Java) source code and the semantics of the method as defined 706 // by the code in the VM, intrinsic methods must be explicitly marked. 707 // 708 // Intrinsic methods are marked by the jdk.internal.HotSpotIntrinsicCandidate 709 // annotation. If CheckIntrinsics is enabled, the VM performs the following 710 // checks when a class C is loaded: (1) all intrinsics defined by the VM for 711 // class C are present in the loaded class file and are marked; 712 // (2) an intrinsic is defined by the VM for all marked methods of class C; 713 // (3) check for orphan methods in class C (i.e., methods for which the VM 714 // declares an intrinsic but that are not declared for the loaded class C. 715 // Check (3) is available only in debug builds. 716 // 717 // If a mismatch is detected for a method, the VM behaves differently depending 718 // on the type of build. A fastdebug build exits and reports an error on a mismatch. 719 // A product build will not replace an unmarked library intrinsic method with 720 // hand-crafted code, that is, unmarked library intrinsics are treated as ordinary 721 // methods in a product build. The special treatment of a bytecode intrinsic method 722 // persists even if the method not marked. 723 // 724 // When adding an intrinsic for a method, please make sure to appropriately 725 // annotate the method in the source code. The list below contains all 726 // library intrinsics followed by bytecode intrinsics. Please also make sure to 727 // add the declaration of the intrinsic to the approriate section of the list. 728 #define VM_INTRINSICS_DO(do_intrinsic, do_class, do_name, do_signature, do_alias) \ 729 /* (1) Library intrinsics */ \ 730 do_intrinsic(_hashCode, java_lang_Object, hashCode_name, void_int_signature, F_R) \ 731 do_name( hashCode_name, "hashCode") \ 732 do_intrinsic(_getClass, java_lang_Object, getClass_name, void_class_signature, F_R) \ 733 do_name( getClass_name, "getClass") \ 734 do_intrinsic(_clone, java_lang_Object, clone_name, void_object_signature, F_R) \ 735 do_name( clone_name, "clone") \ 736 do_intrinsic(_notify, java_lang_Object, notify_name, void_method_signature, F_R) \ 737 do_name( notify_name, "notify") \ 738 do_intrinsic(_notifyAll, java_lang_Object, notifyAll_name, void_method_signature, F_R) \ 739 do_name( notifyAll_name, "notifyAll") \ 740 \ 741 /* Math & StrictMath intrinsics are defined in terms of just a few signatures: */ \ 742 do_class(java_lang_Math, "java/lang/Math") \ 743 do_class(java_lang_StrictMath, "java/lang/StrictMath") \ 744 do_signature(double2_double_signature, "(DD)D") \ 745 do_signature(int2_int_signature, "(II)I") \ 746 do_signature(long2_long_signature, "(JJ)J") \ 747 \ 748 /* here are the math names, all together: */ \ 749 do_name(abs_name,"abs") do_name(sin_name,"sin") do_name(cos_name,"cos") \ 750 do_name(tan_name,"tan") do_name(atan2_name,"atan2") do_name(sqrt_name,"sqrt") \ 751 do_name(log_name,"log") do_name(log10_name,"log10") do_name(pow_name,"pow") \ 752 do_name(exp_name,"exp") do_name(min_name,"min") do_name(max_name,"max") \ 753 \ 754 do_name(addExact_name,"addExact") \ 755 do_name(decrementExact_name,"decrementExact") \ 756 do_name(incrementExact_name,"incrementExact") \ 757 do_name(multiplyExact_name,"multiplyExact") \ 758 do_name(negateExact_name,"negateExact") \ 759 do_name(subtractExact_name,"subtractExact") \ 760 \ 761 do_intrinsic(_dabs, java_lang_Math, abs_name, double_double_signature, F_S) \ 762 do_intrinsic(_dsin, java_lang_Math, sin_name, double_double_signature, F_S) \ 763 do_intrinsic(_dcos, java_lang_Math, cos_name, double_double_signature, F_S) \ 764 do_intrinsic(_dtan, java_lang_Math, tan_name, double_double_signature, F_S) \ 765 do_intrinsic(_datan2, java_lang_Math, atan2_name, double2_double_signature, F_S) \ 766 do_intrinsic(_dsqrt, java_lang_Math, sqrt_name, double_double_signature, F_S) \ 767 do_intrinsic(_dlog, java_lang_Math, log_name, double_double_signature, F_S) \ 768 do_intrinsic(_dlog10, java_lang_Math, log10_name, double_double_signature, F_S) \ 769 do_intrinsic(_dpow, java_lang_Math, pow_name, double2_double_signature, F_S) \ 770 do_intrinsic(_dexp, java_lang_Math, exp_name, double_double_signature, F_S) \ 771 do_intrinsic(_min, java_lang_Math, min_name, int2_int_signature, F_S) \ 772 do_intrinsic(_max, java_lang_Math, max_name, int2_int_signature, F_S) \ 773 do_intrinsic(_addExactI, java_lang_Math, addExact_name, int2_int_signature, F_S) \ 774 do_intrinsic(_addExactL, java_lang_Math, addExact_name, long2_long_signature, F_S) \ 775 do_intrinsic(_decrementExactI, java_lang_Math, decrementExact_name, int_int_signature, F_S) \ 776 do_intrinsic(_decrementExactL, java_lang_Math, decrementExact_name, long_long_signature, F_S) \ 777 do_intrinsic(_incrementExactI, java_lang_Math, incrementExact_name, int_int_signature, F_S) \ 778 do_intrinsic(_incrementExactL, java_lang_Math, incrementExact_name, long_long_signature, F_S) \ 779 do_intrinsic(_multiplyExactI, java_lang_Math, multiplyExact_name, int2_int_signature, F_S) \ 780 do_intrinsic(_multiplyExactL, java_lang_Math, multiplyExact_name, long2_long_signature, F_S) \ 781 do_intrinsic(_negateExactI, java_lang_Math, negateExact_name, int_int_signature, F_S) \ 782 do_intrinsic(_negateExactL, java_lang_Math, negateExact_name, long_long_signature, F_S) \ 783 do_intrinsic(_subtractExactI, java_lang_Math, subtractExact_name, int2_int_signature, F_S) \ 784 do_intrinsic(_subtractExactL, java_lang_Math, subtractExact_name, long2_long_signature, F_S) \ 785 \ 786 do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \ 787 do_name( floatToRawIntBits_name, "floatToRawIntBits") \ 788 do_intrinsic(_floatToIntBits, java_lang_Float, floatToIntBits_name, float_int_signature, F_S) \ 789 do_name( floatToIntBits_name, "floatToIntBits") \ 790 do_intrinsic(_intBitsToFloat, java_lang_Float, intBitsToFloat_name, int_float_signature, F_S) \ 791 do_name( intBitsToFloat_name, "intBitsToFloat") \ 792 do_intrinsic(_doubleToRawLongBits, java_lang_Double, doubleToRawLongBits_name, double_long_signature, F_S) \ 793 do_name( doubleToRawLongBits_name, "doubleToRawLongBits") \ 794 do_intrinsic(_doubleToLongBits, java_lang_Double, doubleToLongBits_name, double_long_signature, F_S) \ 795 do_name( doubleToLongBits_name, "doubleToLongBits") \ 796 do_intrinsic(_longBitsToDouble, java_lang_Double, longBitsToDouble_name, long_double_signature, F_S) \ 797 do_name( longBitsToDouble_name, "longBitsToDouble") \ 798 \ 799 do_intrinsic(_numberOfLeadingZeros_i, java_lang_Integer, numberOfLeadingZeros_name,int_int_signature, F_S) \ 800 do_intrinsic(_numberOfLeadingZeros_l, java_lang_Long, numberOfLeadingZeros_name,long_int_signature, F_S) \ 801 \ 802 do_intrinsic(_numberOfTrailingZeros_i, java_lang_Integer, numberOfTrailingZeros_name,int_int_signature, F_S) \ 803 do_intrinsic(_numberOfTrailingZeros_l, java_lang_Long, numberOfTrailingZeros_name,long_int_signature, F_S) \ 804 \ 805 do_intrinsic(_bitCount_i, java_lang_Integer, bitCount_name, int_int_signature, F_S) \ 806 do_intrinsic(_bitCount_l, java_lang_Long, bitCount_name, long_int_signature, F_S) \ 807 \ 808 do_intrinsic(_reverseBytes_i, java_lang_Integer, reverseBytes_name, int_int_signature, F_S) \ 809 do_name( reverseBytes_name, "reverseBytes") \ 810 do_intrinsic(_reverseBytes_l, java_lang_Long, reverseBytes_name, long_long_signature, F_S) \ 811 /* (symbol reverseBytes_name defined above) */ \ 812 do_intrinsic(_reverseBytes_c, java_lang_Character, reverseBytes_name, char_char_signature, F_S) \ 813 /* (symbol reverseBytes_name defined above) */ \ 814 do_intrinsic(_reverseBytes_s, java_lang_Short, reverseBytes_name, short_short_signature, F_S) \ 815 /* (symbol reverseBytes_name defined above) */ \ 816 \ 817 do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_S) \ 818 do_name( identityHashCode_name, "identityHashCode") \ 819 do_intrinsic(_currentTimeMillis, java_lang_System, currentTimeMillis_name, void_long_signature, F_S) \ 820 \ 821 do_name( currentTimeMillis_name, "currentTimeMillis") \ 822 do_intrinsic(_nanoTime, java_lang_System, nanoTime_name, void_long_signature, F_S) \ 823 do_name( nanoTime_name, "nanoTime") \ 824 \ 825 TRACE_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias) \ 826 \ 827 do_intrinsic(_arraycopy, java_lang_System, arraycopy_name, arraycopy_signature, F_S) \ 828 do_name( arraycopy_name, "arraycopy") \ 829 do_signature(arraycopy_signature, "(Ljava/lang/Object;ILjava/lang/Object;II)V") \ 830 do_intrinsic(_isInterrupted, java_lang_Thread, isInterrupted_name, isInterrupted_signature, F_R) \ 831 do_name( isInterrupted_name, "isInterrupted") \ 832 do_signature(isInterrupted_signature, "(Z)Z") \ 833 do_intrinsic(_currentThread, java_lang_Thread, currentThread_name, currentThread_signature, F_S) \ 834 do_name( currentThread_name, "currentThread") \ 835 do_signature(currentThread_signature, "()Ljava/lang/Thread;") \ 836 \ 837 /* reflective intrinsics, for java/lang/Class, etc. */ \ 838 do_intrinsic(_isAssignableFrom, java_lang_Class, isAssignableFrom_name, class_boolean_signature, F_RN) \ 839 do_name( isAssignableFrom_name, "isAssignableFrom") \ 840 do_intrinsic(_isInstance, java_lang_Class, isInstance_name, object_boolean_signature, F_RN) \ 841 do_name( isInstance_name, "isInstance") \ 842 do_intrinsic(_getModifiers, java_lang_Class, getModifiers_name, void_int_signature, F_RN) \ 843 do_name( getModifiers_name, "getModifiers") \ 844 do_intrinsic(_isInterface, java_lang_Class, isInterface_name, void_boolean_signature, F_RN) \ 845 do_name( isInterface_name, "isInterface") \ 846 do_intrinsic(_isArray, java_lang_Class, isArray_name, void_boolean_signature, F_RN) \ 847 do_name( isArray_name, "isArray") \ 848 do_intrinsic(_isPrimitive, java_lang_Class, isPrimitive_name, void_boolean_signature, F_RN) \ 849 do_name( isPrimitive_name, "isPrimitive") \ 850 do_intrinsic(_getSuperclass, java_lang_Class, getSuperclass_name, void_class_signature, F_RN) \ 851 do_name( getSuperclass_name, "getSuperclass") \ 852 do_intrinsic(_Class_cast, java_lang_Class, Class_cast_name, object_object_signature, F_R) \ 853 do_name( Class_cast_name, "cast") \ 854 \ 855 do_intrinsic(_getClassAccessFlags, sun_reflect_Reflection, getClassAccessFlags_name, class_int_signature, F_SN) \ 856 do_name( getClassAccessFlags_name, "getClassAccessFlags") \ 857 do_intrinsic(_getLength, java_lang_reflect_Array, getLength_name, object_int_signature, F_SN) \ 858 do_name( getLength_name, "getLength") \ 859 \ 860 do_intrinsic(_getCallerClass, sun_reflect_Reflection, getCallerClass_name, void_class_signature, F_SN) \ 861 do_name( getCallerClass_name, "getCallerClass") \ 862 \ 863 do_intrinsic(_newArray, java_lang_reflect_Array, newArray_name, newArray_signature, F_SN) \ 864 do_name( newArray_name, "newArray") \ 865 do_signature(newArray_signature, "(Ljava/lang/Class;I)Ljava/lang/Object;") \ 866 \ 867 do_intrinsic(_copyOf, java_util_Arrays, copyOf_name, copyOf_signature, F_S) \ 868 do_name( copyOf_name, "copyOf") \ 869 do_signature(copyOf_signature, "([Ljava/lang/Object;ILjava/lang/Class;)[Ljava/lang/Object;") \ 870 \ 871 do_intrinsic(_copyOfRange, java_util_Arrays, copyOfRange_name, copyOfRange_signature, F_S) \ 872 do_name( copyOfRange_name, "copyOfRange") \ 873 do_signature(copyOfRange_signature, "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;") \ 874 \ 875 do_intrinsic(_equalsC, java_util_Arrays, equals_name, equalsC_signature, F_S) \ 876 do_signature(equalsC_signature, "([C[C)Z") \ 877 do_intrinsic(_equalsB, java_util_Arrays, equals_name, equalsB_signature, F_S) \ 878 do_signature(equalsB_signature, "([B[B)Z") \ 879 \ 880 do_intrinsic(_compressStringC, java_lang_StringUTF16, compress_name, encodeISOArray_signature, F_S) \ 881 do_name( compress_name, "compress") \ 882 do_intrinsic(_compressStringB, java_lang_StringUTF16, compress_name, indexOfI_signature, F_S) \ 883 do_intrinsic(_inflateStringC, java_lang_StringLatin1, inflate_name, inflateC_signature, F_S) \ 884 do_name( inflate_name, "inflate") \ 885 do_signature(inflateC_signature, "([BI[CII)V") \ 886 do_intrinsic(_inflateStringB, java_lang_StringLatin1, inflate_name, inflateB_signature, F_S) \ 887 do_signature(inflateB_signature, "([BI[BII)V") \ 888 do_intrinsic(_toBytesStringU, java_lang_StringUTF16, toBytes_name, toBytesU_signature, F_S) \ 889 do_name( toBytes_name, "toBytes") \ 890 do_signature(toBytesU_signature, "([CII)[B") \ 891 do_intrinsic(_getCharsStringU, java_lang_StringUTF16, getCharsU_name, getCharsU_signature, F_S) \ 892 do_name( getCharsU_name, "getChars") \ 893 do_signature(getCharsU_signature, "([BII[CI)V") \ 894 do_intrinsic(_getCharStringU, java_lang_StringUTF16, getChar_name, getCharStringU_signature, F_S) \ 895 do_signature(getCharStringU_signature, "([BI)C") \ 896 do_intrinsic(_putCharStringU, java_lang_StringUTF16, putChar_name, putCharStringU_signature, F_S) \ 897 do_signature(putCharStringU_signature, "([BII)V") \ 898 do_intrinsic(_compareToL, java_lang_StringLatin1,compareTo_name, compareTo_indexOf_signature, F_S) \ 899 do_intrinsic(_compareToU, java_lang_StringUTF16, compareTo_name, compareTo_indexOf_signature, F_S) \ 900 do_intrinsic(_compareToLU, java_lang_StringLatin1,compareToLU_name, compareTo_indexOf_signature, F_S) \ 901 do_intrinsic(_compareToUL, java_lang_StringUTF16, compareToUL_name, compareTo_indexOf_signature, F_S) \ 902 do_signature(compareTo_indexOf_signature, "([B[B)I") \ 903 do_name( compareTo_name, "compareTo") \ 904 do_name( compareToLU_name, "compareToUTF16") \ 905 do_name( compareToUL_name, "compareToLatin1") \ 906 do_intrinsic(_indexOfL, java_lang_StringLatin1,indexOf_name, compareTo_indexOf_signature, F_S) \ 907 do_intrinsic(_indexOfU, java_lang_StringUTF16, indexOf_name, compareTo_indexOf_signature, F_S) \ 908 do_intrinsic(_indexOfUL, java_lang_StringUTF16, indexOfUL_name, compareTo_indexOf_signature, F_S) \ 909 do_intrinsic(_indexOfIL, java_lang_StringLatin1,indexOf_name, indexOfI_signature, F_S) \ 910 do_intrinsic(_indexOfIU, java_lang_StringUTF16, indexOf_name, indexOfI_signature, F_S) \ 911 do_intrinsic(_indexOfIUL, java_lang_StringUTF16, indexOfUL_name, indexOfI_signature, F_S) \ 912 do_intrinsic(_indexOfU_char, java_lang_StringUTF16, indexOfChar_name, indexOfChar_signature, F_S) \ 913 do_name( indexOf_name, "indexOf") \ 914 do_name( indexOfChar_name, "indexOfChar") \ 915 do_name( indexOfUL_name, "indexOfLatin1") \ 916 do_signature(indexOfI_signature, "([BI[BII)I") \ 917 do_signature(indexOfChar_signature, "([BIII)I") \ 918 do_intrinsic(_equalsL, java_lang_StringLatin1,equals_name, equalsB_signature, F_S) \ 919 do_intrinsic(_equalsU, java_lang_StringUTF16, equals_name, equalsB_signature, F_S) \ 920 \ 921 do_class(java_nio_Buffer, "java/nio/Buffer") \ 922 do_intrinsic(_checkIndex, java_nio_Buffer, checkIndex_name, int_int_signature, F_R) \ 923 do_name( checkIndex_name, "checkIndex") \ 924 \ 925 do_class(java_lang_StringCoding, "java/lang/StringCoding") \ 926 do_intrinsic(_hasNegatives, java_lang_StringCoding, hasNegatives_name, hasNegatives_signature, F_S) \ 927 do_name( hasNegatives_name, "hasNegatives") \ 928 do_signature(hasNegatives_signature, "([BII)Z") \ 929 \ 930 do_class(sun_nio_cs_iso8859_1_Encoder, "sun/nio/cs/ISO_8859_1$Encoder") \ 931 do_intrinsic(_encodeISOArray, sun_nio_cs_iso8859_1_Encoder, encodeISOArray_name, encodeISOArray_signature, F_S) \ 932 do_name( encodeISOArray_name, "implEncodeISOArray") \ 933 do_signature(encodeISOArray_signature, "([CI[BII)I") \ 934 \ 935 do_intrinsic(_encodeByteISOArray, java_lang_StringCoding, encodeISOArray_name, indexOfI_signature, F_S) \ 936 \ 937 do_class(java_math_BigInteger, "java/math/BigInteger") \ 938 do_intrinsic(_multiplyToLen, java_math_BigInteger, multiplyToLen_name, multiplyToLen_signature, F_S) \ 939 do_name( multiplyToLen_name, "implMultiplyToLen") \ 940 do_signature(multiplyToLen_signature, "([II[II[I)[I") \ 941 \ 942 do_intrinsic(_squareToLen, java_math_BigInteger, squareToLen_name, squareToLen_signature, F_S) \ 943 do_name( squareToLen_name, "implSquareToLen") \ 944 do_signature(squareToLen_signature, "([II[II)[I") \ 945 \ 946 do_intrinsic(_mulAdd, java_math_BigInteger, mulAdd_name, mulAdd_signature, F_S) \ 947 do_name( mulAdd_name, "implMulAdd") \ 948 do_signature(mulAdd_signature, "([I[IIII)I") \ 949 \ 950 do_intrinsic(_montgomeryMultiply, java_math_BigInteger, montgomeryMultiply_name, montgomeryMultiply_signature, F_S) \ 951 do_name( montgomeryMultiply_name, "implMontgomeryMultiply") \ 952 do_signature(montgomeryMultiply_signature, "([I[I[IIJ[I)[I") \ 953 \ 954 do_intrinsic(_montgomerySquare, java_math_BigInteger, montgomerySquare_name, montgomerySquare_signature, F_S) \ 955 do_name( montgomerySquare_name, "implMontgomerySquare") \ 956 do_signature(montgomerySquare_signature, "([I[IIJ[I)[I") \ 957 \ 958 /* java/lang/ref/Reference */ \ 959 do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \ 960 \ 961 /* support for com.sun.crypto.provider.AESCrypt and some of its callers */ \ 962 do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \ 963 do_intrinsic(_aescrypt_encryptBlock, com_sun_crypto_provider_aescrypt, encryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \ 964 do_intrinsic(_aescrypt_decryptBlock, com_sun_crypto_provider_aescrypt, decryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \ 965 do_name( encryptBlock_name, "implEncryptBlock") \ 966 do_name( decryptBlock_name, "implDecryptBlock") \ 967 do_signature(byteArray_int_byteArray_int_signature, "([BI[BI)V") \ 968 \ 969 do_class(com_sun_crypto_provider_cipherBlockChaining, "com/sun/crypto/provider/CipherBlockChaining") \ 970 do_intrinsic(_cipherBlockChaining_encryptAESCrypt, com_sun_crypto_provider_cipherBlockChaining, encrypt_name, byteArray_int_int_byteArray_int_signature, F_R) \ 971 do_intrinsic(_cipherBlockChaining_decryptAESCrypt, com_sun_crypto_provider_cipherBlockChaining, decrypt_name, byteArray_int_int_byteArray_int_signature, F_R) \ 972 do_name( encrypt_name, "implEncrypt") \ 973 do_name( decrypt_name, "implDecrypt") \ 974 do_signature(byteArray_int_int_byteArray_int_signature, "([BII[BI)I") \ 975 \ 976 /* support for sun.security.provider.SHA */ \ 977 do_class(sun_security_provider_sha, "sun/security/provider/SHA") \ 978 do_intrinsic(_sha_implCompress, sun_security_provider_sha, implCompress_name, implCompress_signature, F_R) \ 979 do_name( implCompress_name, "implCompress0") \ 980 do_signature(implCompress_signature, "([BI)V") \ 981 \ 982 /* support for sun.security.provider.SHA2 */ \ 983 do_class(sun_security_provider_sha2, "sun/security/provider/SHA2") \ 984 do_intrinsic(_sha2_implCompress, sun_security_provider_sha2, implCompress_name, implCompress_signature, F_R) \ 985 \ 986 /* support for sun.security.provider.SHA5 */ \ 987 do_class(sun_security_provider_sha5, "sun/security/provider/SHA5") \ 988 do_intrinsic(_sha5_implCompress, sun_security_provider_sha5, implCompress_name, implCompress_signature, F_R) \ 989 \ 990 /* support for sun.security.provider.DigestBase */ \ 991 do_class(sun_security_provider_digestbase, "sun/security/provider/DigestBase") \ 992 do_intrinsic(_digestBase_implCompressMB, sun_security_provider_digestbase, implCompressMB_name, implCompressMB_signature, F_R) \ 993 do_name( implCompressMB_name, "implCompressMultiBlock0") \ 994 do_signature(implCompressMB_signature, "([BII)I") \ 995 \ 996 /* support for com.sun.crypto.provider.GHASH */ \ 997 do_class(com_sun_crypto_provider_ghash, "com/sun/crypto/provider/GHASH") \ 998 do_intrinsic(_ghash_processBlocks, com_sun_crypto_provider_ghash, processBlocks_name, ghash_processBlocks_signature, F_S) \ 999 do_name(processBlocks_name, "processBlocks") \ 1000 do_signature(ghash_processBlocks_signature, "([BII[J[J)V") \ 1001 \ 1002 /* support for java.util.zip */ \ 1003 do_class(java_util_zip_CRC32, "java/util/zip/CRC32") \ 1004 do_intrinsic(_updateCRC32, java_util_zip_CRC32, update_name, int2_int_signature, F_SN) \ 1005 do_name( update_name, "update") \ 1006 do_intrinsic(_updateBytesCRC32, java_util_zip_CRC32, updateBytes_name, updateBytes_signature, F_SN) \ 1007 do_name( updateBytes_name, "updateBytes0") \ 1008 do_signature(updateBytes_signature, "(I[BII)I") \ 1009 do_intrinsic(_updateByteBufferCRC32, java_util_zip_CRC32, updateByteBuffer_name, updateByteBuffer_signature, F_SN) \ 1010 do_name( updateByteBuffer_name, "updateByteBuffer0") \ 1011 do_signature(updateByteBuffer_signature, "(IJII)I") \ 1012 \ 1013 /* support for java.util.zip.CRC32C */ \ 1014 do_class(java_util_zip_CRC32C, "java/util/zip/CRC32C") \ 1015 do_intrinsic(_updateBytesCRC32C, java_util_zip_CRC32C, updateBytes_C_name, updateBytes_signature, F_S) \ 1016 do_name( updateBytes_C_name, "updateBytes") \ 1017 do_intrinsic(_updateDirectByteBufferCRC32C, java_util_zip_CRC32C, updateDirectByteBuffer_C_name, updateByteBuffer_signature, F_S) \ 1018 do_name( updateDirectByteBuffer_C_name, "updateDirectByteBuffer") \ 1019 \ 1020 /* support for java.util.zip.Adler32 */ \ 1021 do_class(java_util_zip_Adler32, "java/util/zip/Adler32") \ 1022 do_intrinsic(_updateBytesAdler32, java_util_zip_Adler32, updateBytes_C_name, updateBytes_signature, F_SN) \ 1023 do_intrinsic(_updateByteBufferAdler32, java_util_zip_Adler32, updateByteBuffer_A_name, updateByteBuffer_signature, F_SN) \ 1024 do_name( updateByteBuffer_A_name, "updateByteBuffer") \ 1025 \ 1026 /* support for Unsafe */ \ 1027 do_class(sun_misc_Unsafe, "sun/misc/Unsafe") \ 1028 do_class(jdk_internal_misc_Unsafe, "jdk/internal/misc/Unsafe") \ 1029 \ 1030 do_intrinsic(_allocateInstance, jdk_internal_misc_Unsafe, allocateInstance_name, allocateInstance_signature, F_RN) \ 1031 do_name( allocateInstance_name, "allocateInstance") \ 1032 do_signature(allocateInstance_signature, "(Ljava/lang/Class;)Ljava/lang/Object;") \ 1033 do_intrinsic(_copyMemory, jdk_internal_misc_Unsafe, copyMemory_name, copyMemory_signature, F_RN) \ 1034 do_name( copyMemory_name, "copyMemory") \ 1035 do_signature(copyMemory_signature, "(Ljava/lang/Object;JLjava/lang/Object;JJ)V") \ 1036 do_intrinsic(_loadFence, jdk_internal_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \ 1037 do_name( loadFence_name, "loadFence") \ 1038 do_alias( loadFence_signature, void_method_signature) \ 1039 do_intrinsic(_storeFence, jdk_internal_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \ 1040 do_name( storeFence_name, "storeFence") \ 1041 do_alias( storeFence_signature, void_method_signature) \ 1042 do_intrinsic(_fullFence, jdk_internal_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \ 1043 do_name( fullFence_name, "fullFence") \ 1044 do_alias( fullFence_signature, void_method_signature) \ 1045 \ 1046 /* Custom branch frequencies profiling support for JSR292 */ \ 1047 do_class(java_lang_invoke_MethodHandleImpl, "java/lang/invoke/MethodHandleImpl") \ 1048 do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S) \ 1049 do_name( profileBoolean_name, "profileBoolean") \ 1050 do_signature(profileBoolean_signature, "(Z[I)Z") \ 1051 do_intrinsic(_isCompileConstant, java_lang_invoke_MethodHandleImpl, isCompileConstant_name, isCompileConstant_signature, F_S) \ 1052 do_name( isCompileConstant_name, "isCompileConstant") \ 1053 do_alias( isCompileConstant_signature, object_boolean_signature) \ 1054 \ 1055 /* unsafe memory references (there are a lot of them...) */ \ 1056 do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \ 1057 do_signature(putObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \ 1058 do_signature(getBoolean_signature, "(Ljava/lang/Object;J)Z") \ 1059 do_signature(putBoolean_signature, "(Ljava/lang/Object;JZ)V") \ 1060 do_signature(getByte_signature, "(Ljava/lang/Object;J)B") \ 1061 do_signature(putByte_signature, "(Ljava/lang/Object;JB)V") \ 1062 do_signature(getShort_signature, "(Ljava/lang/Object;J)S") \ 1063 do_signature(putShort_signature, "(Ljava/lang/Object;JS)V") \ 1064 do_signature(getChar_signature, "(Ljava/lang/Object;J)C") \ 1065 do_signature(putChar_signature, "(Ljava/lang/Object;JC)V") \ 1066 do_signature(getInt_signature, "(Ljava/lang/Object;J)I") \ 1067 do_signature(putInt_signature, "(Ljava/lang/Object;JI)V") \ 1068 do_signature(getLong_signature, "(Ljava/lang/Object;J)J") \ 1069 do_signature(putLong_signature, "(Ljava/lang/Object;JJ)V") \ 1070 do_signature(getFloat_signature, "(Ljava/lang/Object;J)F") \ 1071 do_signature(putFloat_signature, "(Ljava/lang/Object;JF)V") \ 1072 do_signature(getDouble_signature, "(Ljava/lang/Object;J)D") \ 1073 do_signature(putDouble_signature, "(Ljava/lang/Object;JD)V") \ 1074 \ 1075 do_name(getObject_name,"getObject") do_name(putObject_name,"putObject") \ 1076 do_name(getBoolean_name,"getBoolean") do_name(putBoolean_name,"putBoolean") \ 1077 do_name(getByte_name,"getByte") do_name(putByte_name,"putByte") \ 1078 do_name(getShort_name,"getShort") do_name(putShort_name,"putShort") \ 1079 do_name(getChar_name,"getChar") do_name(putChar_name,"putChar") \ 1080 do_name(getInt_name,"getInt") do_name(putInt_name,"putInt") \ 1081 do_name(getLong_name,"getLong") do_name(putLong_name,"putLong") \ 1082 do_name(getFloat_name,"getFloat") do_name(putFloat_name,"putFloat") \ 1083 do_name(getDouble_name,"getDouble") do_name(putDouble_name,"putDouble") \ 1084 \ 1085 do_intrinsic(_getObject, jdk_internal_misc_Unsafe, getObject_name, getObject_signature, F_RN) \ 1086 do_intrinsic(_getBoolean, jdk_internal_misc_Unsafe, getBoolean_name, getBoolean_signature, F_RN) \ 1087 do_intrinsic(_getByte, jdk_internal_misc_Unsafe, getByte_name, getByte_signature, F_RN) \ 1088 do_intrinsic(_getShort, jdk_internal_misc_Unsafe, getShort_name, getShort_signature, F_RN) \ 1089 do_intrinsic(_getChar, jdk_internal_misc_Unsafe, getChar_name, getChar_signature, F_RN) \ 1090 do_intrinsic(_getInt, jdk_internal_misc_Unsafe, getInt_name, getInt_signature, F_RN) \ 1091 do_intrinsic(_getLong, jdk_internal_misc_Unsafe, getLong_name, getLong_signature, F_RN) \ 1092 do_intrinsic(_getFloat, jdk_internal_misc_Unsafe, getFloat_name, getFloat_signature, F_RN) \ 1093 do_intrinsic(_getDouble, jdk_internal_misc_Unsafe, getDouble_name, getDouble_signature, F_RN) \ 1094 do_intrinsic(_putObject, jdk_internal_misc_Unsafe, putObject_name, putObject_signature, F_RN) \ 1095 do_intrinsic(_putBoolean, jdk_internal_misc_Unsafe, putBoolean_name, putBoolean_signature, F_RN) \ 1096 do_intrinsic(_putByte, jdk_internal_misc_Unsafe, putByte_name, putByte_signature, F_RN) \ 1097 do_intrinsic(_putShort, jdk_internal_misc_Unsafe, putShort_name, putShort_signature, F_RN) \ 1098 do_intrinsic(_putChar, jdk_internal_misc_Unsafe, putChar_name, putChar_signature, F_RN) \ 1099 do_intrinsic(_putInt, jdk_internal_misc_Unsafe, putInt_name, putInt_signature, F_RN) \ 1100 do_intrinsic(_putLong, jdk_internal_misc_Unsafe, putLong_name, putLong_signature, F_RN) \ 1101 do_intrinsic(_putFloat, jdk_internal_misc_Unsafe, putFloat_name, putFloat_signature, F_RN) \ 1102 do_intrinsic(_putDouble, jdk_internal_misc_Unsafe, putDouble_name, putDouble_signature, F_RN) \ 1103 \ 1104 do_name(getObjectVolatile_name,"getObjectVolatile") do_name(putObjectVolatile_name,"putObjectVolatile") \ 1105 do_name(getBooleanVolatile_name,"getBooleanVolatile") do_name(putBooleanVolatile_name,"putBooleanVolatile") \ 1106 do_name(getByteVolatile_name,"getByteVolatile") do_name(putByteVolatile_name,"putByteVolatile") \ 1107 do_name(getShortVolatile_name,"getShortVolatile") do_name(putShortVolatile_name,"putShortVolatile") \ 1108 do_name(getCharVolatile_name,"getCharVolatile") do_name(putCharVolatile_name,"putCharVolatile") \ 1109 do_name(getIntVolatile_name,"getIntVolatile") do_name(putIntVolatile_name,"putIntVolatile") \ 1110 do_name(getLongVolatile_name,"getLongVolatile") do_name(putLongVolatile_name,"putLongVolatile") \ 1111 do_name(getFloatVolatile_name,"getFloatVolatile") do_name(putFloatVolatile_name,"putFloatVolatile") \ 1112 do_name(getDoubleVolatile_name,"getDoubleVolatile") do_name(putDoubleVolatile_name,"putDoubleVolatile") \ 1113 \ 1114 do_intrinsic(_getObjectVolatile, jdk_internal_misc_Unsafe, getObjectVolatile_name, getObject_signature, F_RN) \ 1115 do_intrinsic(_getBooleanVolatile, jdk_internal_misc_Unsafe, getBooleanVolatile_name, getBoolean_signature, F_RN) \ 1116 do_intrinsic(_getByteVolatile, jdk_internal_misc_Unsafe, getByteVolatile_name, getByte_signature, F_RN) \ 1117 do_intrinsic(_getShortVolatile, jdk_internal_misc_Unsafe, getShortVolatile_name, getShort_signature, F_RN) \ 1118 do_intrinsic(_getCharVolatile, jdk_internal_misc_Unsafe, getCharVolatile_name, getChar_signature, F_RN) \ 1119 do_intrinsic(_getIntVolatile, jdk_internal_misc_Unsafe, getIntVolatile_name, getInt_signature, F_RN) \ 1120 do_intrinsic(_getLongVolatile, jdk_internal_misc_Unsafe, getLongVolatile_name, getLong_signature, F_RN) \ 1121 do_intrinsic(_getFloatVolatile, jdk_internal_misc_Unsafe, getFloatVolatile_name, getFloat_signature, F_RN) \ 1122 do_intrinsic(_getDoubleVolatile, jdk_internal_misc_Unsafe, getDoubleVolatile_name, getDouble_signature, F_RN) \ 1123 do_intrinsic(_putObjectVolatile, jdk_internal_misc_Unsafe, putObjectVolatile_name, putObject_signature, F_RN) \ 1124 do_intrinsic(_putBooleanVolatile, jdk_internal_misc_Unsafe, putBooleanVolatile_name, putBoolean_signature, F_RN) \ 1125 do_intrinsic(_putByteVolatile, jdk_internal_misc_Unsafe, putByteVolatile_name, putByte_signature, F_RN) \ 1126 do_intrinsic(_putShortVolatile, jdk_internal_misc_Unsafe, putShortVolatile_name, putShort_signature, F_RN) \ 1127 do_intrinsic(_putCharVolatile, jdk_internal_misc_Unsafe, putCharVolatile_name, putChar_signature, F_RN) \ 1128 do_intrinsic(_putIntVolatile, jdk_internal_misc_Unsafe, putIntVolatile_name, putInt_signature, F_RN) \ 1129 do_intrinsic(_putLongVolatile, jdk_internal_misc_Unsafe, putLongVolatile_name, putLong_signature, F_RN) \ 1130 do_intrinsic(_putFloatVolatile, jdk_internal_misc_Unsafe, putFloatVolatile_name, putFloat_signature, F_RN) \ 1131 do_intrinsic(_putDoubleVolatile, jdk_internal_misc_Unsafe, putDoubleVolatile_name, putDouble_signature, F_RN) \ 1132 \ 1133 do_name(getShortUnaligned_name,"getShortUnaligned") do_name(putShortUnaligned_name,"putShortUnaligned") \ 1134 do_name(getCharUnaligned_name,"getCharUnaligned") do_name(putCharUnaligned_name,"putCharUnaligned") \ 1135 do_name(getIntUnaligned_name,"getIntUnaligned") do_name(putIntUnaligned_name,"putIntUnaligned") \ 1136 do_name(getLongUnaligned_name,"getLongUnaligned") do_name(putLongUnaligned_name,"putLongUnaligned") \ 1137 \ 1138 do_intrinsic(_getShortUnaligned, jdk_internal_misc_Unsafe, getShortUnaligned_name, getShort_signature, F_R) \ 1139 do_intrinsic(_getCharUnaligned, jdk_internal_misc_Unsafe, getCharUnaligned_name, getChar_signature, F_R) \ 1140 do_intrinsic(_getIntUnaligned, jdk_internal_misc_Unsafe, getIntUnaligned_name, getInt_signature, F_R) \ 1141 do_intrinsic(_getLongUnaligned, jdk_internal_misc_Unsafe, getLongUnaligned_name, getLong_signature, F_R) \ 1142 do_intrinsic(_putShortUnaligned, jdk_internal_misc_Unsafe, putShortUnaligned_name, putShort_signature, F_R) \ 1143 do_intrinsic(_putCharUnaligned, jdk_internal_misc_Unsafe, putCharUnaligned_name, putChar_signature, F_R) \ 1144 do_intrinsic(_putIntUnaligned, jdk_internal_misc_Unsafe, putIntUnaligned_name, putInt_signature, F_R) \ 1145 do_intrinsic(_putLongUnaligned, jdk_internal_misc_Unsafe, putLongUnaligned_name, putLong_signature, F_R) \ 1146 \ 1147 /* %%% these are redundant except perhaps for getAddress, but Unsafe has native methods for them */ \ 1148 do_signature(getByte_raw_signature, "(J)B") \ 1149 do_signature(putByte_raw_signature, "(JB)V") \ 1150 do_signature(getShort_raw_signature, "(J)S") \ 1151 do_signature(putShort_raw_signature, "(JS)V") \ 1152 do_signature(getChar_raw_signature, "(J)C") \ 1153 do_signature(putChar_raw_signature, "(JC)V") \ 1154 do_signature(putInt_raw_signature, "(JI)V") \ 1155 do_alias(getLong_raw_signature, /*(J)J*/ long_long_signature) \ 1156 do_alias(putLong_raw_signature, /*(JJ)V*/ long_long_void_signature) \ 1157 do_signature(getFloat_raw_signature, "(J)F") \ 1158 do_signature(putFloat_raw_signature, "(JF)V") \ 1159 do_alias(getDouble_raw_signature, /*(J)D*/ long_double_signature) \ 1160 do_signature(putDouble_raw_signature, "(JD)V") \ 1161 do_alias(getAddress_raw_signature, /*(J)J*/ long_long_signature) \ 1162 do_alias(putAddress_raw_signature, /*(JJ)V*/ long_long_void_signature) \ 1163 \ 1164 do_name( getAddress_name, "getAddress") \ 1165 do_name( putAddress_name, "putAddress") \ 1166 \ 1167 do_intrinsic(_getByte_raw, jdk_internal_misc_Unsafe, getByte_name, getByte_raw_signature, F_R) \ 1168 do_intrinsic(_getShort_raw, jdk_internal_misc_Unsafe, getShort_name, getShort_raw_signature, F_R) \ 1169 do_intrinsic(_getChar_raw, jdk_internal_misc_Unsafe, getChar_name, getChar_raw_signature, F_R) \ 1170 do_intrinsic(_getInt_raw, jdk_internal_misc_Unsafe, getInt_name, long_int_signature, F_R) \ 1171 do_intrinsic(_getLong_raw, jdk_internal_misc_Unsafe, getLong_name, getLong_raw_signature, F_R) \ 1172 do_intrinsic(_getFloat_raw, jdk_internal_misc_Unsafe, getFloat_name, getFloat_raw_signature, F_R) \ 1173 do_intrinsic(_getDouble_raw, jdk_internal_misc_Unsafe, getDouble_name, getDouble_raw_signature, F_R) \ 1174 do_intrinsic(_getAddress_raw, jdk_internal_misc_Unsafe, getAddress_name, getAddress_raw_signature, F_R) \ 1175 do_intrinsic(_putByte_raw, jdk_internal_misc_Unsafe, putByte_name, putByte_raw_signature, F_R) \ 1176 do_intrinsic(_putShort_raw, jdk_internal_misc_Unsafe, putShort_name, putShort_raw_signature, F_R) \ 1177 do_intrinsic(_putChar_raw, jdk_internal_misc_Unsafe, putChar_name, putChar_raw_signature, F_R) \ 1178 do_intrinsic(_putInt_raw, jdk_internal_misc_Unsafe, putInt_name, putInt_raw_signature, F_R) \ 1179 do_intrinsic(_putLong_raw, jdk_internal_misc_Unsafe, putLong_name, putLong_raw_signature, F_R) \ 1180 do_intrinsic(_putFloat_raw, jdk_internal_misc_Unsafe, putFloat_name, putFloat_raw_signature, F_R) \ 1181 do_intrinsic(_putDouble_raw, jdk_internal_misc_Unsafe, putDouble_name, putDouble_raw_signature, F_R) \ 1182 do_intrinsic(_putAddress_raw, jdk_internal_misc_Unsafe, putAddress_name, putAddress_raw_signature, F_R) \ 1183 \ 1184 do_intrinsic(_compareAndSwapObject, jdk_internal_misc_Unsafe, compareAndSwapObject_name, compareAndSwapObject_signature, F_R) \ 1185 do_name( compareAndSwapObject_name, "compareAndSwapObject") \ 1186 do_signature(compareAndSwapObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z") \ 1187 do_intrinsic(_compareAndSwapLong, jdk_internal_misc_Unsafe, compareAndSwapLong_name, compareAndSwapLong_signature, F_R) \ 1188 do_name( compareAndSwapLong_name, "compareAndSwapLong") \ 1189 do_signature(compareAndSwapLong_signature, "(Ljava/lang/Object;JJJ)Z") \ 1190 do_intrinsic(_compareAndSwapInt, jdk_internal_misc_Unsafe, compareAndSwapInt_name, compareAndSwapInt_signature, F_R) \ 1191 do_name( compareAndSwapInt_name, "compareAndSwapInt") \ 1192 do_signature(compareAndSwapInt_signature, "(Ljava/lang/Object;JII)Z") \ 1193 do_intrinsic(_putOrderedObject, jdk_internal_misc_Unsafe, putOrderedObject_name, putOrderedObject_signature, F_R) \ 1194 do_name( putOrderedObject_name, "putOrderedObject") \ 1195 do_alias( putOrderedObject_signature, /*(LObject;JLObject;)V*/ putObject_signature) \ 1196 do_intrinsic(_putOrderedLong, jdk_internal_misc_Unsafe, putOrderedLong_name, putOrderedLong_signature, F_R) \ 1197 do_name( putOrderedLong_name, "putOrderedLong") \ 1198 do_alias( putOrderedLong_signature, /*(Ljava/lang/Object;JJ)V*/ putLong_signature) \ 1199 do_intrinsic(_putOrderedInt, jdk_internal_misc_Unsafe, putOrderedInt_name, putOrderedInt_signature, F_R) \ 1200 do_name( putOrderedInt_name, "putOrderedInt") \ 1201 do_alias( putOrderedInt_signature, /*(Ljava/lang/Object;JI)V*/ putInt_signature) \ 1202 \ 1203 do_intrinsic(_getAndAddInt, jdk_internal_misc_Unsafe, getAndAddInt_name, getAndAddInt_signature, F_R) \ 1204 do_name( getAndAddInt_name, "getAndAddInt") \ 1205 do_signature(getAndAddInt_signature, "(Ljava/lang/Object;JI)I" ) \ 1206 do_intrinsic(_getAndAddLong, jdk_internal_misc_Unsafe, getAndAddLong_name, getAndAddLong_signature, F_R) \ 1207 do_name( getAndAddLong_name, "getAndAddLong") \ 1208 do_signature(getAndAddLong_signature, "(Ljava/lang/Object;JJ)J" ) \ 1209 do_intrinsic(_getAndSetInt, jdk_internal_misc_Unsafe, getAndSetInt_name, getAndSetInt_signature, F_R) \ 1210 do_name( getAndSetInt_name, "getAndSetInt") \ 1211 do_alias( getAndSetInt_signature, /*"(Ljava/lang/Object;JI)I"*/ getAndAddInt_signature) \ 1212 do_intrinsic(_getAndSetLong, jdk_internal_misc_Unsafe, getAndSetLong_name, getAndSetLong_signature, F_R) \ 1213 do_name( getAndSetLong_name, "getAndSetLong") \ 1214 do_alias( getAndSetLong_signature, /*"(Ljava/lang/Object;JJ)J"*/ getAndAddLong_signature) \ 1215 do_intrinsic(_getAndSetObject, jdk_internal_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\ 1216 do_name( getAndSetObject_name, "getAndSetObject") \ 1217 do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \ 1218 \ 1219 /* (2) Bytecode intrinsics */ \ 1220 \ 1221 do_intrinsic(_park, jdk_internal_misc_Unsafe, park_name, park_signature, F_R) \ 1222 do_name( park_name, "park") \ 1223 do_signature(park_signature, "(ZJ)V") \ 1224 do_intrinsic(_unpark, jdk_internal_misc_Unsafe, unpark_name, unpark_signature, F_R) \ 1225 do_name( unpark_name, "unpark") \ 1226 do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \ 1227 \ 1228 do_intrinsic(_StringBuilder_void, java_lang_StringBuilder, object_initializer_name, void_method_signature, F_R) \ 1229 do_intrinsic(_StringBuilder_int, java_lang_StringBuilder, object_initializer_name, int_void_signature, F_R) \ 1230 do_intrinsic(_StringBuilder_String, java_lang_StringBuilder, object_initializer_name, string_void_signature, F_R) \ 1231 \ 1232 do_intrinsic(_StringBuilder_append_char, java_lang_StringBuilder, append_name, char_StringBuilder_signature, F_R) \ 1233 do_intrinsic(_StringBuilder_append_int, java_lang_StringBuilder, append_name, int_StringBuilder_signature, F_R) \ 1234 do_intrinsic(_StringBuilder_append_String, java_lang_StringBuilder, append_name, String_StringBuilder_signature, F_R) \ 1235 \ 1236 do_intrinsic(_StringBuilder_toString, java_lang_StringBuilder, toString_name, void_string_signature, F_R) \ 1237 \ 1238 do_intrinsic(_StringBuffer_void, java_lang_StringBuffer, object_initializer_name, void_method_signature, F_R) \ 1239 do_intrinsic(_StringBuffer_int, java_lang_StringBuffer, object_initializer_name, int_void_signature, F_R) \ 1240 do_intrinsic(_StringBuffer_String, java_lang_StringBuffer, object_initializer_name, string_void_signature, F_R) \ 1241 \ 1242 do_intrinsic(_StringBuffer_append_char, java_lang_StringBuffer, append_name, char_StringBuffer_signature, F_Y) \ 1243 do_intrinsic(_StringBuffer_append_int, java_lang_StringBuffer, append_name, int_StringBuffer_signature, F_Y) \ 1244 do_intrinsic(_StringBuffer_append_String, java_lang_StringBuffer, append_name, String_StringBuffer_signature, F_Y) \ 1245 \ 1246 do_intrinsic(_StringBuffer_toString, java_lang_StringBuffer, toString_name, void_string_signature, F_Y) \ 1247 \ 1248 do_intrinsic(_Integer_toString, java_lang_Integer, toString_name, int_String_signature, F_S) \ 1249 \ 1250 do_intrinsic(_String_String, java_lang_String, object_initializer_name, string_void_signature, F_R) \ 1251 \ 1252 do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \ 1253 /* (symbol object_initializer_name defined above) */ \ 1254 \ 1255 do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_object_array_object_signature, F_R) \ 1256 /* (symbols invoke_name and invoke_signature defined above) */ \ 1257 /* the polymorphic MH intrinsics must be in compact order, with _invokeGeneric first and _linkToInterface last */ \ 1258 do_intrinsic(_invokeGeneric, java_lang_invoke_MethodHandle, invoke_name, star_name, F_RN) \ 1259 do_intrinsic(_invokeBasic, java_lang_invoke_MethodHandle, invokeBasic_name, star_name, F_RN) \ 1260 do_intrinsic(_linkToVirtual, java_lang_invoke_MethodHandle, linkToVirtual_name, star_name, F_SN) \ 1261 do_intrinsic(_linkToStatic, java_lang_invoke_MethodHandle, linkToStatic_name, star_name, F_SN) \ 1262 do_intrinsic(_linkToSpecial, java_lang_invoke_MethodHandle, linkToSpecial_name, star_name, F_SN) \ 1263 do_intrinsic(_linkToInterface, java_lang_invoke_MethodHandle, linkToInterface_name, star_name, F_SN) \ 1264 /* special marker for bytecode generated for the JVM from a LambdaForm: */ \ 1265 do_intrinsic(_compiledLambdaForm, java_lang_invoke_MethodHandle, compiledLambdaForm_name, star_name, F_RN) \ 1266 \ 1267 /* unboxing methods: */ \ 1268 do_intrinsic(_booleanValue, java_lang_Boolean, booleanValue_name, void_boolean_signature, F_R) \ 1269 do_name( booleanValue_name, "booleanValue") \ 1270 do_intrinsic(_byteValue, java_lang_Byte, byteValue_name, void_byte_signature, F_R) \ 1271 do_name( byteValue_name, "byteValue") \ 1272 do_intrinsic(_charValue, java_lang_Character, charValue_name, void_char_signature, F_R) \ 1273 do_name( charValue_name, "charValue") \ 1274 do_intrinsic(_shortValue, java_lang_Short, shortValue_name, void_short_signature, F_R) \ 1275 do_name( shortValue_name, "shortValue") \ 1276 do_intrinsic(_intValue, java_lang_Integer, intValue_name, void_int_signature, F_R) \ 1277 do_name( intValue_name, "intValue") \ 1278 do_intrinsic(_longValue, java_lang_Long, longValue_name, void_long_signature, F_R) \ 1279 do_name( longValue_name, "longValue") \ 1280 do_intrinsic(_floatValue, java_lang_Float, floatValue_name, void_float_signature, F_R) \ 1281 do_name( floatValue_name, "floatValue") \ 1282 do_intrinsic(_doubleValue, java_lang_Double, doubleValue_name, void_double_signature, F_R) \ 1283 do_name( doubleValue_name, "doubleValue") \ 1284 \ 1285 /* boxing methods: */ \ 1286 do_name( valueOf_name, "valueOf") \ 1287 do_intrinsic(_Boolean_valueOf, java_lang_Boolean, valueOf_name, Boolean_valueOf_signature, F_S) \ 1288 do_name( Boolean_valueOf_signature, "(Z)Ljava/lang/Boolean;") \ 1289 do_intrinsic(_Byte_valueOf, java_lang_Byte, valueOf_name, Byte_valueOf_signature, F_S) \ 1290 do_name( Byte_valueOf_signature, "(B)Ljava/lang/Byte;") \ 1291 do_intrinsic(_Character_valueOf, java_lang_Character, valueOf_name, Character_valueOf_signature, F_S) \ 1292 do_name( Character_valueOf_signature, "(C)Ljava/lang/Character;") \ 1293 do_intrinsic(_Short_valueOf, java_lang_Short, valueOf_name, Short_valueOf_signature, F_S) \ 1294 do_name( Short_valueOf_signature, "(S)Ljava/lang/Short;") \ 1295 do_intrinsic(_Integer_valueOf, java_lang_Integer, valueOf_name, Integer_valueOf_signature, F_S) \ 1296 do_name( Integer_valueOf_signature, "(I)Ljava/lang/Integer;") \ 1297 do_intrinsic(_Long_valueOf, java_lang_Long, valueOf_name, Long_valueOf_signature, F_S) \ 1298 do_name( Long_valueOf_signature, "(J)Ljava/lang/Long;") \ 1299 do_intrinsic(_Float_valueOf, java_lang_Float, valueOf_name, Float_valueOf_signature, F_S) \ 1300 do_name( Float_valueOf_signature, "(F)Ljava/lang/Float;") \ 1301 do_intrinsic(_Double_valueOf, java_lang_Double, valueOf_name, Double_valueOf_signature, F_S) \ 1302 do_name( Double_valueOf_signature, "(D)Ljava/lang/Double;") \ 1303 \ 1304 /* forEachRemaining */ \ 1305 do_intrinsic(_forEachRemaining, java_util_stream_StreamsRangeIntSpliterator, forEachRemaining_name, forEachRemaining_signature, F_R) \ 1306 do_name( forEachRemaining_name, "forEachRemaining") \ 1307 do_name( forEachRemaining_signature, "(Ljava/util/function/IntConsumer;)V") \ 1308 1309 /*end*/ 1310 1311 1312 1313 1314 // Class vmSymbols 1315 1316 class vmSymbols: AllStatic { 1317 friend class vmIntrinsics; 1318 friend class VMStructs; 1319 public: 1320 // enum for figuring positions and size of array holding Symbol*s 1321 enum SID { 1322 NO_SID = 0, 1323 1324 #define VM_SYMBOL_ENUM(name, string) VM_SYMBOL_ENUM_NAME(name), 1325 VM_SYMBOLS_DO(VM_SYMBOL_ENUM, VM_ALIAS_IGNORE) 1326 #undef VM_SYMBOL_ENUM 1327 1328 SID_LIMIT, 1329 1330 #define VM_ALIAS_ENUM(name, def) VM_SYMBOL_ENUM_NAME(name) = VM_SYMBOL_ENUM_NAME(def), 1331 VM_SYMBOLS_DO(VM_SYMBOL_IGNORE, VM_ALIAS_ENUM) 1332 #undef VM_ALIAS_ENUM 1333 1334 FIRST_SID = NO_SID + 1 1335 }; 1336 enum { 1337 log2_SID_LIMIT = 10 // checked by an assert at start-up 1338 }; 1339 1340 private: 1341 // The symbol array 1342 static Symbol* _symbols[]; 1343 1344 // Field signatures indexed by BasicType. 1345 static Symbol* _type_signatures[T_VOID+1]; 1346 1347 public: 1348 // Initialization 1349 static void initialize(TRAPS); 1350 // Accessing 1351 #define VM_SYMBOL_DECLARE(name, ignore) \ 1352 static Symbol* name() { \ 1353 return _symbols[VM_SYMBOL_ENUM_NAME(name)]; \ 1354 } 1355 VM_SYMBOLS_DO(VM_SYMBOL_DECLARE, VM_SYMBOL_DECLARE) 1356 #undef VM_SYMBOL_DECLARE 1357 1358 // Sharing support 1359 static void symbols_do(SymbolClosure* f); 1360 static void serialize(SerializeClosure* soc); 1361 1362 static Symbol* type_signature(BasicType t) { 1363 assert((uint)t < T_VOID+1, "range check"); 1364 assert(_type_signatures[t] != NULL, "domain check"); 1365 return _type_signatures[t]; 1366 } 1367 // inverse of type_signature; returns T_OBJECT if s is not recognized 1368 static BasicType signature_type(Symbol* s); 1369 1370 static Symbol* symbol_at(SID id) { 1371 assert(id >= FIRST_SID && id < SID_LIMIT, "oob"); 1372 assert(_symbols[id] != NULL, "init"); 1373 return _symbols[id]; 1374 } 1375 1376 // Returns symbol's SID if one is assigned, else NO_SID. 1377 static SID find_sid(Symbol* symbol); 1378 static SID find_sid(const char* symbol_name); 1379 1380 #ifndef PRODUCT 1381 // No need for this in the product: 1382 static const char* name_for(SID sid); 1383 #endif //PRODUCT 1384 }; 1385 1386 // VM Intrinsic ID's uniquely identify some very special methods 1387 class vmIntrinsics: AllStatic { 1388 friend class vmSymbols; 1389 friend class ciObjectFactory; 1390 1391 public: 1392 // Accessing 1393 enum ID { 1394 _none = 0, // not an intrinsic (default answer) 1395 1396 #define VM_INTRINSIC_ENUM(id, klass, name, sig, flags) id, 1397 VM_INTRINSICS_DO(VM_INTRINSIC_ENUM, 1398 VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) 1399 #undef VM_INTRINSIC_ENUM 1400 1401 ID_LIMIT, 1402 LAST_COMPILER_INLINE = _getAndSetObject, 1403 FIRST_MH_SIG_POLY = _invokeGeneric, 1404 FIRST_MH_STATIC = _linkToVirtual, 1405 LAST_MH_SIG_POLY = _linkToInterface, 1406 1407 FIRST_ID = _none + 1 1408 }; 1409 1410 enum Flags { 1411 // AccessFlags syndromes relevant to intrinsics. 1412 F_none = 0, 1413 F_R, // !static ?native !synchronized (R="regular") 1414 F_S, // static ?native !synchronized 1415 F_Y, // !static ?native synchronized 1416 F_RN, // !static native !synchronized 1417 F_SN, // static native !synchronized 1418 F_RNY, // !static native synchronized 1419 1420 FLAG_LIMIT 1421 }; 1422 enum { 1423 log2_FLAG_LIMIT = 4 // checked by an assert at start-up 1424 }; 1425 1426 public: 1427 static ID ID_from(int raw_id) { 1428 assert(raw_id >= (int)_none && raw_id < (int)ID_LIMIT, 1429 "must be a valid intrinsic ID"); 1430 return (ID)raw_id; 1431 } 1432 1433 static const char* name_at(ID id); 1434 1435 private: 1436 static ID find_id_impl(vmSymbols::SID holder, 1437 vmSymbols::SID name, 1438 vmSymbols::SID sig, 1439 jshort flags); 1440 1441 public: 1442 // Given a method's class, name, signature, and access flags, report its ID. 1443 static ID find_id(vmSymbols::SID holder, 1444 vmSymbols::SID name, 1445 vmSymbols::SID sig, 1446 jshort flags) { 1447 ID id = find_id_impl(holder, name, sig, flags); 1448 #ifdef ASSERT 1449 // ID _none does not hold the following asserts. 1450 if (id == _none) return id; 1451 #endif 1452 assert( class_for(id) == holder, "correct id"); 1453 assert( name_for(id) == name, "correct id"); 1454 assert(signature_for(id) == sig, "correct id"); 1455 return id; 1456 } 1457 1458 static void verify_method(ID actual_id, Method* m) PRODUCT_RETURN; 1459 1460 // Find out the symbols behind an intrinsic: 1461 static vmSymbols::SID class_for(ID id); 1462 static vmSymbols::SID name_for(ID id); 1463 static vmSymbols::SID signature_for(ID id); 1464 static Flags flags_for(ID id); 1465 1466 static const char* short_name_as_C_string(ID id, char* buf, int size); 1467 1468 // Wrapper object methods: 1469 static ID for_boxing(BasicType type); 1470 static ID for_unboxing(BasicType type); 1471 1472 // Raw conversion: 1473 static ID for_raw_conversion(BasicType src, BasicType dest); 1474 1475 // The methods below provide information related to compiling intrinsics. 1476 1477 // (1) Information needed by the C1 compiler. 1478 1479 static bool preserves_state(vmIntrinsics::ID id); 1480 static bool can_trap(vmIntrinsics::ID id); 1481 1482 // (2) Information needed by the C2 compiler. 1483 1484 // Returns true if the intrinsic for method 'method' will perform a virtual dispatch. 1485 static bool does_virtual_dispatch(vmIntrinsics::ID id); 1486 // A return value larger than 0 indicates that the intrinsic for method 1487 // 'method' requires predicated logic. 1488 static int predicates_needed(vmIntrinsics::ID id); 1489 1490 // Returns true if a compiler intrinsic is disabled by command-line flags 1491 // and false otherwise. 1492 static bool is_disabled_by_flags(const methodHandle& method); 1493 }; 1494 1495 #endif // SHARE_VM_CLASSFILE_VMSYMBOLS_HPP