X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fvm%2Fvm.c;h=56d41a7ce0334c4d6812e7160a6fffc671f1cdf0;hb=9791edde39e923a3c4b61b4c895eda363782d487;hp=b2ea46663e5d5726871903f01bd5080c0e873a10;hpb=eac580443b5f77a2b08f78c679bfe44a1eb660a9;p=cacao.git diff --git a/src/vm/vm.c b/src/vm/vm.c index b2ea46663..56d41a7ce 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: vm.c 8106 2007-06-19 22:50:17Z twisti $ + $Id: vm.c 8288 2007-08-10 15:12:00Z twisti $ */ @@ -50,8 +50,17 @@ #include "mm/memory.h" #include "native/jni.h" +#include "native/llni.h" #include "native/native.h" -#include "native/include/java_lang_String.h" /* required by java_lang_Class.h */ + +#include "native/include/java_lang_Object.h" /* required by j.l.C */ +#include "native/include/java_lang_String.h" /* required by j.l.C */ + +#if defined(WITH_CLASSPATH_SUN) +# include "native/include/java_nio_ByteBuffer.h" /* required by j.l.CL */ +# include "native/include/java_lang_ClassLoader.h" /* required by j.l.C */ +#endif + #include "native/include/java_lang_Class.h" #include "native/include/java_lang_Byte.h" @@ -63,6 +72,8 @@ #include "native/include/java_lang_Float.h" #include "native/include/java_lang_Double.h" +#include "native/vm/nativevm.h" + #include "threads/threads-common.h" #include "toolbox/logging.h" @@ -72,6 +83,7 @@ #include "vm/finalizer.h" #include "vm/global.h" #include "vm/initialize.h" +#include "vm/primitive.h" #include "vm/properties.h" #include "vm/signallocal.h" #include "vm/stringlocal.h" @@ -89,7 +101,6 @@ #include "vmcore/classcache.h" #include "vmcore/options.h" -#include "vmcore/primitive.h" #include "vmcore/statistics.h" #include "vmcore/suck.h" @@ -221,7 +232,6 @@ enum { OPT_VERBOSETC, #endif #endif /* defined(ENABLE_VERIFIER) */ - OPT_EAGER, /* optimization options */ @@ -247,8 +257,6 @@ enum { OPT_INLINE_DEBUG_END, OPT_INLINE_DEBUG_MIN, OPT_INLINE_DEBUG_MAX, - OPT_INLINE_REPLACE_VERBOSE, - OPT_INLINE_REPLACE_VERBOSE2, #endif /* defined(ENABLE_INLINING_DEBUG) */ #endif /* defined(ENABLE_INLINING) */ @@ -306,6 +314,7 @@ opt_struct opts[] = { { "?", false, OPT_HELP }, { "X", false, OPT_X }, { "XX:", true, OPT_XX }, + { "XX", false, OPT_XX }, { "ea:", true, OPT_EA }, { "da:", true, OPT_DA }, @@ -337,7 +346,6 @@ opt_struct opts[] = { { "log", true, OPT_LOG }, { "c", true, OPT_CHECK }, { "l", false, OPT_LOAD }, - { "eager", false, OPT_EAGER }, #if !defined(NDEBUG) { "all", false, OPT_ALL }, @@ -405,8 +413,6 @@ opt_struct opts[] = { { "ii", true, OPT_INLINE_DEBUG_MIN }, { "im", true, OPT_INLINE_DEBUG_MAX }, { "ie", true, OPT_INLINE_DEBUG_END }, - { "ir", false, OPT_INLINE_REPLACE_VERBOSE }, - { "iR", false, OPT_INLINE_REPLACE_VERBOSE2 }, #endif /* defined(ENABLE_INLINING_DEBUG) */ #if !defined(NDEBUG) { "il", false, OPT_INLINE_LOG }, @@ -463,7 +469,7 @@ void usage(void) puts(" -showversion print product version and continue"); puts(" -help, -? print this help message"); puts(" -X print help on non-standard Java options"); - puts(" -XX print help on CACAO options"); + puts(" -XX print help on debugging options"); puts(" -ea[:...|:]"); puts(" -enableassertions[:...|:]"); puts(" enable assertions with specified granularity"); @@ -530,7 +536,7 @@ static void XXusage(void) { puts(" -v write state-information"); #if !defined(NDEBUG) - puts(" -verbose[:call|exception|jit|memory|threads]"); + puts(" -verbose[:jit|threads]"); puts(" enable specific verbose output"); puts(" -debug-color colored output for ANSI terms"); #endif @@ -554,7 +560,6 @@ static void XXusage(void) puts(" -oloop optimize array accesses in loops"); #endif puts(" -l don't start the class after loading"); - puts(" -eager perform eager class loading and linking"); #if !defined(NDEBUG) puts(" -all compile all methods, no execution"); puts(" -m compile only a specific method"); @@ -584,8 +589,6 @@ static void XXusage(void) puts(" -ii set minimum size for inlined result"); puts(" -im set maximum size for inlined result"); puts(" -ie stop inlining after the given number of roots"); - puts(" -ir log on-stack replacement"); - puts(" -iR log on-stack replacement, more verbose"); #endif /* defined(ENABLE_INLINING_DEBUG) */ #endif /* defined(ENABLE_INLINING) */ @@ -633,8 +636,34 @@ static void version(bool opt_exit) puts("This program is distributed in the hope that it will be useful, but"); puts("WITHOUT ANY WARRANTY; without even the implied warranty of"); puts("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU"); - puts("General Public License for more details.\n"); + puts("General Public License for more details."); + + /* exit normally, if requested */ + + if (opt_exit) + exit(0); +} + + +/* fullversion ***************************************************************** + + Prints a Sun compatible version information (required e.g. by + jpackage, www.jpackage.org). + +*******************************************************************************/ + +static void fullversion(void) +{ + puts("java full version \"cacao-"JAVA_VERSION"\""); + + /* exit normally */ + + exit(0); +} + +void vm_printconfig(void) +{ puts("Configure/Build options:\n"); puts(" ./configure: "VERSION_CONFIGURE_ARGS""); #if defined(__VERSION__) @@ -663,28 +692,6 @@ static void version(bool opt_exit) printf(" java.boot.class.path : %s\n", _Jv_bootclasspath); printf(" gnu.classpath.boot.library.path: %s\n", classpath_libdir); printf(" java.class.path : %s\n", _Jv_classpath); - - /* exit normally, if requested */ - - if (opt_exit) - exit(0); -} - - -/* fullversion ***************************************************************** - - Prints a Sun compatible version information (required e.g. by - jpackage, www.jpackage.org). - -*******************************************************************************/ - -static void fullversion(void) -{ - puts("java full version \"cacao-"JAVA_VERSION"\""); - - /* exit normally */ - - exit(0); } @@ -866,7 +873,12 @@ bool vm_create(JavaVMInitArgs *vm_args) #else cacao_prefix = CACAO_PREFIX; cacao_libjvm = CACAO_LIBDIR"/libjvm"; + +# if defined(WITH_CLASSPATH_GNU) classpath_libdir = CLASSPATH_LIBDIR"/classpath"; +# else + classpath_libdir = CLASSPATH_LIBDIR; +# endif #endif /* set the bootclasspath */ @@ -898,20 +910,54 @@ bool vm_create(JavaVMInitArgs *vm_args) strcat(_Jv_bootclasspath, cacao_prefix); strcat(_Jv_bootclasspath, "/share/classpath/glibj.zip"); #else - len = # if defined(WITH_CLASSPATH_GNU) + len = strlen(CACAO_VM_ZIP) + strlen(":") + -# endif strlen(CLASSPATH_CLASSES) + strlen("0"); +# elif defined(WITH_CLASSPATH_SUN) + /* This is the bootclasspath taken from HotSpot (see + hotspot/src/share/vm/runtime/os.cpp + (os::set_boot_path)). */ + + len = + strlen(CLASSPATH_PREFIX"/lib/resources.jar:" + CLASSPATH_PREFIX"/lib/rt.jar:" + CLASSPATH_PREFIX"/lib/sunrsasign.jar:" + CLASSPATH_PREFIX"/lib/jsse.jar:" + CLASSPATH_PREFIX"/lib/jce.jar:" + CLASSPATH_PREFIX"/lib/charsets.jar:" + CLASSPATH_PREFIX"/classes") + + strlen("0"); +# elif defined(WITH_CLASSPATH_CLDC1_1) + len = + strlen(CLASSPATH_CLASSES) + + strlen("0"); +# else +# error unknown classpath configuration +# endif _Jv_bootclasspath = MNEW(char, len); + # if defined(WITH_CLASSPATH_GNU) - strcat(_Jv_bootclasspath, CACAO_VM_ZIP); + strcpy(_Jv_bootclasspath, CACAO_VM_ZIP); strcat(_Jv_bootclasspath, ":"); -# endif strcat(_Jv_bootclasspath, CLASSPATH_CLASSES); +# elif defined(WITH_CLASSPATH_SUN) + strcpy(_Jv_bootclasspath, + CLASSPATH_PREFIX"/lib/resources.jar:" + CLASSPATH_PREFIX"/lib/rt.jar:" + CLASSPATH_PREFIX"/lib/sunrsasign.jar:" + CLASSPATH_PREFIX"/lib/jsse.jar:" + CLASSPATH_PREFIX"/lib/jce.jar:" + CLASSPATH_PREFIX"/lib/charsets.jar:" + CLASSPATH_PREFIX"/classes"); +# elif defined(WITH_CLASSPATH_CLDC1_1) + strcat(_Jv_bootclasspath, CLASSPATH_CLASSES); +# else +# error unknown classpath configuration +# endif #endif } @@ -928,7 +974,7 @@ bool vm_create(JavaVMInitArgs *vm_args) strcpy(_Jv_classpath, "."); } - /* get and set java.library.path */ + /* Get and set java.library.path. */ _Jv_java_library_path = getenv("LD_LIBRARY_PATH"); @@ -952,10 +998,18 @@ bool vm_create(JavaVMInitArgs *vm_args) jvmti = false; #endif - /* initialize and fill properties before command-line handling */ + /* Initialize and fill properties before command-line handling. */ if (!properties_init()) - vm_abort("properties_init failed"); + vm_abort("vm_create: properties_init failed"); + + /* Set the classpath properties. */ + +#if defined(ENABLE_JAVASE) + properties_add("java.boot.class.path", _Jv_bootclasspath); + properties_add("sun.boot.class.path", _Jv_bootclasspath); + properties_add("java.class.path", _Jv_classpath); +#endif /* iterate over all passed options */ @@ -992,6 +1046,10 @@ bool vm_create(JavaVMInitArgs *vm_args) _Jv_classpath = MNEW(char, strlen(opt_arg) + strlen("0")); strcpy(_Jv_classpath, opt_arg); + +#if defined(ENABLE_JAVASE) + properties_add("java.class.path", _Jv_classpath); +#endif break; case OPT_D: @@ -1018,6 +1076,11 @@ bool vm_create(JavaVMInitArgs *vm_args) _Jv_bootclasspath = MNEW(char, strlen(opt_arg) + strlen("0")); strcpy(_Jv_bootclasspath, opt_arg); + +#if defined(ENABLE_JAVASE) + properties_add("java.boot.class.path", _Jv_bootclasspath); + properties_add("sun.boot.class.path", _Jv_bootclasspath); +#endif break; case OPT_BOOTCLASSPATH_A: @@ -1033,6 +1096,11 @@ bool vm_create(JavaVMInitArgs *vm_args) strcat(_Jv_bootclasspath, ":"); strcat(_Jv_bootclasspath, opt_arg); + +#if defined(ENABLE_JAVASE) + properties_add("java.boot.class.path", _Jv_bootclasspath); + properties_add("sun.boot.class.path", _Jv_bootclasspath); +#endif break; case OPT_BOOTCLASSPATH_P: @@ -1049,6 +1117,11 @@ bool vm_create(JavaVMInitArgs *vm_args) strcat(_Jv_bootclasspath, cp); MFREE(cp, char, len); + +#if defined(ENABLE_JAVASE) + properties_add("java.boot.class.path", _Jv_bootclasspath); + properties_add("sun.boot.class.path", _Jv_bootclasspath); +#endif break; case OPT_BOOTCLASSPATH_C: @@ -1066,6 +1139,11 @@ bool vm_create(JavaVMInitArgs *vm_args) strcpy(_Jv_bootclasspath, CACAO_VM_ZIP); strcat(_Jv_bootclasspath, ":"); strcat(_Jv_bootclasspath, opt_arg); + +#if defined(ENABLE_JAVASE) + properties_add("java.boot.class.path", _Jv_bootclasspath); + properties_add("sun.boot.class.path", _Jv_bootclasspath); +#endif break; #if defined(ENABLE_JVMTI) @@ -1145,28 +1223,12 @@ bool vm_create(JavaVMInitArgs *vm_args) opt_verbosejni = true; } #if !defined(NDEBUG) - else if (strcmp("call", opt_arg) == 0) { - opt_verbosecall = true; - } - else if (strcmp("exception", opt_arg) == 0) { - opt_verboseexception = true; - } else if (strcmp("jit", opt_arg) == 0) { opt_verbose = true; loadverbose = true; - linkverbose = true; initverbose = true; compileverbose = true; } - else if (strcmp("memory", opt_arg) == 0) { - opt_verbosememory = true; - -# if defined(ENABLE_STATISTICS) - /* we also need statistics */ - - opt_stat = true; -# endif - } else if (strcmp("threads", opt_arg) == 0) { opt_verbosethreads = true; } @@ -1245,10 +1307,6 @@ bool vm_create(JavaVMInitArgs *vm_args) makeinitializations = false; break; - case OPT_EAGER: - opt_eager = true; - break; - #if !defined(NDEBUG) case OPT_ALL: compileall = true; @@ -1336,12 +1394,6 @@ bool vm_create(JavaVMInitArgs *vm_args) case OPT_INLINE_DEBUG_MAX: opt_inline_debug_max_size = atoi(opt_arg); break; - case OPT_INLINE_REPLACE_VERBOSE: - opt_replace_verbose = 1; - break; - case OPT_INLINE_REPLACE_VERBOSE2: - opt_replace_verbose = 2; - break; #endif /* defined(ENABLE_INLINING_DEBUG) */ #if !defined(NDEBUG) case OPT_INLINE_LOG: @@ -1501,6 +1553,10 @@ bool vm_create(JavaVMInitArgs *vm_args) _Jv_classpath = MNEW(char, strlen(mainstring) + strlen("0")); strcpy(_Jv_classpath, mainstring); + +#if defined(ENABLE_JAVASE) + properties_add("java.class.path", _Jv_classpath); +#endif } else { /* replace .'s with /'s in classname */ @@ -1527,17 +1583,17 @@ bool vm_create(JavaVMInitArgs *vm_args) vm_initializing = true; + /* initialize the garbage collector */ + + gc_init(opt_heapmaxsize, opt_heapstartsize); + #if defined(ENABLE_THREADS) - /* pre-initialize some core thread stuff, like the stopworldlock, - thus this has to happen _before_ gc_init()!!! */ + /* AFTER: gc_init (directly after, as this initializes the + stopworldlock lock */ threads_preinit(); #endif - /* initialize the garbage collector */ - - gc_init(opt_heapmaxsize, opt_heapstartsize); - /* install architecture dependent signal handlers */ if (!signal_init()) @@ -1581,16 +1637,6 @@ bool vm_create(JavaVMInitArgs *vm_args) suck_add(_Jv_bootclasspath); - /* Now re-set some of the properties that may have changed. This - must be done after _all_ environment variables have been - processes (e.g. -jar handling). - - AFTER: suck_add_from_property, since it may change the - _Jv_bootclasspath pointer. */ - - if (!properties_postinit()) - vm_abort("vm_create: properties_postinit failed"); - /* initialize the classcache hashtable stuff: lock, hashtable (must be done _after_ threads_preinit) */ @@ -1645,16 +1691,23 @@ bool vm_create(JavaVMInitArgs *vm_args) if (!primitive_init()) vm_abort("vm_create: primitive_init failed"); + if (!exceptions_init()) + vm_abort("vm_create: exceptions_init failed"); + + if (!builtin_init()) + vm_abort("vm_create: builtin_init failed"); + /* Initialize the native subsystem. */ + /* BEFORE: threads_init */ if (!native_init()) vm_abort("vm_create: native_init failed"); - if (!exceptions_init()) - vm_abort("vm_create: exceptions_init failed"); + /* Register the native methods implemented in the VM. */ + /* BEFORE: threads_init */ - if (!builtin_init()) - vm_abort("vm_create: builtin_init failed"); + if (!nativevm_preinit()) + vm_abort("vm_create: nativevm_preinit failed"); #if defined(ENABLE_JNI) /* Initialize the JNI subsystem (must be done _before_ @@ -1670,6 +1723,12 @@ bool vm_create(JavaVMInitArgs *vm_args) vm_abort("vm_create: threads_init failed"); #endif + /* Initialize the native VM subsystem. */ + /* AFTER: threads_init (at least for SUN's classes) */ + + if (!nativevm_init()) + vm_abort("vm_create: nativevm_init failed"); + #if defined(ENABLE_PROFILING) /* initialize profiling */ @@ -1700,7 +1759,7 @@ bool vm_create(JavaVMInitArgs *vm_args) # if !defined(NDEBUG) /* start the memory profiling thread */ - if (opt_verbosememory) + if (opt_ProfileMemoryUsage || opt_ProfileGCMemoryUsage) if (!memory_start_thread()) vm_abort("vm_create: memory_start_thread failed"); # endif @@ -2342,11 +2401,15 @@ static void vm_array_store_int(uint64_t *array, paramdesc *pd, int32_t value) array[index] = (int64_t) value; } else { - index = ARG_CNT + pd->regoff; -#if WORDS_BIGENDIAN == 1 && !defined(__POWERPC64__) - array[index] = ((int64_t) value) << 32; + index = ARG_CNT + pd->index; +#if SIZEOF_VOID_P == 8 + array[index] = (int64_t) value; #else +# if WORDS_BIGENDIAN == 1 + array[index] = ((int64_t) value) << 32; +# else array[index] = (int64_t) value; +# endif #endif } } @@ -2367,7 +2430,7 @@ static void vm_array_store_lng(uint64_t *array, paramdesc *pd, int64_t value) if (!pd->inmemory) index = pd->index; else - index = ARG_CNT + pd->regoff; + index = ARG_CNT + pd->index; array[index] = value; #else @@ -2381,7 +2444,7 @@ static void vm_array_store_lng(uint64_t *array, paramdesc *pd, int64_t value) array[index] = value >> 32; } else { - index = ARG_CNT + pd->regoff; + index = ARG_CNT + pd->index; array[index] = value; } #endif @@ -2400,16 +2463,24 @@ static void vm_array_store_flt(uint64_t *array, paramdesc *pd, uint64_t value) int32_t index; if (!pd->inmemory) { +#if defined(SUPPORT_PASS_FLOATARGS_IN_INTREGS) + index = pd->index; +#else index = INT_ARG_CNT + pd->index; -#if WORDS_BIGENDIAN == 1 && !defined(__POWERPC64__) +#endif +#if WORDS_BIGENDIAN == 1 && !defined(__POWERPC__) && !defined(__POWERPC64__) array[index] = value >> 32; #else array[index] = value; #endif } else { - index = ARG_CNT + pd->regoff; + index = ARG_CNT + pd->index; +#if defined(__SPARC_64__) + array[index] = value >> 32; +#else array[index] = value; +#endif } } @@ -2425,12 +2496,22 @@ static void vm_array_store_dbl(uint64_t *array, paramdesc *pd, uint64_t value) { int32_t index; - if (!pd->inmemory) - index = INT_ARG_CNT + pd->index; - else - index = ARG_CNT + pd->regoff; + if (!pd->inmemory) { +#if SIZEOF_VOID_P != 8 && defined(SUPPORT_PASS_FLOATARGS_IN_INTREGS) + index = GET_LOW_REG(pd->index); + array[index] = value & 0x00000000ffffffff; - array[index] = value; + index = GET_HIGH_REG(pd->index); + array[index] = value >> 32; +#else + index = INT_ARG_CNT + pd->index; + array[index] = value; +#endif + } + else { + index = ARG_CNT + pd->index; + array[index] = value; + } } @@ -2457,11 +2538,11 @@ static void vm_array_store_adr(uint64_t *array, paramdesc *pd, void *value) array[index] = (uint64_t) (intptr_t) value; } else { - index = ARG_CNT + pd->regoff; + index = ARG_CNT + pd->index; #if SIZEOF_VOID_P == 8 array[index] = (uint64_t) (intptr_t) value; #else -# if WORDS_BIGENDIAN == 1 && !defined(__POWERPC64__) +# if WORDS_BIGENDIAN == 1 array[index] = ((uint64_t) (intptr_t) value) << 32; # else array[index] = (uint64_t) (intptr_t) value; @@ -2471,70 +2552,12 @@ static void vm_array_store_adr(uint64_t *array, paramdesc *pd, void *value) } -/* vm_vmargs_from_valist ******************************************************* +/* vm_array_from_valist ******************************************************** XXX *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -static void vm_vmargs_from_valist(methodinfo *m, java_objectheader *o, - vm_arg *vmargs, va_list ap) -{ - typedesc *paramtypes; - s4 i; - - paramtypes = m->parseddesc->paramtypes; - - /* if method is non-static fill first block and skip `this' pointer */ - - i = 0; - - if (o != NULL) { - /* the `this' pointer */ - vmargs[0].type = TYPE_ADR; - vmargs[0].data.l = (u8) (ptrint) o; - - paramtypes++; - i++; - } - - for (; i < m->parseddesc->paramcount; i++, paramtypes++) { - switch (paramtypes->type) { - case TYPE_INT: - vmargs[i].type = TYPE_INT; - vmargs[i].data.l = (s8) va_arg(ap, s4); - break; - - case TYPE_LNG: - vmargs[i].type = TYPE_LNG; - vmargs[i].data.l = (s8) va_arg(ap, s8); - break; - - case TYPE_FLT: - vmargs[i].type = TYPE_FLT; -#if defined(__ALPHA__) - /* this keeps the assembler function much simpler */ - - vmargs[i].data.d = (jdouble) va_arg(ap, jdouble); -#else - vmargs[i].data.f = (jfloat) va_arg(ap, jdouble); -#endif - break; - - case TYPE_DBL: - vmargs[i].type = TYPE_DBL; - vmargs[i].data.d = (jdouble) va_arg(ap, jdouble); - break; - - case TYPE_ADR: - vmargs[i].type = TYPE_ADR; - vmargs[i].data.l = (u8) (ptrint) va_arg(ap, void*); - break; - } - } -} -#else uint64_t *vm_array_from_valist(methodinfo *m, java_objectheader *o, va_list ap) { methoddesc *md; @@ -2580,8 +2603,9 @@ uint64_t *vm_array_from_valist(methodinfo *m, java_objectheader *o, va_list ap) break; case TYPE_FLT: -#if defined(__ALPHA__) || defined(__POWERPC64__) - /* this keeps the assembler function much simpler */ +#if defined(__ALPHA__) || defined(__POWERPC__) || defined(__POWERPC64__) + /* This is required to load the correct float value in + assembler code. */ value.d = (double) va_arg(ap, double); #else @@ -2604,76 +2628,16 @@ uint64_t *vm_array_from_valist(methodinfo *m, java_objectheader *o, va_list ap) return array; } -#endif -/* vm_vmargs_from_jvalue ******************************************************* +/* vm_array_from_jvalue ******************************************************** XXX *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -static void vm_vmargs_from_jvalue(methodinfo *m, java_objectheader *o, - vm_arg *vmargs, jvalue *args) -{ - typedesc *paramtypes; - s4 i; - s4 j; - - paramtypes = m->parseddesc->paramtypes; - - /* if method is non-static fill first block and skip `this' pointer */ - - i = 0; - - if (o != NULL) { - /* the `this' pointer */ - vmargs[0].type = TYPE_ADR; - vmargs[0].data.l = (u8) (ptrint) o; - - paramtypes++; - i++; - } - - for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) { - switch (paramtypes->decltype) { - case TYPE_INT: - vmargs[i].type = TYPE_INT; - vmargs[i].data.l = (s8) args[j].i; - break; - - case TYPE_LNG: - vmargs[i].type = TYPE_LNG; - vmargs[i].data.l = (s8) args[j].j; - break; - - case TYPE_FLT: - vmargs[i].type = TYPE_FLT; -#if defined(__ALPHA__) - /* this keeps the assembler function much simpler */ - - vmargs[i].data.d = (jdouble) args[j].f; -#else - vmargs[i].data.f = args[j].f; -#endif - break; - - case TYPE_DBL: - vmargs[i].type = TYPE_DBL; - vmargs[i].data.d = args[j].d; - break; - - case TYPE_ADR: - vmargs[i].type = TYPE_ADR; - vmargs[i].data.l = (u8) (ptrint) args[j].l; - break; - } - } -} -#else static uint64_t *vm_array_from_jvalue(methodinfo *m, java_objectheader *o, - jvalue *args) + const jvalue *args) { methoddesc *md; paramdesc *pd; @@ -2735,26 +2699,36 @@ static uint64_t *vm_array_from_jvalue(methodinfo *m, java_objectheader *o, return array; } -#endif -/* vm_vmargs_from_objectarray ************************************************** + +/* vm_array_from_objectarray *************************************************** XXX *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -bool vm_vmargs_from_objectarray(methodinfo *m, java_objectheader *o, - vm_arg *vmargs, java_objectarray *params) +uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o, + java_objectarray *params) { + methoddesc *md; + paramdesc *pd; + typedesc *td; + uint64_t *array; java_objectheader *param; - typedesc *paramtypes; classinfo *c; int32_t i; int32_t j; - int64_t value; + imm_union value; + + /* get the descriptors */ + + md = m->parseddesc; + pd = md->params; + td = md->paramtypes; + + /* allocate argument array */ - paramtypes = m->parseddesc->paramtypes; + array = DMNEW(uint64_t, INT_ARG_CNT + FLT_ARG_CNT + md->memuse); /* if method is non-static fill first block and skip `this' pointer */ @@ -2762,240 +2736,63 @@ bool vm_vmargs_from_objectarray(methodinfo *m, java_objectheader *o, if (o != NULL) { /* this pointer */ - vmargs[0].type = TYPE_ADR; - vmargs[0].data.l = (uint64_t) (intptr_t) o; + vm_array_store_adr(array, pd, o); - paramtypes++; + pd++; + td++; i++; } - for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) { - switch (paramtypes->type) { - /* primitive types */ - case TYPE_INT: - case TYPE_LNG: - case TYPE_FLT: - case TYPE_DBL: - param = params->data[j]; + for (j = 0; i < md->paramcount; i++, j++, pd++, td++) { + param = params->data[j]; + switch (td->type) { + case TYPE_INT: if (param == NULL) goto illegal_arg; - /* internally used data type */ - vmargs[i].type = paramtypes->type; - /* convert the value according to its declared type */ c = param->vftbl->class; - switch (paramtypes->decltype) { + switch (td->decltype) { case PRIMITIVETYPE_BOOLEAN: if (c == class_java_lang_Boolean) - value = (int64_t) ((java_lang_Boolean *) param)->value; + LLNI_field_get_val((java_lang_Boolean *) param, value, value.i); else goto illegal_arg; - - vmargs[i].data.l = value; break; case PRIMITIVETYPE_BYTE: if (c == class_java_lang_Byte) - value = (int64_t) ((java_lang_Byte *) param)->value; + LLNI_field_get_val((java_lang_Byte *) param, value, value.i); else goto illegal_arg; - - vmargs[i].data.l = value; break; case PRIMITIVETYPE_CHAR: if (c == class_java_lang_Character) - value = (int64_t) ((java_lang_Character *) param)->value; + LLNI_field_get_val((java_lang_Character *) param, value, value.i); else goto illegal_arg; - - vmargs[i].data.l = value; break; case PRIMITIVETYPE_SHORT: if (c == class_java_lang_Short) - value = (int64_t) ((java_lang_Short *) param)->value; + LLNI_field_get_val((java_lang_Short *) param, value, value.i); else if (c == class_java_lang_Byte) - value = (int64_t) ((java_lang_Byte *) param)->value; + LLNI_field_get_val((java_lang_Byte *) param, value, value.i); else goto illegal_arg; - - vmargs[i].data.l = value; break; case PRIMITIVETYPE_INT: if (c == class_java_lang_Integer) - value = (int64_t) ((java_lang_Integer *) param)->value; + LLNI_field_get_val((java_lang_Integer *) param, value, value.i); else if (c == class_java_lang_Short) - value = (int64_t) ((java_lang_Short *) param)->value; + LLNI_field_get_val((java_lang_Short *) param, value, value.i); else if (c == class_java_lang_Byte) - value = (int64_t) ((java_lang_Byte *) param)->value; - else - goto illegal_arg; - - vmargs[i].data.l = value; - break; - - case PRIMITIVETYPE_LONG: - if (c == class_java_lang_Long) - value = (int64_t) ((java_lang_Long *) param)->value; - else if (c == class_java_lang_Integer) - value = (int64_t) ((java_lang_Integer *) param)->value; - else if (c == class_java_lang_Short) - value = (int64_t) ((java_lang_Short *) param)->value; - else if (c == class_java_lang_Byte) - value = (int64_t) ((java_lang_Byte *) param)->value; - else - goto illegal_arg; - - vmargs[i].data.l = value; - break; - - case PRIMITIVETYPE_FLOAT: - if (c == class_java_lang_Float) - vmargs[i].data.f = (jfloat) ((java_lang_Float *) param)->value; - else - goto illegal_arg; - break; - - case PRIMITIVETYPE_DOUBLE: - if (c == class_java_lang_Double) - vmargs[i].data.d = (jdouble) ((java_lang_Double *) param)->value; - else if (c == class_java_lang_Float) - vmargs[i].data.f = (jfloat) ((java_lang_Float *) param)->value; - else - goto illegal_arg; - break; - - default: - goto illegal_arg; - } - break; - - case TYPE_ADR: - if (!resolve_class_from_typedesc(paramtypes, true, true, &c)) - return false; - - if (params->data[j] != 0) { - if (paramtypes->arraydim > 0) { - if (!builtin_arrayinstanceof(params->data[j], c)) - goto illegal_arg; - - } else { - if (!builtin_instanceof(params->data[j], c)) - goto illegal_arg; - } - } - - vmargs[i].type = TYPE_ADR; - vmargs[i].data.l = (u8) (ptrint) params->data[j]; - break; - - default: - goto illegal_arg; - } - } - -/* if (rettype) */ -/* *rettype = descr->returntype.decltype; */ - - return true; - -illegal_arg: - exceptions_throw_illegalargumentexception(); - return false; -} -#else -uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o, - java_objectarray *params) -{ - methoddesc *md; - paramdesc *pd; - typedesc *td; - uint64_t *array; - java_objectheader *param; - classinfo *c; - int32_t i; - int32_t j; - imm_union value; - - /* get the descriptors */ - - md = m->parseddesc; - pd = md->params; - td = md->paramtypes; - - /* allocate argument array */ - - array = DMNEW(uint64_t, INT_ARG_CNT + FLT_ARG_CNT + md->memuse); - - /* if method is non-static fill first block and skip `this' pointer */ - - i = 0; - - if (o != NULL) { - /* this pointer */ - vm_array_store_adr(array, pd, o); - - pd++; - td++; - i++; - } - - for (j = 0; i < md->paramcount; i++, j++, pd++, td++) { - param = params->data[j]; - - switch (td->type) { - case TYPE_INT: - if (param == NULL) - goto illegal_arg; - - /* convert the value according to its declared type */ - - c = param->vftbl->class; - - switch (td->decltype) { - case PRIMITIVETYPE_BOOLEAN: - if (c == class_java_lang_Boolean) - value.i = ((java_lang_Boolean *) param)->value; - else - goto illegal_arg; - break; - - case PRIMITIVETYPE_BYTE: - if (c == class_java_lang_Byte) - value.i = ((java_lang_Byte *) param)->value; - else - goto illegal_arg; - break; - - case PRIMITIVETYPE_CHAR: - if (c == class_java_lang_Character) - value.i = ((java_lang_Character *) param)->value; - else - goto illegal_arg; - break; - - case PRIMITIVETYPE_SHORT: - if (c == class_java_lang_Short) - value.i = ((java_lang_Short *) param)->value; - else if (c == class_java_lang_Byte) - value.i = ((java_lang_Byte *) param)->value; - else - goto illegal_arg; - break; - - case PRIMITIVETYPE_INT: - if (c == class_java_lang_Integer) - value.i = ((java_lang_Integer *) param)->value; - else if (c == class_java_lang_Short) - value.i = ((java_lang_Short *) param)->value; - else if (c == class_java_lang_Byte) - value.i = ((java_lang_Byte *) param)->value; + LLNI_field_get_val((java_lang_Byte *) param, value, value.i); else goto illegal_arg; break; @@ -3018,13 +2815,13 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o, switch (td->decltype) { case PRIMITIVETYPE_LONG: if (c == class_java_lang_Long) - value.l = ((java_lang_Long *) param)->value; + LLNI_field_get_val((java_lang_Long *) param, value, value.l); else if (c == class_java_lang_Integer) - value.l = (int64_t) ((java_lang_Integer *) param)->value; + value.l = (int64_t) LLNI_field_direct(((java_lang_Integer *) param), value); else if (c == class_java_lang_Short) - value.l = (int64_t) ((java_lang_Short *) param)->value; + value.l = (int64_t) LLNI_field_direct(((java_lang_Short *) param), value); else if (c == class_java_lang_Byte) - value.l = (int64_t) ((java_lang_Byte *) param)->value; + value.l = (int64_t) LLNI_field_direct(((java_lang_Byte *) param), value); else goto illegal_arg; break; @@ -3047,7 +2844,7 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o, switch (td->decltype) { case PRIMITIVETYPE_FLOAT: if (c == class_java_lang_Float) - value.f = ((java_lang_Float *) param)->value; + LLNI_field_get_val((java_lang_Float *) param, value, value.f); else goto illegal_arg; break; @@ -3070,9 +2867,9 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o, switch (td->decltype) { case PRIMITIVETYPE_DOUBLE: if (c == class_java_lang_Double) - value.d = ((java_lang_Double *) param)->value; + LLNI_field_get_val((java_lang_Double *) param, value, value.d); else if (c == class_java_lang_Float) - value.f = ((java_lang_Float *) param)->value; + LLNI_field_get_val((java_lang_Float *) param, value, value.f); else goto illegal_arg; break; @@ -3113,7 +2910,6 @@ illegal_arg: exceptions_throw_illegalargumentexception(); return NULL; } -#endif /* vm_call_method ************************************************************** @@ -3146,38 +2942,6 @@ java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...) java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o, va_list ap) { -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) - s4 vmargscount; - vm_arg *vmargs; - java_objectheader *ro; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_valist(m, o, vmargs, ap); - - /* call the Java method */ - - ro = vm_call_method_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return ro; -#else java_objectheader *ro; int32_t dumpsize; uint64_t *array; @@ -3199,7 +2963,6 @@ java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o, dump_release(dumpsize); return ro; -#endif } @@ -3211,40 +2974,8 @@ java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o, *******************************************************************************/ java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o, - jvalue *args) + const jvalue *args) { -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) - s4 vmargscount; - vm_arg *vmargs; - java_objectheader *ro; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_jvalue(m, o, vmargs, args); - - /* call the Java method */ - - ro = vm_call_method_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return ro; -#else java_objectheader *ro; int32_t dumpsize; uint64_t *array; @@ -3266,7 +2997,6 @@ java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o, dump_release(dumpsize); return ro; -#endif } @@ -3277,28 +3007,6 @@ java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o, *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount, - vm_arg *vmargs) -{ - java_objectheader *o; - - STATISTICS(count_calls_native_to_java++); - -#if defined(ENABLE_JIT) -# if defined(ENABLE_INTRP) - if (opt_intrp) - o = intrp_asm_vm_call_method(m, vmargscount, vmargs); - else -# endif - o = asm_vm_call_method(m, vmargscount, vmargs); -#else - o = intrp_asm_vm_call_method(m, vmargscount, vmargs); -#endif - - return o; -} -#else java_objectheader *vm_call_array(methodinfo *m, uint64_t *array) { methoddesc *md; @@ -3327,7 +3035,6 @@ java_objectheader *vm_call_array(methodinfo *m, uint64_t *array) return o; } -#endif /* vm_call_int_array *********************************************************** @@ -3337,27 +3044,6 @@ java_objectheader *vm_call_array(methodinfo *m, uint64_t *array) *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs) -{ - s4 i; - - STATISTICS(count_calls_native_to_java++); - -#if defined(ENABLE_JIT) -# if defined(ENABLE_INTRP) - if (opt_intrp) - i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs); - else -# endif - i = asm_vm_call_method_int(m, vmargscount, vmargs); -#else - i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs); -#endif - - return i; -} -#else int32_t vm_call_int_array(methodinfo *m, uint64_t *array) { methoddesc *md; @@ -3386,7 +3072,6 @@ int32_t vm_call_int_array(methodinfo *m, uint64_t *array) return i; } -#endif /* vm_call_method_int ********************************************************** @@ -3416,41 +3101,6 @@ s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...) *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap) -{ - s4 vmargscount; - vm_arg *vmargs; - s4 i; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_valist(m, o, vmargs, ap); - - /* call the Java method */ - - i = vm_call_method_int_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return i; -} -#else int32_t vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap) { int32_t dumpsize; @@ -3475,7 +3125,6 @@ int32_t vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list a return i; } -#endif /* vm_call_method_int_jvalue *************************************************** @@ -3485,42 +3134,8 @@ int32_t vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list a *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) -{ - s4 vmargscount; - vm_arg *vmargs; - s4 i; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_jvalue(m, o, vmargs, args); - - /* call the Java method */ - - i = vm_call_method_int_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return i; -} -#else -int32_t vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) +int32_t vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, + const jvalue *args) { int32_t dumpsize; uint64_t *array; @@ -3544,7 +3159,6 @@ int32_t vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *a return i; } -#endif /* vm_call_long_array ********************************************************** @@ -3554,27 +3168,6 @@ int32_t vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *a *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs) -{ - s8 l; - - STATISTICS(count_calls_native_to_java++); - -#if defined(ENABLE_JIT) -# if defined(ENABLE_INTRP) - if (opt_intrp) - l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs); - else -# endif - l = asm_vm_call_method_long(m, vmargscount, vmargs); -#else - l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs); -#endif - - return l; -} -#else int64_t vm_call_long_array(methodinfo *m, uint64_t *array) { methoddesc *md; @@ -3603,7 +3196,6 @@ int64_t vm_call_long_array(methodinfo *m, uint64_t *array) return l; } -#endif /* vm_call_method_long ********************************************************* @@ -3633,41 +3225,6 @@ s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...) *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap) -{ - s4 vmargscount; - vm_arg *vmargs; - s8 l; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_valist(m, o, vmargs, ap); - - /* call the Java method */ - - l = vm_call_method_long_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return l; -} -#else int64_t vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap) { int32_t dumpsize; @@ -3692,7 +3249,6 @@ int64_t vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list return l; } -#endif /* vm_call_method_long_jvalue ************************************************** @@ -3702,42 +3258,8 @@ int64_t vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) -{ - s4 vmargscount; - vm_arg *vmargs; - s8 l; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_jvalue(m, o, vmargs, args); - - /* call the Java method */ - - l = vm_call_method_long_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return l; -} -#else -int64_t vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) +int64_t vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, + const jvalue *args) { int32_t dumpsize; uint64_t *array; @@ -3761,7 +3283,6 @@ int64_t vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue * return l; } -#endif /* vm_call_float_array ********************************************************* @@ -3771,29 +3292,6 @@ int64_t vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue * *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs) -{ - float f; - - vm_abort("IMPLEMENT ME!"); - - STATISTICS(count_calls_native_to_java++); - -#if defined(ENABLE_JIT) -# if defined(ENABLE_INTRP) - if (opt_intrp) - f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs); - else -# endif - f = asm_vm_call_method_float(m, vmargscount, vmargs); -#else - f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs); -#endif - - return f; -} -#else float vm_call_float_array(methodinfo *m, uint64_t *array) { methoddesc *md; @@ -3822,7 +3320,6 @@ float vm_call_float_array(methodinfo *m, uint64_t *array) return f; } -#endif /* vm_call_method_float ******************************************************** @@ -3852,42 +3349,6 @@ float vm_call_method_float(methodinfo *m, java_objectheader *o, ...) *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -float vm_call_method_float_valist(methodinfo *m, java_objectheader *o, - va_list ap) -{ - s4 vmargscount; - vm_arg *vmargs; - float f; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_valist(m, o, vmargs, ap); - - /* call the Java method */ - - f = vm_call_method_float_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return f; -} -#else float vm_call_method_float_valist(methodinfo *m, java_objectheader *o, va_list ap) { int32_t dumpsize; @@ -3912,7 +3373,6 @@ float vm_call_method_float_valist(methodinfo *m, java_objectheader *o, va_list a return f; } -#endif /* vm_call_method_float_jvalue ************************************************* @@ -3922,43 +3382,7 @@ float vm_call_method_float_valist(methodinfo *m, java_objectheader *o, va_list a *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o, - jvalue *args) -{ - s4 vmargscount; - vm_arg *vmargs; - float f; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_jvalue(m, o, vmargs, args); - - /* call the Java method */ - - f = vm_call_method_float_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return f; -} -#else -float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) +float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o, const jvalue *args) { int32_t dumpsize; uint64_t *array; @@ -3982,7 +3406,6 @@ float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o, jvalue *a return f; } -#endif /* vm_call_double_array ******************************************************** @@ -3992,30 +3415,6 @@ float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o, jvalue *a *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount, - vm_arg *vmargs) -{ - double d; - - vm_abort("IMPLEMENT ME!"); - - STATISTICS(count_calls_native_to_java++); - -#if defined(ENABLE_JIT) -# if defined(ENABLE_INTRP) - if (opt_intrp) - d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs); - else -# endif - d = asm_vm_call_method_double(m, vmargscount, vmargs); -#else - d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs); -#endif - - return d; -} -#else double vm_call_double_array(methodinfo *m, uint64_t *array) { methoddesc *md; @@ -4044,7 +3443,6 @@ double vm_call_double_array(methodinfo *m, uint64_t *array) return d; } -#endif /* vm_call_method_double ******************************************************* @@ -4074,42 +3472,6 @@ double vm_call_method_double(methodinfo *m, java_objectheader *o, ...) *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -double vm_call_method_double_valist(methodinfo *m, java_objectheader *o, - va_list ap) -{ - s4 vmargscount; - vm_arg *vmargs; - double d; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_valist(m, o, vmargs, ap); - - /* call the Java method */ - - d = vm_call_method_double_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return d; -} -#else double vm_call_method_double_valist(methodinfo *m, java_objectheader *o, va_list ap) { int32_t dumpsize; @@ -4134,7 +3496,6 @@ double vm_call_method_double_valist(methodinfo *m, java_objectheader *o, va_list return d; } -#endif /* vm_call_method_double_jvalue ************************************************ @@ -4144,43 +3505,7 @@ double vm_call_method_double_valist(methodinfo *m, java_objectheader *o, va_list *******************************************************************************/ -#if !defined(__MIPS__) && !defined(__X86_64__) && !defined(__POWERPC64__) -double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o, - jvalue *args) -{ - s4 vmargscount; - vm_arg *vmargs; - double d; - s4 dumpsize; - - /* mark start of dump memory area */ - - dumpsize = dump_size(); - - /* get number of Java method arguments */ - - vmargscount = m->parseddesc->paramcount; - - /* allocate vm_arg array */ - - vmargs = DMNEW(vm_arg, vmargscount); - - /* fill the vm_arg array from a va_list */ - - vm_vmargs_from_jvalue(m, o, vmargs, args); - - /* call the Java method */ - - d = vm_call_method_double_vmarg(m, vmargscount, vmargs); - - /* release dump area */ - - dump_release(dumpsize); - - return d; -} -#else -double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o, jvalue *args) +double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o, const jvalue *args) { int32_t dumpsize; uint64_t *array; @@ -4204,7 +3529,6 @@ double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o, jvalue return d; } -#endif /*