1 /* src/vm/jit/builtintable.inc - tables of builtin functions
3 Copyright (C) 1996-2010
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 #include "threads/lock.hpp"
32 #include "vm/jit/builtin.hpp"
33 #include "vm/jit/jit.hpp"
36 /* internal and not automatically replaced functions **************************/
38 static builtintable_entry builtintable_internal[] = {
40 #if defined(__ALPHA__) || defined(DISABLE_GC)
114 #if !SUPPORT_DIVISION || defined(DISABLE_GC)
145 #if !(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_DIV) || defined(DISABLE_GC)
206 /* internal functions *****************************************************/
210 BUILTINTABLE_FLAG_STUB,
215 "(Ljava/lang/Class;)Ljava/lang/Object;",
223 #if defined(ENABLE_TLH)
226 BUILTINTABLE_FLAG_STUB,
231 "(Ljava/lang/Class;)Ljava/lang/Object;",
240 #if defined(ENABLE_ESCAPE_REASON)
243 BUILTINTABLE_FLAG_STUB,
244 BUILTIN_escape_reason_new,
248 "(Ljava/lang/Class;)Ljava/lang/Object;",
264 "(Ljava/lang/Class;)Ljava/lang/Object;",
273 BUILTINTABLE_FLAG_STUB,
278 "(ILjava/lang/Class;)[Ljava/lang/Object;",
287 BUILTINTABLE_FLAG_STUB,
288 BUILTIN_newarray_boolean,
301 BUILTINTABLE_FLAG_STUB,
302 BUILTIN_newarray_byte,
315 BUILTINTABLE_FLAG_STUB,
316 BUILTIN_newarray_char,
329 BUILTINTABLE_FLAG_STUB,
330 BUILTIN_newarray_short,
343 BUILTINTABLE_FLAG_STUB,
344 BUILTIN_newarray_int,
357 BUILTINTABLE_FLAG_STUB,
358 BUILTIN_newarray_long,
371 BUILTINTABLE_FLAG_STUB,
372 BUILTIN_newarray_float,
385 BUILTINTABLE_FLAG_STUB,
386 BUILTIN_newarray_double,
399 BUILTINTABLE_FLAG_STUB,
400 BUILTIN_multianewarray,
404 /* XXX it should be: "(ILjava/lang/Class;[I)[Ljava/lang/Object;", */
405 "(ILjava/lang/Class;I)[Ljava/lang/Object;",
415 BUILTIN_arraycheckcast,
419 "([Ljava/lang/Object;[Ljava/lang/Object;)[Ljava/lang/Object;",
429 BUILTIN_arrayinstanceof,
433 "([Ljava/lang/Object;[Ljava/lang/Object;)I",
443 BUILTIN_FAST_canstore,
447 "([Ljava/lang/Object;Ljava/lang/Object;)I",
455 #if defined(ENABLE_THREADS)
458 BUILTINTABLE_FLAG_STUB,
463 "(Ljava/lang/Object;)V",
468 EMIT_FASTPATH_monitor_enter
472 BUILTINTABLE_FLAG_STUB,
477 "(Ljava/lang/Object;)V",
482 EMIT_FASTPATH_monitor_exit
506 /* automatically replaced functions *******************************************/
508 static builtintable_entry builtintable_automatic[] = {
510 #if !(SUPPORT_LONG && SUPPORT_LONG_CMP)
527 #if !(SUPPORT_LONG && SUPPORT_LONG_LOGICAL)
570 #endif /* !(SUPPORT_LONG && SUPPORT_LONG_LOGICAL) */
572 #if !(SUPPORT_LONG && SUPPORT_LONG_SHIFT)
615 #endif /* !(SUPPORT_LONG && SUPPORT_LONG_SHIFT) */
617 #if !(SUPPORT_LONG && SUPPORT_LONG_ADD)
660 #endif /* !(SUPPORT_LONG && SUPPORT_LONG_ADD) */
662 #if !(SUPPORT_LONG && SUPPORT_LONG_MUL)
679 #if !(SUPPORT_FLOAT && SUPPORT_I2F)
696 #if !(SUPPORT_DOUBLE && SUPPORT_I2D)
713 #if !(SUPPORT_LONG && SUPPORT_FLOAT && SUPPORT_L2F)
730 #if !(SUPPORT_LONG && SUPPORT_DOUBLE && SUPPORT_L2D)
747 #if !(SUPPORT_FLOAT && SUPPORT_F2I)
764 #if !(SUPPORT_FLOAT && SUPPORT_LONG && SUPPORT_F2L)
781 #if !(SUPPORT_DOUBLE && SUPPORT_D2I)
798 #if !(SUPPORT_DOUBLE && SUPPORT_LONG && SUPPORT_D2L)
816 /* float functions ********************************************************/
889 #endif /* !SUPPORT_FLOAT */
891 #if !SUPPORT_FLOAT || !SUPPORT_FLOAT_CMP
920 #endif /* !SUPPORT_FLOAT || !SUPPORT_FLOAT_CMP */
923 /* double functions *******************************************************/
996 #endif /* !SUPPORT_DOUBLE */
998 #if !SUPPORT_DOUBLE || !SUPPORT_DOUBLE_CMP
1027 #endif /* !SUPPORT_DOUBLE || !SUPPORT_DOUBLE_CMP */
1030 /* float/double functions *************************************************/
1032 #if !(SUPPORT_FLOAT && SUPPORT_DOUBLE)
1061 #endif /* !(SUPPORT_FLOAT && SUPPORT_DOUBLE) */
1064 /* prevent a compiler warning if everything is supported (e.g. i386) */
1083 /* automatically replaced functions *******************************************/
1085 static builtintable_entry builtintable_function[] = {
1086 #if defined(ENABLE_JIT)
1088 /* java.lang.VMSystem.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V STATIC NATIVE */
1092 BUILTINTABLE_FLAG_STUB | BUILTINTABLE_FLAG_EXCEPTION,
1095 "java/lang/VMSystem",
1097 "(Ljava/lang/Object;ILjava/lang/Object;II)V",
1105 /* java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V PUBLIC STATIC */
1108 /* We disable this one until we have a fix for the stacktrace
1113 BUILTINTABLE_FLAG_STUB | BUILTINTABLE_FLAG_EXCEPTION,
1118 "(Ljava/lang/Object;ILjava/lang/Object;II)V",
1127 /* java.lang.VMSystem.currentTimeMillis()J PUBLIC STATIC */
1132 BUILTIN_currenttimemillis,
1134 "java/lang/VMSystem",
1135 "currentTimeMillis",
1144 /* java.lang.System.currentTimeMillis()J PUBLIC STATIC */
1149 BUILTIN_currenttimemillis,
1152 "currentTimeMillis",
1161 #endif /* defined(ENABLE_JIT) */
1183 * These are local overrides for various environment variables in Emacs.
1184 * Please do not remove this and leave it at the end of the file, where
1185 * Emacs will automagically detect them.
1186 * ---------------------------------------------------------------------
1189 * indent-tabs-mode: t
1193 * vim:noexpandtab:sw=4:ts=4: