1 /* src/vm/vm.c - VM startup and shutdown functions
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
29 Changes: Martin Platter
31 $Id: vm.c 4357 2006-01-22 23:33:38Z twisti $
44 #include "mm/memory.h"
45 #include "native/jni.h"
46 #include "native/native.h"
48 #if defined(ENABLE_THREADS)
49 # include "threads/native/threads.h"
52 #include "vm/classcache.h"
53 #include "vm/exceptions.h"
54 #include "vm/finalizer.h"
55 #include "vm/global.h"
56 #include "vm/initialize.h"
57 #include "vm/options.h"
58 #include "vm/properties.h"
59 #include "vm/signallocal.h"
60 #include "vm/stringlocal.h"
63 #include "vm/jit/jit.h"
64 #include "vm/jit/asmpart.h"
66 #include "vm/jit/recompile.h"
68 #include "vm/jit/profile/profile.h"
69 #include "vm/rt-timing.h"
71 #if defined(ENABLE_JVMTI)
72 #include "native/jvmti/cacaodbg.h"
76 /* Invocation API variables ***************************************************/
78 _Jv_JavaVM *_Jv_jvm; /* denotes a Java VM */
79 _Jv_JNIEnv *_Jv_env; /* pointer to native method interface */
82 /* global variables ***********************************************************/
84 s4 vms = 0; /* number of VMs created */
86 bool vm_initializing = false;
87 bool vm_exiting = false;
89 #if defined(ENABLE_INTRP)
90 u1 *intrp_main_stack = NULL;
93 char *mainstring = NULL;
94 classinfo *mainclass = NULL;
96 char *specificmethodname = NULL;
97 char *specificsignature = NULL;
102 /* define heap sizes **********************************************************/
104 #define HEAP_MAXSIZE 128 * 1024 * 1024 /* default 128MB */
105 #define HEAP_STARTSIZE 2 * 1024 * 1024 /* default 2MB */
106 #define STACK_SIZE 64 * 1024 /* default 64kB */
109 /* define command line options ************************************************/
136 /* Java non-standard options */
159 #if defined(ENABLE_STATISTICS)
176 #if defined(ENABLE_VERIFIER)
178 #if defined(TYPECHECK_VERBOSE)
181 #endif /* defined(ENABLE_VERIFIER) */
184 /* optimization options */
186 #if defined(ENABLE_LOOP)
190 #if defined(ENABLE_IFCONV)
194 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
198 #if defined(ENABLE_INLINING)
202 #if defined(ENABLE_INTRP)
203 /* interpreter options */
226 opt_struct opts[] = {
227 { "foo", false, OPT_FOO },
231 { "jar", false, OPT_JAR },
233 { "d32", false, OPT_D32 },
234 { "d64", false, OPT_D64 },
235 { "client", false, OPT_IGNORE },
236 { "server", false, OPT_IGNORE },
237 { "jvm", false, OPT_IGNORE },
238 { "hotspot", false, OPT_IGNORE },
240 { "classpath", true, OPT_CLASSPATH },
241 { "cp", true, OPT_CLASSPATH },
242 { "D", true, OPT_D },
243 { "version", false, OPT_VERSION },
244 { "showversion", false, OPT_SHOWVERSION },
245 { "fullversion", false, OPT_FULLVERSION },
246 { "help", false, OPT_HELP },
247 { "?", false, OPT_HELP },
248 { "X", false, OPT_X },
250 { "esa", false, OPT_ESA },
251 { "enablesystemassertions", false, OPT_ESA },
252 { "dsa", false, OPT_DSA },
253 { "disablesystemassertions", false, OPT_DSA },
255 { "noasyncgc", false, OPT_IGNORE },
256 #if defined(ENABLE_VERIFIER)
257 { "noverify", false, OPT_NOVERIFY },
259 { "v", false, OPT_VERBOSE1 },
260 { "verbose:", true, OPT_VERBOSE },
262 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
263 { "verbosetc", false, OPT_VERBOSETC },
265 #if defined(__ALPHA__)
266 { "noieee", false, OPT_NOIEEE },
268 { "softnull", false, OPT_SOFTNULL },
269 #if defined(ENABLE_STATISTICS)
270 { "time", false, OPT_TIME },
271 { "stat", false, OPT_STAT },
273 { "log", true, OPT_LOG },
274 { "c", true, OPT_CHECK },
275 { "l", false, OPT_LOAD },
276 { "eager", false, OPT_EAGER },
279 { "all", false, OPT_ALL },
280 { "sig", true, OPT_SIGNATURE },
283 #if defined(ENABLE_LOOP)
284 { "oloop", false, OPT_OLOOP },
286 #if defined(ENABLE_IFCONV)
287 { "ifconv", false, OPT_IFCONV },
289 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
290 { "lsra", false, OPT_LSRA },
293 #if defined(ENABLE_INTRP)
294 /* interpreter options */
296 { "trace", false, OPT_TRACE },
297 { "static-supers", true, OPT_STATIC_SUPERS },
298 { "no-dynamic", false, OPT_NO_DYNAMIC },
299 { "no-replication", false, OPT_NO_REPLICATION },
300 { "no-quicksuper", false, OPT_NO_QUICKSUPER },
303 /* JVMTI Agent Command Line Options */
305 { "agentlib:", true, OPT_AGENTLIB },
306 { "agentpath:", true, OPT_AGENTPATH },
309 /* Java non-standard options */
311 { "Xjit", false, OPT_JIT },
312 { "Xint", false, OPT_INTRP },
313 { "Xbootclasspath:", true, OPT_BOOTCLASSPATH },
314 { "Xbootclasspath/a:", true, OPT_BOOTCLASSPATH_A },
315 { "Xbootclasspath/p:", true, OPT_BOOTCLASSPATH_P },
316 { "Xglibj:", true, OPT_GLIBJ },
319 { "Xdebug", false, OPT_DEBUG },
320 { "Xnoagent", false, OPT_NOAGENT },
321 { "Xrunjdwp", true, OPT_XRUNJDWP },
324 { "Xms", true, OPT_MS },
325 { "ms", true, OPT_MS },
326 { "Xmx", true, OPT_MX },
327 { "mx", true, OPT_MX },
328 { "Xss", true, OPT_SS },
329 { "ss", true, OPT_SS },
330 { "Xprof:", true, OPT_PROF_OPTION },
331 { "Xprof", false, OPT_PROF },
333 /* keep these at the end of the list */
335 #if defined(ENABLE_INLINING)
336 { "i", true, OPT_INLINING },
340 { "m", true, OPT_METHOD },
343 { "s", true, OPT_SHOW },
344 { "debug-color", false, OPT_DEBUGCOLOR },
350 /* usage ***********************************************************************
352 Prints the correct usage syntax to stdout.
354 *******************************************************************************/
358 puts("Usage: cacao [-options] classname [arguments]");
359 puts(" (to run a class file)");
360 puts(" or cacao [-options] -jar jarfile [arguments]");
361 puts(" (to run a standalone jar file)\n");
363 puts("Java options:");
364 puts(" -d32 use 32-bit data model if available");
365 puts(" -d64 use 64-bit data model if available");
366 puts(" -client compatibility (currently ignored)");
367 puts(" -server compatibility (currently ignored)");
368 puts(" -jvm compatibility (currently ignored)");
369 puts(" -hotspot compatibility (currently ignored)\n");
371 puts(" -cp <path> specify a path to look for classes");
372 puts(" -classpath <path> specify a path to look for classes");
373 puts(" -D<name>=<value> add an entry to the property list");
374 puts(" -verbose[:class|gc|jni] enable specific verbose output");
375 puts(" -version print product version and exit");
376 puts(" -fullversion print jpackage-compatible product version and exit");
377 puts(" -showversion print product version and continue");
378 puts(" -help, -? print this help message");
379 puts(" -X print help on non-standard Java options");
380 puts(" -esa | -enablesystemassertions");
381 puts(" enable system assertions");
382 puts(" -dsa | -disablesystemassertions");
383 puts(" disable system assertions");
387 puts(" -agentlib:<agent-lib-name>=<options> library to load containg JVMTI agent");
388 puts (" for jdwp help use: -agentlib:jdwp=help");
389 puts(" -agentpath:<path-to-agent>=<options> path to library containg JVMTI agent");
392 puts("CACAO options:");
393 puts(" -v write state-information");
394 puts(" -verbose[:call|exception|jit]");
395 puts(" enable specific verbose output");
396 puts(" -debug-color colored output for ANSI terms");
397 #ifdef TYPECHECK_VERBOSE
398 puts(" -verbosetc write debug messages while typechecking");
400 #if defined(__ALPHA__)
401 puts(" -noieee don't use ieee compliant arithmetic");
403 #if defined(ENABLE_VERIFIER)
404 puts(" -noverify don't verify classfiles");
406 puts(" -softnull use software nullpointer check");
407 #if defined(ENABLE_STATISTICS)
408 puts(" -time measure the runtime");
409 puts(" -stat detailed compiler statistics");
411 puts(" -log logfile specify a name for the logfile");
412 puts(" -c(heck)b(ounds) don't check array bounds");
413 puts(" s(ync) don't check for synchronization");
414 #if defined(ENABLE_LOOP)
415 puts(" -oloop optimize array accesses in loops");
417 puts(" -l don't start the class after loading");
418 puts(" -eager perform eager class loading and linking");
420 puts(" -all compile all methods, no execution");
421 puts(" -m compile only a specific method");
422 puts(" -sig specify signature for a specific method");
425 puts(" -s(how)... show...");
426 puts(" c(onstants) the constant pool");
427 puts(" m(ethods) class fields and methods");
428 puts(" u(tf) the utf - hash");
429 puts(" i(ntermediate) intermediate representation");
430 #if defined(ENABLE_DISASSEMBLER)
431 puts(" a(ssembler) disassembled listing");
432 puts(" e(xceptionstubs) disassembled exception stubs (only with -sa)");
433 puts(" n(ative) disassembled native stubs");
435 puts(" d(atasegment) data segment listing");
436 #if defined(ENABLE_INLINING)
437 puts(" -i n(line) activate inlining");
438 puts(" v(irtual) inline virtual methods (uses/turns rt option on)");
439 puts(" e(exception) inline methods with exceptions");
440 puts(" p(aramopt) optimize argument renaming");
441 puts(" o(utsiders) inline methods of foreign classes");
442 #endif /* defined(ENABLE_INLINING) */
443 #if defined(ENABLE_IFCONV)
444 puts(" -ifconv use if-conversion");
446 #if defined(ENABLE_LSRA)
447 puts(" -lsra use linear scan register allocation");
449 #if defined(ENABLE_SSA)
450 puts(" -lsra use linear scan register allocation (with SSA)");
453 /* exit with error code */
459 static void Xusage(void)
461 #if defined(ENABLE_JIT)
462 puts(" -Xjit JIT mode execution (default)");
464 #if defined(ENABLE_INTRP)
465 puts(" -Xint interpreter mode execution");
467 puts(" -Xbootclasspath:<zip/jar files and directories separated by :>");
468 puts(" value is set as bootstrap class path");
469 puts(" -Xbootclasspath/a:<zip/jar files and directories separated by :>");
470 puts(" value is appended to the bootstrap class path");
471 puts(" -Xbootclasspath/p:<zip/jar files and directories separated by :>");
472 puts(" value is prepended to the bootstrap class path");
473 puts(" -Xglibj:<zip/jar files and directories separated by :>");
474 puts(" value is used as Java core library, but the");
475 puts(" hardcoded VM interface classes are prepended");
476 printf(" -Xms<size> set the initial size of the heap (default: %dMB)\n", HEAP_STARTSIZE / 1024 / 1024);
477 printf(" -Xmx<size> set the maximum size of the heap (default: %dMB)\n", HEAP_MAXSIZE / 1024 / 1024);
478 printf(" -Xss<size> set the thread stack size (default: %dkB)\n", STACK_SIZE / 1024);
479 puts(" -Xprof[:bb] collect and print profiling data");
480 #if defined(ENABLE_JVMTI)
481 /* -Xdebug option depend on gnu classpath JDWP options. options:
482 transport=dt_socket,address=<hostname:port>,server=(y|n),suspend(y|n) */
483 puts(" -Xdebug enable remote debugging\n");
484 puts(" -Xrunjdwp transport=[dt_socket|...],address=<hostname:port>,server=[y|n],suspend=[y|n]\n");
485 puts(" enable remote debugging\n");
488 /* exit with error code */
494 /* version *********************************************************************
496 Only prints cacao version information.
498 *******************************************************************************/
500 static void version(bool opt_exit)
502 puts("java version \""JAVA_VERSION"\"");
503 puts("CACAO version "VERSION"");
505 puts("Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,");
506 puts("C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,");
507 puts("E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,");
508 puts("J. Wenninger, Institut f. Computersprachen - TU Wien\n");
510 puts("This program is free software; you can redistribute it and/or");
511 puts("modify it under the terms of the GNU General Public License as");
512 puts("published by the Free Software Foundation; either version 2, or (at");
513 puts("your option) any later version.\n");
515 puts("This program is distributed in the hope that it will be useful, but");
516 puts("WITHOUT ANY WARRANTY; without even the implied warranty of");
517 puts("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU");
518 puts("General Public License for more details.\n");
520 puts("Configure/Build options:\n");
521 puts(" ./configure: "VERSION_CONFIGURE_ARGS"");
522 #if defined(__VERSION__)
523 puts(" CC : "VERSION_CC" ("__VERSION__")");
525 puts(" CC : "VERSION_CC"");
527 puts(" CFLAGS : "VERSION_CFLAGS"\n");
529 puts("Default variables:\n");
530 printf(" maximum heap size : %d\n", HEAP_MAXSIZE);
531 printf(" initial heap size : %d\n", HEAP_STARTSIZE);
532 printf(" stack size : %d\n", STACK_SIZE);
533 puts(" java.boot.class.path: "CACAO_VM_ZIP":"CLASSPATH_GLIBJ_ZIP"");
534 puts(" java.library.path : "CLASSPATH_LIBRARY_PATH"\n");
536 puts("Runtime variables:\n");
537 printf(" maximum heap size : %d\n", opt_heapmaxsize);
538 printf(" initial heap size : %d\n", opt_heapstartsize);
539 printf(" stack size : %d\n", opt_stacksize);
540 printf(" java.boot.class.path: %s\n", bootclasspath);
542 /* exit normally, if requested */
549 /* fullversion *****************************************************************
551 Prints a Sun compatible version information (required e.g. by
552 jpackage, www.jpackage.org).
554 *******************************************************************************/
556 static void fullversion(void)
558 puts("java full version \"cacao-"JAVA_VERSION"\"");
566 /* vm_create *******************************************************************
568 Creates a JVM. Called by JNI_CreateJavaVM.
570 *******************************************************************************/
572 bool vm_create(JavaVMInitArgs *vm_args)
581 #if defined(ENABLE_JVMTI)
583 char *libname, *agentarg;
584 bool jdwp,agentbypath;
585 jdwp = agentbypath = false;
588 /* check the JNI version requested */
590 switch (vm_args->version) {
591 case JNI_VERSION_1_1:
593 case JNI_VERSION_1_2:
594 case JNI_VERSION_1_4:
600 /* we only support 1 JVM instance */
605 /* set the VM starttime */
607 _Jv_jvm->starttime = builtin_currenttimemillis();
609 /* get stuff from the environment *****************************************/
611 #if defined(DISABLE_GC)
612 nogc_init(HEAP_MAXSIZE, HEAP_STARTSIZE);
615 /* set the bootclasspath */
617 cp = getenv("BOOTCLASSPATH");
620 bootclasspath = MNEW(char, strlen(cp) + strlen("0"));
621 strcpy(bootclasspath, cp);
624 len = strlen(CACAO_VM_ZIP) +
626 strlen(CLASSPATH_GLIBJ_ZIP) +
629 bootclasspath = MNEW(char, len);
630 strcat(bootclasspath, CACAO_VM_ZIP);
631 strcat(bootclasspath, ":");
632 strcat(bootclasspath, CLASSPATH_GLIBJ_ZIP);
635 /* set the classpath */
637 cp = getenv("CLASSPATH");
640 classpath = MNEW(char, strlen(cp) + strlen("0"));
641 strcat(classpath, cp);
644 classpath = MNEW(char, strlen(".") + strlen("0"));
645 strcpy(classpath, ".");
649 /* interpret the options **************************************************/
657 opt_heapmaxsize = HEAP_MAXSIZE;
658 opt_heapstartsize = HEAP_STARTSIZE;
659 opt_stacksize = STACK_SIZE;
662 #if defined(ENABLE_JVMTI)
663 /* initialize JVMTI related **********************************************/
667 /* initialize properties before commandline handling */
669 if (!properties_init())
670 throw_cacao_exception_exit(string_java_lang_InternalError,
671 "Unable to init properties");
673 /* add some default properties */
675 properties_add("java.endorsed.dirs", ""CACAO_PREFIX"/jre/lib/endorsed");
678 /* iterate over all passed options */
680 while ((opt = options_get(opts, vm_args)) != OPT_DONE) {
694 #if SIZEOF_VOID_P == 8
695 puts("Running a 32-bit JVM is not supported on this platform.");
701 #if SIZEOF_VOID_P == 4
702 puts("Running a 64-bit JVM is not supported on this platform.");
708 /* forget old classpath and set the argument as new classpath */
709 MFREE(classpath, char, strlen(classpath));
711 classpath = MNEW(char, strlen(opt_arg) + strlen("0"));
712 strcpy(classpath, opt_arg);
716 for (j = 0; j < strlen(opt_arg); j++) {
717 if (opt_arg[j] == '=') {
719 properties_add(opt_arg, opt_arg + j + 1);
724 /* if no '=' is given, just create an empty property */
726 properties_add(opt_arg, "");
731 case OPT_BOOTCLASSPATH:
732 /* Forget default bootclasspath and set the argument as
733 new boot classpath. */
735 MFREE(bootclasspath, char, strlen(bootclasspath));
737 bootclasspath = MNEW(char, strlen(opt_arg) + strlen("0"));
738 strcpy(bootclasspath, opt_arg);
741 case OPT_BOOTCLASSPATH_A:
742 /* append to end of bootclasspath */
744 len = strlen(bootclasspath);
746 bootclasspath = MREALLOC(bootclasspath,
750 strlen(opt_arg) + strlen("0"));
752 strcat(bootclasspath, ":");
753 strcat(bootclasspath, opt_arg);
756 case OPT_BOOTCLASSPATH_P:
757 /* prepend in front of bootclasspath */
762 bootclasspath = MNEW(char, strlen(opt_arg) + strlen(":") +
765 strcpy(bootclasspath, opt_arg);
766 strcat(bootclasspath, ":");
767 strcat(bootclasspath, cp);
769 MFREE(cp, char, len);
773 /* use as Java core library, but prepend VM interface classes */
775 MFREE(bootclasspath, char, strlen(bootclasspath));
777 len = strlen(CACAO_VM_ZIP) +
782 bootclasspath = MNEW(char, len);
784 strcpy(bootclasspath, CACAO_VM_ZIP);
785 strcat(bootclasspath, ":");
786 strcat(bootclasspath, opt_arg);
789 #if defined(ENABLE_JVMTI)
791 /* this option exists only for compatibility reasons */
795 /* I don't know yet what Xnoagent should do. This is only for
796 compatiblity with eclipse - motse */
805 strlen(CACAO_LIBDIR) +
806 strlen("/libjdwp.so=") +
810 agentarg = MNEW(char, len);
812 strcpy(agentarg, CACAO_LIBDIR);
813 strcat(agentarg, "/libjdwp.so=");
814 strcat(agentarg, &opt_arg[1]);
831 c = opt_arg[strlen(opt_arg) - 1];
833 if ((c == 'k') || (c == 'K')) {
834 j = atoi(opt_arg) * 1024;
836 } else if ((c == 'm') || (c == 'M')) {
837 j = atoi(opt_arg) * 1024 * 1024;
844 else if (opt == OPT_MS)
845 opt_heapstartsize = j;
856 if (strcmp("class", opt_arg) == 0)
857 opt_verboseclass = true;
859 else if (strcmp("gc", opt_arg) == 0)
860 opt_verbosegc = true;
862 else if (strcmp("jni", opt_arg) == 0)
863 opt_verbosejni = true;
865 else if (strcmp("call", opt_arg) == 0)
866 opt_verbosecall = true;
868 else if (strcmp("jit", opt_arg) == 0) {
873 compileverbose = true;
875 else if (strcmp("exception", opt_arg) == 0)
876 opt_verboseexception = true;
879 opt_debugcolor = true;
882 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
884 opt_typecheckverbose = true;
893 case OPT_FULLVERSION:
897 case OPT_SHOWVERSION:
905 #if defined(ENABLE_VERIFIER)
915 #if defined(ENABLE_STATISTICS)
917 opt_getcompilingtime = true;
918 opt_getloadingtime = true;
931 for (j = 0; j < strlen(opt_arg); j++) {
932 switch (opt_arg[j]) {
947 makeinitializations = false;
958 makeinitializations = false;
963 opt_method = opt_arg;
964 makeinitializations = false;
968 opt_signature = opt_arg;
972 case OPT_SHOW: /* Display options */
973 for (j = 0; j < strlen(opt_arg); j++) {
974 switch (opt_arg[j]) {
976 showconstantpool = true;
988 opt_showintermediate = true;
989 compileverbose = true;
992 #if defined(ENABLE_DISASSEMBLER)
994 opt_showdisassemble = true;
995 compileverbose = true;
999 opt_showexceptionstubs = true;
1003 opt_shownativestub = true;
1008 opt_showddatasegment = true;
1017 #if defined(ENABLE_LOOP)
1023 #if defined(ENABLE_INLINING)
1025 for (j = 0; j < strlen(opt_arg); j++) {
1026 switch (opt_arg[j]) {
1028 /* define in options.h; Used in main.c, jit.c
1029 & inline.c inlining is currently
1033 inlinevirtuals = true;
1036 inlineexceptions = true;
1039 inlineparamopt = true;
1042 inlineoutsiders = true;
1049 #endif /* defined(ENABLE_INLINING) */
1051 #if defined(ENABLE_IFCONV)
1057 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
1072 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = true;
1076 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = false;
1079 case OPT_PROF_OPTION:
1080 /* use <= to get the last \0 too */
1082 for (j = 0, k = 0; j <= strlen(opt_arg); j++) {
1083 if (opt_arg[j] == ',')
1086 if (opt_arg[j] == '\0') {
1087 if (strcmp("bb", opt_arg + k) == 0)
1091 printf("Unknown option: -Xprof:%s\n", opt_arg + k);
1095 /* set k to next char */
1107 #if defined(ENABLE_JIT)
1110 printf("-Xjit option not enabled.\n");
1116 #if defined(ENABLE_INTRP)
1119 printf("-Xint option not enabled.\n");
1124 #if defined(ENABLE_INTRP)
1125 case OPT_STATIC_SUPERS:
1126 opt_static_supers = atoi(opt_arg);
1129 case OPT_NO_DYNAMIC:
1130 opt_no_dynamic = true;
1133 case OPT_NO_REPLICATION:
1134 opt_no_replication = true;
1137 case OPT_NO_QUICKSUPER:
1138 opt_no_quicksuper = true;
1147 printf("Unknown option: %s\n",
1148 vm_args->options[opt_index].optionString);
1154 /* Now we have all options handled and we can print the version
1161 /* get the main class *****************************************************/
1163 if (opt_index < vm_args->nOptions) {
1164 mainstring = vm_args->options[opt_index++].optionString;
1166 /* Put the jar file into the classpath (if any). */
1168 if (opt_jar == true) {
1169 /* free old classpath */
1171 MFREE(classpath, char, strlen(classpath));
1173 /* put jarfile into classpath */
1175 classpath = MNEW(char, strlen(mainstring) + strlen("0"));
1177 strcpy(classpath, mainstring);
1180 /* replace .'s with /'s in classname */
1182 for (i = strlen(mainstring) - 1; i >= 0; i--)
1183 if (mainstring[i] == '.')
1184 mainstring[i] = '/';
1188 #if defined(ENABLE_JVMTI)
1190 jvmti_set_phase(JVMTI_PHASE_ONLOAD);
1191 jvmti_agentload(agentarg, agentbypath, &handle, &libname);
1194 MFREE(agentarg, char, strlen(agentarg));
1196 jvmti_set_phase(JVMTI_PHASE_PRIMORDIAL);
1202 /* initialize this JVM ****************************************************/
1204 vm_initializing = true;
1206 /* initialize the garbage collector */
1208 gc_init(opt_heapmaxsize, opt_heapstartsize);
1210 #if defined(ENABLE_INTRP)
1211 /* Allocate main thread stack on the Java heap. */
1214 intrp_main_stack = GCMNEW(u1, opt_stacksize);
1215 MSET(intrp_main_stack, 0, u1, opt_stacksize);
1219 #if defined(ENABLE_THREADS)
1223 /* initialize the string hashtable stuff: lock (must be done
1224 _after_ threads_preinit) */
1227 throw_main_exception_exit();
1229 /* initialize the utf8 hashtable stuff: lock, often used utf8
1230 strings (must be done _after_ threads_preinit) */
1233 throw_main_exception_exit();
1235 /* initialize the classcache hashtable stuff: lock, hashtable
1236 (must be done _after_ threads_preinit) */
1238 if (!classcache_init())
1239 throw_main_exception_exit();
1241 /* initialize the loader with bootclasspath (must be done _after_
1245 throw_main_exception_exit();
1247 suck_add_from_property("java.endorsed.dirs");
1248 suck_add(bootclasspath);
1250 /* initialize the memory subsystem (must be done _after_
1254 throw_main_exception_exit();
1256 /* initialize the finalizer stuff (must be done _after_
1259 if (!finalizer_init())
1260 throw_main_exception_exit();
1262 /* install architecture dependent signal handler used for exceptions */
1266 /* initialize the codegen subsystems */
1270 /* initializes jit compiler */
1274 /* machine dependent initialization */
1276 #if defined(ENABLE_JIT)
1277 # if defined(ENABLE_INTRP)
1287 /* initialize the loader subsystems (must be done _after_
1291 throw_main_exception_exit();
1294 throw_main_exception_exit();
1297 throw_main_exception_exit();
1299 if (!exceptions_init())
1300 throw_main_exception_exit();
1302 if (!builtin_init())
1303 throw_main_exception_exit();
1305 /* Initialize the JNI subsystem (must be done _before_
1306 threads_init, as threads_init can call JNI methods
1307 (e.g. NewGlobalRef). */
1310 throw_main_exception_exit();
1312 #if defined(ENABLE_THREADS)
1313 if (!threads_init())
1314 throw_main_exception_exit();
1317 /* That's important, otherwise we get into trouble, if the Runtime
1318 static initializer is called before (circular dependency. This
1319 is with classpath 0.09. Another important thing is, that this
1320 has to happen after initThreads!!! */
1322 if (!initialize_class(class_java_lang_System))
1323 throw_main_exception_exit();
1325 #if defined(ENABLE_PROFILING)
1326 /* initialize profiling */
1328 if (!profile_init())
1329 throw_main_exception_exit();
1332 #if defined(ENABLE_THREADS)
1333 /* initialize recompilation */
1335 if (!recompile_init())
1336 throw_main_exception_exit();
1338 /* finally, start the finalizer thread */
1340 if (!finalizer_start_thread())
1341 throw_main_exception_exit();
1343 /* start the recompilation thread (must be done before the
1344 profiling thread) */
1346 if (!recompile_start_thread())
1347 throw_main_exception_exit();
1349 # if defined(ENABLE_PROFILING)
1350 /* start the profile sampling thread */
1353 if (!profile_start_thread())
1354 throw_main_exception_exit();
1358 #if defined(ENABLE_JVMTI)
1360 /* add agent library to native library hashtable */
1361 native_hashtable_library_add(utf_new_char(libname), class_java_lang_Object->classloader, handle);
1365 /* increment the number of VMs */
1369 /* initialization is done */
1371 vm_initializing = false;
1373 /* everything's ok */
1379 /* vm_destroy ******************************************************************
1381 Unloads a Java VM and reclaims its resources.
1383 *******************************************************************************/
1385 s4 vm_destroy(JavaVM *vm)
1387 #if defined(ENABLE_THREADS)
1388 threads_join_all_threads();
1391 /* everything's ok */
1397 /* vm_exit *********************************************************************
1399 Calls java.lang.System.exit(I)V to exit the JavaVM correctly.
1401 *******************************************************************************/
1403 void vm_exit(s4 status)
1407 /* signal that we are exiting */
1411 assert(class_java_lang_System);
1412 assert(class_java_lang_System->state & CLASS_LOADED);
1414 #if defined(ENABLE_JVMTI)
1415 if (jvmti || (dbgcom!=NULL)) {
1416 jvmti_set_phase(JVMTI_PHASE_DEAD);
1417 if (jvmti) jvmti_agentunload();
1421 if (!link_class(class_java_lang_System))
1422 throw_main_exception_exit();
1424 /* call java.lang.System.exit(I)V */
1426 m = class_resolveclassmethod(class_java_lang_System,
1427 utf_new_char("exit"),
1429 class_java_lang_Object,
1433 throw_main_exception_exit();
1435 /* call the exit function with passed exit status */
1437 (void) vm_call_method(m, NULL, status);
1439 /* If we had an exception, just ignore the exception and exit with
1442 vm_shutdown(status);
1446 /* vm_shutdown *****************************************************************
1448 Terminates the system immediately without freeing memory explicitly
1449 (to be used only for abnormal termination).
1451 *******************************************************************************/
1453 void vm_shutdown(s4 status)
1456 #if defined(ENABLE_STATISTICS)
1457 || opt_getcompilingtime || opt_stat
1461 log_text("CACAO terminated by shutdown");
1462 dolog("Exit status: %d\n", (s4) status);
1466 #if defined(ENABLE_JVMTI)
1467 /* terminate cacaodbgserver */
1469 pthread_mutex_lock(&dbgcomlock);
1471 pthread_mutex_unlock(&dbgcomlock);
1472 jvmti_cacaodbgserver_quit();
1480 /* vm_exit_handler *************************************************************
1482 The exit_handler function is called upon program termination.
1484 ATTENTION: Don't free system resources here! Some threads may still
1485 be running as this is called from VMRuntime.exit(). The OS does the
1488 *******************************************************************************/
1490 void vm_exit_handler(void)
1492 #if !defined(NDEBUG)
1494 class_showmethods(mainclass);
1496 if (showconstantpool)
1497 class_showconstantpool(mainclass);
1502 # if defined(ENABLE_PROFILING)
1504 profile_printstats();
1506 #endif /* !defined(NDEBUG) */
1508 #if defined(ENABLE_RT_TIMING)
1509 rt_timing_print_time_stats(stderr);
1512 #if defined(ENABLE_CYCLES_STATS)
1513 builtin_print_cycles_stats(stderr);
1514 stacktrace_print_cycles_stats(stderr);
1518 #if defined(ENABLE_STATISTICS)
1519 || opt_getcompilingtime || opt_stat
1523 log_text("CACAO terminated");
1525 #if defined(ENABLE_STATISTICS)
1528 #ifdef TYPECHECK_STATISTICS
1529 typecheck_print_statistics(get_logfile());
1535 if (opt_getcompilingtime)
1537 #endif /* defined(ENABLE_STATISTICS) */
1539 /* vm_print_profile(stderr);*/
1543 /* vm_abort ********************************************************************
1545 Prints an error message and aborts the VM.
1547 *******************************************************************************/
1549 void vm_abort(const char *text, ...)
1553 /* print the log message */
1558 log_vprint(text, ap);
1563 /* now abort the VM */
1569 /* vm_vmargs_from_valist *******************************************************
1573 *******************************************************************************/
1575 static void vm_vmargs_from_valist(methodinfo *m, java_objectheader *o,
1576 vm_arg *vmargs, va_list ap)
1578 typedesc *paramtypes;
1581 paramtypes = m->parseddesc->paramtypes;
1583 /* if method is non-static fill first block and skip `this' pointer */
1588 /* the `this' pointer */
1589 vmargs[0].type = TYPE_ADR;
1590 vmargs[0].data.l = (u8) (ptrint) o;
1596 for (; i < m->parseddesc->paramcount; i++, paramtypes++) {
1597 switch (paramtypes->decltype) {
1598 /* primitive types */
1599 case PRIMITIVETYPE_BOOLEAN:
1600 case PRIMITIVETYPE_BYTE:
1601 case PRIMITIVETYPE_CHAR:
1602 case PRIMITIVETYPE_SHORT:
1603 case PRIMITIVETYPE_INT:
1604 vmargs[i].type = TYPE_INT;
1605 vmargs[i].data.l = (s8) va_arg(ap, s4);
1608 case PRIMITIVETYPE_LONG:
1609 vmargs[i].type = TYPE_LNG;
1610 vmargs[i].data.l = (s8) va_arg(ap, s8);
1613 case PRIMITIVETYPE_FLOAT:
1614 vmargs[i].type = TYPE_FLT;
1615 #if defined(__ALPHA__)
1616 /* this keeps the assembler function much simpler */
1618 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1620 vmargs[i].data.f = (jfloat) va_arg(ap, jdouble);
1624 case PRIMITIVETYPE_DOUBLE:
1625 vmargs[i].type = TYPE_DBL;
1626 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1630 vmargs[i].type = TYPE_ADR;
1631 vmargs[i].data.l = (u8) (ptrint) va_arg(ap, void*);
1638 /* vm_vmargs_from_jvalue *******************************************************
1642 *******************************************************************************/
1644 static void vm_vmargs_from_jvalue(methodinfo *m, java_objectheader *o,
1645 vm_arg *vmargs, jvalue *args)
1647 typedesc *paramtypes;
1651 paramtypes = m->parseddesc->paramtypes;
1653 /* if method is non-static fill first block and skip `this' pointer */
1658 /* the `this' pointer */
1659 vmargs[0].type = TYPE_ADR;
1660 vmargs[0].data.l = (u8) (ptrint) o;
1666 for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) {
1667 switch (paramtypes->decltype) {
1668 /* primitive types */
1669 case PRIMITIVETYPE_BOOLEAN:
1670 case PRIMITIVETYPE_BYTE:
1671 case PRIMITIVETYPE_CHAR:
1672 case PRIMITIVETYPE_SHORT:
1673 case PRIMITIVETYPE_INT:
1674 vmargs[i].type = TYPE_INT;
1675 vmargs[i].data.l = (s8) args[j].i;
1678 case PRIMITIVETYPE_LONG:
1679 vmargs[i].type = TYPE_LNG;
1680 vmargs[i].data.l = (s8) args[j].j;
1683 case PRIMITIVETYPE_FLOAT:
1684 vmargs[i].type = TYPE_FLT;
1685 #if defined(__ALPHA__)
1686 /* this keeps the assembler function much simpler */
1688 vmargs[i].data.d = (jdouble) args[j].f;
1690 vmargs[i].data.f = args[j].f;
1694 case PRIMITIVETYPE_DOUBLE:
1695 vmargs[i].type = TYPE_DBL;
1696 vmargs[i].data.d = args[j].d;
1700 vmargs[i].type = TYPE_ADR;
1701 vmargs[i].data.l = (u8) (ptrint) args[j].l;
1708 /* vm_call_method **************************************************************
1710 Calls a Java method with a variable number of arguments and returns
1713 *******************************************************************************/
1715 java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
1718 java_objectheader *ro;
1721 ro = vm_call_method_valist(m, o, ap);
1728 /* vm_call_method_valist *******************************************************
1730 Calls a Java method with a variable number of arguments, passed via
1731 a va_list, and returns an address.
1733 *******************************************************************************/
1735 java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o,
1740 java_objectheader *ro;
1743 /* mark start of dump memory area */
1745 dumpsize = dump_size();
1747 /* get number of Java method arguments */
1749 vmargscount = m->parseddesc->paramcount;
1751 /* allocate vm_arg array */
1753 vmargs = DMNEW(vm_arg, vmargscount);
1755 /* fill the vm_arg array from a va_list */
1757 vm_vmargs_from_valist(m, o, vmargs, ap);
1759 /* call the Java method */
1761 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1763 /* release dump area */
1765 dump_release(dumpsize);
1771 /* vm_call_method_jvalue *******************************************************
1773 Calls a Java method with a variable number of arguments, passed via
1774 a jvalue array, and returns an address.
1776 *******************************************************************************/
1778 java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o,
1783 java_objectheader *ro;
1786 /* mark start of dump memory area */
1788 dumpsize = dump_size();
1790 /* get number of Java method arguments */
1792 vmargscount = m->parseddesc->paramcount;
1794 /* allocate vm_arg array */
1796 vmargs = DMNEW(vm_arg, vmargscount);
1798 /* fill the vm_arg array from a va_list */
1800 vm_vmargs_from_jvalue(m, o, vmargs, args);
1802 /* call the Java method */
1804 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1806 /* release dump area */
1808 dump_release(dumpsize);
1814 /* vm_call_method_vmarg ********************************************************
1816 Calls a Java method with a variable number of arguments, passed via
1817 a vm_arg array, and returns an address.
1819 *******************************************************************************/
1821 java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
1824 java_objectheader *o;
1826 #if defined(ENABLE_JIT)
1827 # if defined(ENABLE_INTRP)
1829 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1832 o = asm_vm_call_method(m, vmargscount, vmargs);
1834 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1841 /* vm_call_method_int **********************************************************
1843 Calls a Java method with a variable number of arguments and returns
1846 *******************************************************************************/
1848 s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...)
1854 i = vm_call_method_int_valist(m, o, ap);
1861 /* vm_call_method_int_valist ***************************************************
1863 Calls a Java method with a variable number of arguments, passed via
1864 a va_list, and returns an integer (s4).
1866 *******************************************************************************/
1868 s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap)
1875 /* mark start of dump memory area */
1877 dumpsize = dump_size();
1879 /* get number of Java method arguments */
1881 vmargscount = m->parseddesc->paramcount;
1883 /* allocate vm_arg array */
1885 vmargs = DMNEW(vm_arg, vmargscount);
1887 /* fill the vm_arg array from a va_list */
1889 vm_vmargs_from_valist(m, o, vmargs, ap);
1891 /* call the Java method */
1893 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1895 /* release dump area */
1897 dump_release(dumpsize);
1903 /* vm_call_method_int_jvalue ***************************************************
1905 Calls a Java method with a variable number of arguments, passed via
1906 a jvalue array, and returns an integer (s4).
1908 *******************************************************************************/
1910 s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
1917 /* mark start of dump memory area */
1919 dumpsize = dump_size();
1921 /* get number of Java method arguments */
1923 vmargscount = m->parseddesc->paramcount;
1925 /* allocate vm_arg array */
1927 vmargs = DMNEW(vm_arg, vmargscount);
1929 /* fill the vm_arg array from a va_list */
1931 vm_vmargs_from_jvalue(m, o, vmargs, args);
1933 /* call the Java method */
1935 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1937 /* release dump area */
1939 dump_release(dumpsize);
1945 /* vm_call_method_int_vmarg ****************************************************
1947 Calls a Java method with a variable number of arguments, passed via
1948 a vm_arg array, and returns an integer (s4).
1950 *******************************************************************************/
1952 s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
1956 #if defined(ENABLE_JIT)
1957 # if defined(ENABLE_INTRP)
1959 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1962 i = asm_vm_call_method_int(m, vmargscount, vmargs);
1964 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1971 /* vm_call_method_long *********************************************************
1973 Calls a Java method with a variable number of arguments and returns
1976 *******************************************************************************/
1978 s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...)
1984 l = vm_call_method_long_valist(m, o, ap);
1991 /* vm_call_method_long_valist **************************************************
1993 Calls a Java method with a variable number of arguments, passed via
1994 a va_list, and returns a long (s8).
1996 *******************************************************************************/
1998 s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap)
2005 /* mark start of dump memory area */
2007 dumpsize = dump_size();
2009 /* get number of Java method arguments */
2011 vmargscount = m->parseddesc->paramcount;
2013 /* allocate vm_arg array */
2015 vmargs = DMNEW(vm_arg, vmargscount);
2017 /* fill the vm_arg array from a va_list */
2019 vm_vmargs_from_valist(m, o, vmargs, ap);
2021 /* call the Java method */
2023 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2025 /* release dump area */
2027 dump_release(dumpsize);
2033 /* vm_call_method_long_jvalue **************************************************
2035 Calls a Java method with a variable number of arguments, passed via
2036 a jvalue array, and returns a long (s8).
2038 *******************************************************************************/
2040 s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
2047 /* mark start of dump memory area */
2049 dumpsize = dump_size();
2051 /* get number of Java method arguments */
2053 vmargscount = m->parseddesc->paramcount;
2055 /* allocate vm_arg array */
2057 vmargs = DMNEW(vm_arg, vmargscount);
2059 /* fill the vm_arg array from a va_list */
2061 vm_vmargs_from_jvalue(m, o, vmargs, args);
2063 /* call the Java method */
2065 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2067 /* release dump area */
2069 dump_release(dumpsize);
2075 /* vm_call_method_long_vmarg ***************************************************
2077 Calls a Java method with a variable number of arguments, passed via
2078 a vm_arg array, and returns a long (s8).
2080 *******************************************************************************/
2082 s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2086 #if defined(ENABLE_JIT)
2087 # if defined(ENABLE_INTRP)
2089 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2092 l = asm_vm_call_method_long(m, vmargscount, vmargs);
2094 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2101 /* vm_call_method_float ********************************************************
2103 Calls a Java method with a variable number of arguments and returns
2106 *******************************************************************************/
2108 float vm_call_method_float(methodinfo *m, java_objectheader *o, ...)
2114 f = vm_call_method_float_valist(m, o, ap);
2121 /* vm_call_method_float_valist *************************************************
2123 Calls a Java method with a variable number of arguments, passed via
2124 a va_list, and returns a float.
2126 *******************************************************************************/
2128 float vm_call_method_float_valist(methodinfo *m, java_objectheader *o,
2136 /* mark start of dump memory area */
2138 dumpsize = dump_size();
2140 /* get number of Java method arguments */
2142 vmargscount = m->parseddesc->paramcount;
2144 /* allocate vm_arg array */
2146 vmargs = DMNEW(vm_arg, vmargscount);
2148 /* fill the vm_arg array from a va_list */
2150 vm_vmargs_from_valist(m, o, vmargs, ap);
2152 /* call the Java method */
2154 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2156 /* release dump area */
2158 dump_release(dumpsize);
2164 /* vm_call_method_float_jvalue *************************************************
2166 Calls a Java method with a variable number of arguments, passed via
2167 a jvalue array, and returns a float.
2169 *******************************************************************************/
2171 float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o,
2179 /* mark start of dump memory area */
2181 dumpsize = dump_size();
2183 /* get number of Java method arguments */
2185 vmargscount = m->parseddesc->paramcount;
2187 /* allocate vm_arg array */
2189 vmargs = DMNEW(vm_arg, vmargscount);
2191 /* fill the vm_arg array from a va_list */
2193 vm_vmargs_from_jvalue(m, o, vmargs, args);
2195 /* call the Java method */
2197 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2199 /* release dump area */
2201 dump_release(dumpsize);
2207 /* vm_call_method_float_vmarg **************************************************
2209 Calls a Java method with a variable number of arguments and returns
2212 *******************************************************************************/
2214 float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2218 #if defined(ENABLE_JIT)
2219 # if defined(ENABLE_INTRP)
2221 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2224 f = asm_vm_call_method_float(m, vmargscount, vmargs);
2226 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2233 /* vm_call_method_double *******************************************************
2235 Calls a Java method with a variable number of arguments and returns
2238 *******************************************************************************/
2240 double vm_call_method_double(methodinfo *m, java_objectheader *o, ...)
2246 d = vm_call_method_double_valist(m, o, ap);
2253 /* vm_call_method_double_valist ************************************************
2255 Calls a Java method with a variable number of arguments, passed via
2256 a va_list, and returns a double.
2258 *******************************************************************************/
2260 double vm_call_method_double_valist(methodinfo *m, java_objectheader *o,
2268 /* mark start of dump memory area */
2270 dumpsize = dump_size();
2272 /* get number of Java method arguments */
2274 vmargscount = m->parseddesc->paramcount;
2276 /* allocate vm_arg array */
2278 vmargs = DMNEW(vm_arg, vmargscount);
2280 /* fill the vm_arg array from a va_list */
2282 vm_vmargs_from_valist(m, o, vmargs, ap);
2284 /* call the Java method */
2286 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2288 /* release dump area */
2290 dump_release(dumpsize);
2296 /* vm_call_method_double_jvalue ************************************************
2298 Calls a Java method with a variable number of arguments, passed via
2299 a jvalue array, and returns a double.
2301 *******************************************************************************/
2303 double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o,
2311 /* mark start of dump memory area */
2313 dumpsize = dump_size();
2315 /* get number of Java method arguments */
2317 vmargscount = m->parseddesc->paramcount;
2319 /* allocate vm_arg array */
2321 vmargs = DMNEW(vm_arg, vmargscount);
2323 /* fill the vm_arg array from a va_list */
2325 vm_vmargs_from_jvalue(m, o, vmargs, args);
2327 /* call the Java method */
2329 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2331 /* release dump area */
2333 dump_release(dumpsize);
2339 /* vm_call_method_double_vmarg *************************************************
2341 Calls a Java method with a variable number of arguments and returns
2344 *******************************************************************************/
2346 double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
2351 #if defined(ENABLE_JIT)
2352 # if defined(ENABLE_INTRP)
2354 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2357 d = asm_vm_call_method_double(m, vmargscount, vmargs);
2359 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2367 * These are local overrides for various environment variables in Emacs.
2368 * Please do not remove this and leave it at the end of the file, where
2369 * Emacs will automagically detect them.
2370 * ---------------------------------------------------------------------
2373 * indent-tabs-mode: t