2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
25 // The classes vmSymbols and vmSymbolHandles are a name spaces for fast lookup of
26 // symbols commonly used in the VM. The first class return a symbolOop, while the
27 // second class returns a SymbolHandle. The underlying data structure is shared
28 // between the two classes.
32 // symbolOop obj = vmSymbols::java_lang_Object()();
33 // SymbolHandle handle = vmSymbolHandles::java_lang_Object();
36 // Useful sub-macros exported by this header file:
38 #define VM_SYMBOL_ENUM_NAME(name) name##_enum
39 #define VM_INTRINSIC_IGNORE(id, class, name, sig, flags) /*ignored*/
40 #define VM_SYMBOL_IGNORE(id, name) /*ignored*/
41 #define VM_ALIAS_IGNORE(id, id2) /*ignored*/
44 // Mapping function names to values. New entries should be added below.
46 #define VM_SYMBOLS_DO(template, do_alias) \
47 /* commonly used class names */ \
48 template(java_lang_System, "java/lang/System") \
49 template(java_lang_Object, "java/lang/Object") \
50 template(java_lang_Class, "java/lang/Class") \
51 template(java_lang_String, "java/lang/String") \
52 template(java_lang_Thread, "java/lang/Thread") \
53 template(java_lang_ThreadGroup, "java/lang/ThreadGroup") \
54 template(java_lang_Cloneable, "java/lang/Cloneable") \
55 template(java_lang_Throwable, "java/lang/Throwable") \
56 template(java_lang_ClassLoader, "java/lang/ClassLoader") \
57 template(java_lang_ClassLoader_NativeLibrary, "java/lang/ClassLoader\x024NativeLibrary") \
58 template(java_lang_ThreadDeath, "java/lang/ThreadDeath") \
59 template(java_lang_Boolean, "java/lang/Boolean") \
60 template(java_lang_Character, "java/lang/Character") \
61 template(java_lang_Float, "java/lang/Float") \
62 template(java_lang_Double, "java/lang/Double") \
63 template(java_lang_Byte, "java/lang/Byte") \
64 template(java_lang_Short, "java/lang/Short") \
65 template(java_lang_Integer, "java/lang/Integer") \
66 template(java_lang_Long, "java/lang/Long") \
67 template(java_lang_Shutdown, "java/lang/Shutdown") \
68 template(java_lang_ref_Reference, "java/lang/ref/Reference") \
69 template(java_lang_ref_SoftReference, "java/lang/ref/SoftReference") \
70 template(java_lang_ref_WeakReference, "java/lang/ref/WeakReference") \
71 template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \
72 template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \
73 template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \
74 template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \
75 template(java_lang_reflect_Method, "java/lang/reflect/Method") \
76 template(java_lang_reflect_Constructor, "java/lang/reflect/Constructor") \
77 template(java_lang_reflect_Field, "java/lang/reflect/Field") \
78 template(java_lang_reflect_Array, "java/lang/reflect/Array") \
79 template(java_lang_StringBuffer, "java/lang/StringBuffer") \
80 template(java_lang_CharSequence, "java/lang/CharSequence") \
81 template(java_security_AccessControlContext, "java/security/AccessControlContext") \
82 template(java_security_ProtectionDomain, "java/security/ProtectionDomain") \
83 template(java_io_OutputStream, "java/io/OutputStream") \
84 template(java_io_Reader, "java/io/Reader") \
85 template(java_io_BufferedReader, "java/io/BufferedReader") \
86 template(java_io_FileInputStream, "java/io/FileInputStream") \
87 template(java_io_ByteArrayInputStream, "java/io/ByteArrayInputStream") \
88 template(java_io_Serializable, "java/io/Serializable") \
89 template(java_util_Arrays, "java/util/Arrays") \
90 template(java_util_Properties, "java/util/Properties") \
91 template(java_util_Vector, "java/util/Vector") \
92 template(java_util_AbstractList, "java/util/AbstractList") \
93 template(java_util_Hashtable, "java/util/Hashtable") \
94 template(java_lang_Compiler, "java/lang/Compiler") \
95 template(sun_misc_Signal, "sun/misc/Signal") \
96 template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \
97 template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \
98 template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \
100 /* class file format tags */ \
101 template(tag_source_file, "SourceFile") \
102 template(tag_inner_classes, "InnerClasses") \
103 template(tag_constant_value, "ConstantValue") \
104 template(tag_code, "Code") \
105 template(tag_exceptions, "Exceptions") \
106 template(tag_line_number_table, "LineNumberTable") \
107 template(tag_local_variable_table, "LocalVariableTable") \
108 template(tag_local_variable_type_table, "LocalVariableTypeTable") \
109 template(tag_stack_map_table, "StackMapTable") \
110 template(tag_synthetic, "Synthetic") \
111 template(tag_deprecated, "Deprecated") \
112 template(tag_source_debug_extension, "SourceDebugExtension") \
113 template(tag_signature, "Signature") \
114 template(tag_runtime_visible_annotations, "RuntimeVisibleAnnotations") \
115 template(tag_runtime_invisible_annotations, "RuntimeInvisibleAnnotations") \
116 template(tag_runtime_visible_parameter_annotations, "RuntimeVisibleParameterAnnotations") \
117 template(tag_runtime_invisible_parameter_annotations,"RuntimeInvisibleParameterAnnotations") \
118 template(tag_annotation_default, "AnnotationDefault") \
119 template(tag_enclosing_method, "EnclosingMethod") \
121 /* exception klasses: at least all exceptions thrown by the VM have entries here */ \
122 template(java_lang_ArithmeticException, "java/lang/ArithmeticException") \
123 template(java_lang_ArrayIndexOutOfBoundsException, "java/lang/ArrayIndexOutOfBoundsException") \
124 template(java_lang_ArrayStoreException, "java/lang/ArrayStoreException") \
125 template(java_lang_ClassCastException, "java/lang/ClassCastException") \
126 template(java_lang_ClassNotFoundException, "java/lang/ClassNotFoundException") \
127 template(java_lang_CloneNotSupportedException, "java/lang/CloneNotSupportedException") \
128 template(java_lang_IllegalAccessException, "java/lang/IllegalAccessException") \
129 template(java_lang_IllegalArgumentException, "java/lang/IllegalArgumentException") \
130 template(java_lang_IllegalMonitorStateException, "java/lang/IllegalMonitorStateException") \
131 template(java_lang_IllegalThreadStateException, "java/lang/IllegalThreadStateException") \
132 template(java_lang_IndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException") \
133 template(java_lang_InstantiationException, "java/lang/InstantiationException") \
134 template(java_lang_InstantiationError, "java/lang/InstantiationError") \
135 template(java_lang_InterruptedException, "java/lang/InterruptedException") \
136 template(java_lang_LinkageError, "java/lang/LinkageError") \
137 template(java_lang_NegativeArraySizeException, "java/lang/NegativeArraySizeException") \
138 template(java_lang_NoSuchFieldException, "java/lang/NoSuchFieldException") \
139 template(java_lang_NoSuchMethodException, "java/lang/NoSuchMethodException") \
140 template(java_lang_NullPointerException, "java/lang/NullPointerException") \
141 template(java_lang_StringIndexOutOfBoundsException, "java/lang/StringIndexOutOfBoundsException")\
142 template(java_lang_InvalidClassException, "java/lang/InvalidClassException") \
143 template(java_lang_reflect_InvocationTargetException, "java/lang/reflect/InvocationTargetException") \
144 template(java_lang_Exception, "java/lang/Exception") \
145 template(java_lang_RuntimeException, "java/lang/RuntimeException") \
146 template(java_io_IOException, "java/io/IOException") \
147 template(java_security_PrivilegedActionException, "java/security/PrivilegedActionException") \
149 /* error klasses: at least all errors thrown by the VM have entries here */ \
150 template(java_lang_AbstractMethodError, "java/lang/AbstractMethodError") \
151 template(java_lang_ClassCircularityError, "java/lang/ClassCircularityError") \
152 template(java_lang_ClassFormatError, "java/lang/ClassFormatError") \
153 template(java_lang_UnsupportedClassVersionError, "java/lang/UnsupportedClassVersionError") \
154 template(java_lang_Error, "java/lang/Error") \
155 template(java_lang_ExceptionInInitializerError, "java/lang/ExceptionInInitializerError") \
156 template(java_lang_IllegalAccessError, "java/lang/IllegalAccessError") \
157 template(java_lang_IncompatibleClassChangeError, "java/lang/IncompatibleClassChangeError") \
158 template(java_lang_InternalError, "java/lang/InternalError") \
159 template(java_lang_NoClassDefFoundError, "java/lang/NoClassDefFoundError") \
160 template(java_lang_NoSuchFieldError, "java/lang/NoSuchFieldError") \
161 template(java_lang_NoSuchMethodError, "java/lang/NoSuchMethodError") \
162 template(java_lang_OutOfMemoryError, "java/lang/OutOfMemoryError") \
163 template(java_lang_UnsatisfiedLinkError, "java/lang/UnsatisfiedLinkError") \
164 template(java_lang_VerifyError, "java/lang/VerifyError") \
165 template(java_lang_SecurityException, "java/lang/SecurityException") \
166 template(java_lang_VirtualMachineError, "java/lang/VirtualMachineError") \
167 template(java_lang_StackOverflowError, "java/lang/StackOverflowError") \
168 template(java_lang_StackTraceElement, "java/lang/StackTraceElement") \
169 template(java_util_concurrent_locks_AbstractOwnableSynchronizer, "java/util/concurrent/locks/AbstractOwnableSynchronizer") \
171 /* class symbols needed by intrinsics */ \
172 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
174 /* Support for reflection based on dynamic bytecode generation (JDK 1.4 and above) */ \
176 template(sun_reflect_FieldInfo, "sun/reflect/FieldInfo") \
177 template(sun_reflect_MethodInfo, "sun/reflect/MethodInfo") \
178 template(sun_reflect_MagicAccessorImpl, "sun/reflect/MagicAccessorImpl") \
179 template(sun_reflect_MethodAccessorImpl, "sun/reflect/MethodAccessorImpl") \
180 template(sun_reflect_ConstructorAccessorImpl, "sun/reflect/ConstructorAccessorImpl") \
181 template(sun_reflect_SerializationConstructorAccessorImpl, "sun/reflect/SerializationConstructorAccessorImpl") \
182 template(sun_reflect_DelegatingClassLoader, "sun/reflect/DelegatingClassLoader") \
183 template(sun_reflect_Reflection, "sun/reflect/Reflection") \
184 template(checkedExceptions_name, "checkedExceptions") \
185 template(clazz_name, "clazz") \
186 template(exceptionTypes_name, "exceptionTypes") \
187 template(modifiers_name, "modifiers") \
188 template(newConstructor_name, "newConstructor") \
189 template(newConstructor_signature, "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Constructor;") \
190 template(newField_name, "newField") \
191 template(newField_signature, "(Lsun/reflect/FieldInfo;)Ljava/lang/reflect/Field;") \
192 template(newMethod_name, "newMethod") \
193 template(newMethod_signature, "(Lsun/reflect/MethodInfo;)Ljava/lang/reflect/Method;") \
194 template(invoke_name, "invoke") \
195 template(override_name, "override") \
196 template(parameterTypes_name, "parameterTypes") \
197 template(returnType_name, "returnType") \
198 template(signature_name, "signature") \
199 template(slot_name, "slot") \
201 /* Support for annotations (JDK 1.5 and above) */ \
203 template(annotations_name, "annotations") \
204 template(parameter_annotations_name, "parameterAnnotations") \
205 template(annotation_default_name, "annotationDefault") \
206 template(sun_reflect_ConstantPool, "sun/reflect/ConstantPool") \
207 template(constantPoolOop_name, "constantPoolOop") \
208 template(sun_reflect_UnsafeStaticFieldAccessorImpl, "sun/reflect/UnsafeStaticFieldAccessorImpl")\
209 template(base_name, "base") \
211 /* common method names */ \
212 template(object_initializer_name, "<init>") \
213 template(class_initializer_name, "<clinit>") \
214 template(println_name, "println") \
215 template(printStackTrace_name, "printStackTrace") \
216 template(main_name, "main") \
217 template(name_name, "name") \
218 template(priority_name, "priority") \
219 template(stillborn_name, "stillborn") \
220 template(group_name, "group") \
221 template(daemon_name, "daemon") \
222 template(eetop_name, "eetop") \
223 template(thread_status_name, "threadStatus") \
224 template(run_method_name, "run") \
225 template(exit_method_name, "exit") \
226 template(add_method_name, "add") \
227 template(parent_name, "parent") \
228 template(threads_name, "threads") \
229 template(groups_name, "groups") \
230 template(maxPriority_name, "maxPriority") \
231 template(destroyed_name, "destroyed") \
232 template(vmAllowSuspension_name, "vmAllowSuspension") \
233 template(nthreads_name, "nthreads") \
234 template(ngroups_name, "ngroups") \
235 template(shutdown_method_name, "shutdown") \
236 template(finalize_method_name, "finalize") \
237 template(reference_lock_name, "lock") \
238 template(reference_discovered_name, "discovered") \
239 template(run_finalizers_on_exit_name, "runFinalizersOnExit") \
240 template(uncaughtException_name, "uncaughtException") \
241 template(dispatchUncaughtException_name, "dispatchUncaughtException") \
242 template(initializeSystemClass_name, "initializeSystemClass") \
243 template(loadClass_name, "loadClass") \
244 template(loadClassInternal_name, "loadClassInternal") \
245 template(get_name, "get") \
246 template(put_name, "put") \
247 template(type_name, "type") \
248 template(findNative_name, "findNative") \
249 template(deadChild_name, "deadChild") \
250 template(addClass_name, "addClass") \
251 template(getFromClass_name, "getFromClass") \
252 template(dispatch_name, "dispatch") \
253 template(getSystemClassLoader_name, "getSystemClassLoader") \
254 template(fillInStackTrace_name, "fillInStackTrace") \
255 template(getCause_name, "getCause") \
256 template(initCause_name, "initCause") \
257 template(setProperty_name, "setProperty") \
258 template(getProperty_name, "getProperty") \
259 template(context_name, "context") \
260 template(privilegedContext_name, "privilegedContext") \
261 template(contextClassLoader_name, "contextClassLoader") \
262 template(inheritedAccessControlContext_name, "inheritedAccessControlContext") \
263 template(isPrivileged_name, "isPrivileged") \
264 template(wait_name, "wait") \
265 template(checkPackageAccess_name, "checkPackageAccess") \
266 template(stackSize_name, "stackSize") \
267 template(thread_id_name, "tid") \
268 template(newInstance0_name, "newInstance0") \
269 template(limit_name, "limit") \
270 template(forName_name, "forName") \
271 template(forName0_name, "forName0") \
272 template(isJavaIdentifierStart_name, "isJavaIdentifierStart") \
273 template(isJavaIdentifierPart_name, "isJavaIdentifierPart") \
274 template(exclusive_owner_thread_name, "exclusiveOwnerThread") \
275 template(park_blocker_name, "parkBlocker") \
276 template(park_event_name, "nativeParkEventPointer") \
277 template(value_name, "value") \
279 /* non-intrinsic name/signature pairs: */ \
280 template(register_method_name, "register") \
281 do_alias(register_method_signature, object_void_signature) \
283 /* name symbols needed by intrinsics */ \
284 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
286 /* common signatures names */ \
287 template(void_method_signature, "()V") \
288 template(void_int_signature, "()I") \
289 template(void_long_signature, "()J") \
290 template(void_boolean_signature, "()Z") \
291 template(int_void_signature, "(I)V") \
292 template(int_int_signature, "(I)I") \
293 template(int_bool_signature, "(I)Z") \
294 template(float_int_signature, "(F)I") \
295 template(double_long_signature, "(D)J") \
296 template(double_double_signature, "(D)D") \
297 template(int_float_signature, "(I)F") \
298 template(long_long_signature, "(J)J") \
299 template(long_double_signature, "(J)D") \
300 template(byte_signature, "B") \
301 template(char_signature, "C") \
302 template(double_signature, "D") \
303 template(float_signature, "F") \
304 template(int_signature, "I") \
305 template(long_signature, "J") \
306 template(short_signature, "S") \
307 template(bool_signature, "Z") \
308 template(void_signature, "V") \
309 template(byte_array_signature, "[B") \
310 template(char_array_signature, "[C") \
311 template(object_void_signature, "(Ljava/lang/Object;)V") \
312 template(object_int_signature, "(Ljava/lang/Object;)I") \
313 template(object_boolean_signature, "(Ljava/lang/Object;)Z") \
314 template(string_void_signature, "(Ljava/lang/String;)V") \
315 template(string_int_signature, "(Ljava/lang/String;)I") \
316 template(throwable_void_signature, "(Ljava/lang/Throwable;)V") \
317 template(void_throwable_signature, "()Ljava/lang/Throwable;") \
318 template(throwable_throwable_signature, "(Ljava/lang/Throwable;)Ljava/lang/Throwable;") \
319 template(class_void_signature, "(Ljava/lang/Class;)V") \
320 template(class_int_signature, "(Ljava/lang/Class;)I") \
321 template(class_boolean_signature, "(Ljava/lang/Class;)Z") \
322 template(throwable_string_void_signature, "(Ljava/lang/Throwable;Ljava/lang/String;)V") \
323 template(string_array_void_signature, "([Ljava/lang/String;)V") \
324 template(string_array_string_array_void_signature, "([Ljava/lang/String;[Ljava/lang/String;)V") \
325 template(thread_throwable_void_signature, "(Ljava/lang/Thread;Ljava/lang/Throwable;)V") \
326 template(thread_void_signature, "(Ljava/lang/Thread;)V") \
327 template(threadgroup_runnable_void_signature, "(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;)V") \
328 template(threadgroup_string_void_signature, "(Ljava/lang/ThreadGroup;Ljava/lang/String;)V") \
329 template(string_class_signature, "(Ljava/lang/String;)Ljava/lang/Class;") \
330 template(object_object_object_signature, "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
331 template(string_string_string_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;") \
332 template(string_string_signature, "(Ljava/lang/String;)Ljava/lang/String;") \
333 template(classloader_string_long_signature, "(Ljava/lang/ClassLoader;Ljava/lang/String;)J") \
334 template(byte_array_void_signature, "([B)V") \
335 template(char_array_void_signature, "([C)V") \
336 template(int_int_void_signature, "(II)V") \
337 template(long_long_void_signature, "(JJ)V") \
338 template(void_classloader_signature, "()Ljava/lang/ClassLoader;") \
339 template(void_object_signature, "()Ljava/lang/Object;") \
340 template(void_class_signature, "()Ljava/lang/Class;") \
341 template(object_array_object_object_signature, "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\
342 template(exception_void_signature, "(Ljava/lang/Exception;)V") \
343 template(protectiondomain_signature, "[Ljava/security/ProtectionDomain;") \
344 template(accesscontrolcontext_signature, "Ljava/security/AccessControlContext;") \
345 template(class_protectiondomain_signature, "(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V") \
346 template(thread_signature, "Ljava/lang/Thread;") \
347 template(thread_array_signature, "[Ljava/lang/Thread;") \
348 template(threadgroup_signature, "Ljava/lang/ThreadGroup;") \
349 template(threadgroup_array_signature, "[Ljava/lang/ThreadGroup;") \
350 template(class_array_signature, "[Ljava/lang/Class;") \
351 template(classloader_signature, "Ljava/lang/ClassLoader;") \
352 template(object_signature, "Ljava/lang/Object;") \
353 template(class_signature, "Ljava/lang/Class;") \
354 template(string_signature, "Ljava/lang/String;") \
355 template(reference_signature, "Ljava/lang/ref/Reference;") \
356 /* signature symbols needed by intrinsics */ \
357 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE) \
359 /* symbol aliases needed by intrinsics */ \
360 VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, do_alias) \
362 /* returned by the C1 compiler in case there's not enough memory to allocate a new symbol*/ \
363 template(dummy_symbol_oop, "illegal symbol") \
365 /* used by ClassFormatError when class name is not known yet */ \
366 template(unknown_class_name, "<Unknown>") \
368 /* JVM monitoring and management support */ \
369 template(java_lang_StackTraceElement_array, "[Ljava/lang/StackTraceElement;") \
370 template(java_lang_management_ThreadState, "java/lang/management/ThreadState") \
371 template(java_lang_management_MemoryUsage, "java/lang/management/MemoryUsage") \
372 template(java_lang_management_ThreadInfo, "java/lang/management/ThreadInfo") \
373 template(sun_management_ManagementFactory, "sun/management/ManagementFactory") \
374 template(sun_management_Sensor, "sun/management/Sensor") \
375 template(sun_management_Agent, "sun/management/Agent") \
376 template(createMemoryPoolMBean_name, "createMemoryPoolMBean") \
377 template(createMemoryManagerMBean_name, "createMemoryManagerMBean") \
378 template(createGarbageCollectorMBean_name, "createGarbageCollectorMBean") \
379 template(createMemoryPoolMBean_signature, "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMBean;") \
380 template(createMemoryManagerMBean_signature, "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMBean;") \
381 template(createGarbageCollectorMBean_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMBean;") \
382 template(trigger_name, "trigger") \
383 template(clear_name, "clear") \
384 template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \
385 template(startAgent_name, "startAgent") \
386 template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \
387 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") \
388 template(long_long_long_long_void_signature, "(JJJJ)V") \
390 template(java_lang_management_MemoryPoolMXBean, "java/lang/management/MemoryPoolMXBean") \
391 template(java_lang_management_MemoryManagerMXBean, "java/lang/management/MemoryManagerMXBean") \
392 template(java_lang_management_GarbageCollectorMXBean,"java/lang/management/GarbageCollectorMXBean") \
393 template(createMemoryPool_name, "createMemoryPool") \
394 template(createMemoryManager_name, "createMemoryManager") \
395 template(createGarbageCollector_name, "createGarbageCollector") \
396 template(createMemoryPool_signature, "(Ljava/lang/String;ZJJ)Ljava/lang/management/MemoryPoolMXBean;") \
397 template(createMemoryManager_signature, "(Ljava/lang/String;)Ljava/lang/management/MemoryManagerMXBean;") \
398 template(createGarbageCollector_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMXBean;") \
399 template(addThreadDumpForMonitors_name, "addThreadDumpForMonitors") \
400 template(addThreadDumpForSynchronizers_name, "addThreadDumpForSynchronizers") \
401 template(addThreadDumpForMonitors_signature, "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;[I)V") \
402 template(addThreadDumpForSynchronizers_signature, "(Ljava/lang/management/ThreadInfo;[Ljava/lang/Object;)V") \
404 /* JVMTI/java.lang.instrument support and VM Attach mechanism */ \
405 template(sun_misc_VMSupport, "sun/misc/VMSupport") \
406 template(appendToClassPathForInstrumentation_name, "appendToClassPathForInstrumentation") \
407 do_alias(appendToClassPathForInstrumentation_signature, string_void_signature) \
408 template(serializePropertiesToByteArray_name, "serializePropertiesToByteArray") \
409 template(serializePropertiesToByteArray_signature, "()[B") \
410 template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
411 template(classRedefinedCount_name, "classRedefinedCount") \
416 // Here are all the intrinsics known to the runtime and the CI.
417 // Each intrinsic consists of a public enum name (like _hashCode),
418 // followed by a specification of its klass, name, and signature:
419 // template(<id>, <klass>, <name>, <sig>, <FCODE>)
421 // If you add an intrinsic here, you must also define its name
422 // and signature as members of the VM symbols. The VM symbols for
423 // the intrinsic name and signature may be defined above.
425 // Because the VM_SYMBOLS_DO macro makes reference to VM_INTRINSICS_DO,
426 // you can also define an intrinsic's name and/or signature locally to the
427 // intrinsic, if this makes sense. (It often does make sense.)
430 // do_intrinsic(_foo, java_lang_Object, foo_name, foo_signature, F_xx)
431 // do_name( foo_name, "foo")
432 // do_signature(foo_signature, "()F")
433 // klass = vmSymbols::java_lang_Object()
434 // name = vmSymbols::foo_name()
435 // signature = vmSymbols::foo_signature()
437 // The name and/or signature might be a "well known" symbol
438 // like "equal" or "()I", in which case there will be no local
439 // re-definition of the symbol.
441 // The do_class, do_name, and do_signature calls are all used for the
442 // same purpose: Define yet another VM symbol. They could all be merged
443 // into a common 'do_symbol' call, but it seems useful to record our
444 // intentions here about kinds of symbols (class vs. name vs. signature).
446 // The F_xx is one of the Flags enum; see below.
448 // for Emacs: (let ((c-backslash-column 120) (c-backslash-max-column 120)) (c-backslash-region (point) (point-max) nil t))
449 #define VM_INTRINSICS_DO(do_intrinsic, do_class, do_name, do_signature, do_alias) \
450 do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \
451 /* (symbol object_initializer_name defined above) */ \
453 do_intrinsic(_hashCode, java_lang_Object, hashCode_name, void_int_signature, F_R) \
454 do_name( hashCode_name, "hashCode") \
455 do_intrinsic(_getClass, java_lang_Object, getClass_name, void_class_signature, F_R) \
456 do_name( getClass_name, "getClass") \
457 do_intrinsic(_clone, java_lang_Object, clone_name, void_object_signature, F_R) \
458 do_name( clone_name, "clone") \
460 /* Math & StrictMath intrinsics are defined in terms of just a few signatures: */ \
461 do_class(java_lang_Math, "java/lang/Math") \
462 do_class(java_lang_StrictMath, "java/lang/StrictMath") \
463 do_signature(double2_double_signature, "(DD)D") \
464 do_signature(int2_int_signature, "(II)I") \
466 /* here are the math names, all together: */ \
467 do_name(abs_name,"abs") do_name(sin_name,"sin") do_name(cos_name,"cos") \
468 do_name(tan_name,"tan") do_name(atan2_name,"atan2") do_name(sqrt_name,"sqrt") \
469 do_name(log_name,"log") do_name(log10_name,"log10") do_name(pow_name,"pow") \
470 do_name(exp_name,"exp") do_name(min_name,"min") do_name(max_name,"max") \
472 do_intrinsic(_dabs, java_lang_Math, abs_name, double_double_signature, F_S) \
473 do_intrinsic(_dsin, java_lang_Math, sin_name, double_double_signature, F_S) \
474 do_intrinsic(_dcos, java_lang_Math, cos_name, double_double_signature, F_S) \
475 do_intrinsic(_dtan, java_lang_Math, tan_name, double_double_signature, F_S) \
476 do_intrinsic(_datan2, java_lang_Math, atan2_name, double2_double_signature, F_S) \
477 do_intrinsic(_dsqrt, java_lang_Math, sqrt_name, double_double_signature, F_S) \
478 do_intrinsic(_dlog, java_lang_Math, log_name, double_double_signature, F_S) \
479 do_intrinsic(_dlog10, java_lang_Math, log10_name, double_double_signature, F_S) \
480 do_intrinsic(_dpow, java_lang_Math, pow_name, double2_double_signature, F_S) \
481 do_intrinsic(_dexp, java_lang_Math, exp_name, double_double_signature, F_S) \
482 do_intrinsic(_min, java_lang_Math, min_name, int2_int_signature, F_S) \
483 do_intrinsic(_max, java_lang_Math, max_name, int2_int_signature, F_S) \
485 do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \
486 do_name( floatToRawIntBits_name, "floatToRawIntBits") \
487 do_intrinsic(_floatToIntBits, java_lang_Float, floatToIntBits_name, float_int_signature, F_S) \
488 do_name( floatToIntBits_name, "floatToIntBits") \
489 do_intrinsic(_intBitsToFloat, java_lang_Float, intBitsToFloat_name, int_float_signature, F_S) \
490 do_name( intBitsToFloat_name, "intBitsToFloat") \
491 do_intrinsic(_doubleToRawLongBits, java_lang_Double, doubleToRawLongBits_name, double_long_signature, F_S) \
492 do_name( doubleToRawLongBits_name, "doubleToRawLongBits") \
493 do_intrinsic(_doubleToLongBits, java_lang_Double, doubleToLongBits_name, double_long_signature, F_S) \
494 do_name( doubleToLongBits_name, "doubleToLongBits") \
495 do_intrinsic(_longBitsToDouble, java_lang_Double, longBitsToDouble_name, long_double_signature, F_S) \
496 do_name( longBitsToDouble_name, "longBitsToDouble") \
497 do_intrinsic(_reverseBytes_i, java_lang_Integer, reverseBytes_name, int_int_signature, F_S) \
498 do_name( reverseBytes_name, "reverseBytes") \
499 do_intrinsic(_reverseBytes_l, java_lang_Long, reverseBytes_name, long_long_signature, F_S) \
500 /* (symbol reverseBytes_name defined above) */ \
502 do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_S) \
503 do_name( identityHashCode_name, "identityHashCode") \
504 do_intrinsic(_currentTimeMillis, java_lang_System, currentTimeMillis_name, void_long_signature, F_S) \
506 do_name( currentTimeMillis_name, "currentTimeMillis") \
507 do_intrinsic(_nanoTime, java_lang_System, nanoTime_name, void_long_signature, F_S) \
508 do_name( nanoTime_name, "nanoTime") \
510 do_intrinsic(_arraycopy, java_lang_System, arraycopy_name, arraycopy_signature, F_S) \
511 do_name( arraycopy_name, "arraycopy") \
512 do_signature(arraycopy_signature, "(Ljava/lang/Object;ILjava/lang/Object;II)V") \
513 do_intrinsic(_isInterrupted, java_lang_Thread, isInterrupted_name, isInterrupted_signature, F_R) \
514 do_name( isInterrupted_name, "isInterrupted") \
515 do_signature(isInterrupted_signature, "(Z)Z") \
516 do_intrinsic(_currentThread, java_lang_Thread, currentThread_name, currentThread_signature, F_S) \
517 do_name( currentThread_name, "currentThread") \