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)
173 #if defined(ENABLE_VERIFIER)
175 #if defined(TYPECHECK_VERBOSE)
178 #endif /* defined(ENABLE_VERIFIER) */
181 /* optimization options */
183 #if defined(ENABLE_LOOP)
187 #if defined(ENABLE_IFCONV)
191 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
195 #if defined(ENABLE_INLINING)
199 #if defined(ENABLE_INTRP)
200 /* interpreter options */
223 opt_struct opts[] = {
224 { "foo", false, OPT_FOO },
228 { "jar", false, OPT_JAR },
230 { "d32", false, OPT_D32 },
231 { "d64", false, OPT_D64 },
232 { "client", false, OPT_IGNORE },
233 { "server", false, OPT_IGNORE },
234 { "jvm", false, OPT_IGNORE },
235 { "hotspot", false, OPT_IGNORE },
237 { "classpath", true, OPT_CLASSPATH },
238 { "cp", true, OPT_CLASSPATH },
239 { "D", true, OPT_D },
240 { "version", false, OPT_VERSION },
241 { "showversion", false, OPT_SHOWVERSION },
242 { "fullversion", false, OPT_FULLVERSION },
243 { "help", false, OPT_HELP },
244 { "?", false, OPT_HELP },
245 { "X", false, OPT_X },
247 { "esa", false, OPT_ESA },
248 { "enablesystemassertions", false, OPT_ESA },
249 { "dsa", false, OPT_DSA },
250 { "disablesystemassertions", false, OPT_DSA },
252 { "noasyncgc", false, OPT_IGNORE },
253 #if defined(ENABLE_VERIFIER)
254 { "noverify", false, OPT_NOVERIFY },
256 { "v", false, OPT_VERBOSE1 },
257 { "verbose:", true, OPT_VERBOSE },
259 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
260 { "verbosetc", false, OPT_VERBOSETC },
262 #if defined(__ALPHA__)
263 { "noieee", false, OPT_NOIEEE },
265 { "softnull", false, OPT_SOFTNULL },
266 #if defined(ENABLE_STATISTICS)
267 { "time", false, OPT_TIME },
268 { "stat", false, OPT_STAT },
270 { "log", true, OPT_LOG },
271 { "c", true, OPT_CHECK },
272 { "l", false, OPT_LOAD },
273 { "eager", false, OPT_EAGER },
274 { "sig", true, OPT_SIGNATURE },
275 { "all", false, OPT_ALL },
276 #if defined(ENABLE_LOOP)
277 { "oloop", false, OPT_OLOOP },
279 #if defined(ENABLE_IFCONV)
280 { "ifconv", false, OPT_IFCONV },
282 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
283 { "lsra", false, OPT_LSRA },
286 #if defined(ENABLE_INTRP)
287 /* interpreter options */
289 { "trace", false, OPT_TRACE },
290 { "static-supers", true, OPT_STATIC_SUPERS },
291 { "no-dynamic", false, OPT_NO_DYNAMIC },
292 { "no-replication", false, OPT_NO_REPLICATION },
293 { "no-quicksuper", false, OPT_NO_QUICKSUPER },
296 /* JVMTI Agent Command Line Options */
298 { "agentlib:", true, OPT_AGENTLIB },
299 { "agentpath:", true, OPT_AGENTPATH },
302 /* Java non-standard options */
304 { "Xjit", false, OPT_JIT },
305 { "Xint", false, OPT_INTRP },
306 { "Xbootclasspath:", true, OPT_BOOTCLASSPATH },
307 { "Xbootclasspath/a:", true, OPT_BOOTCLASSPATH_A },
308 { "Xbootclasspath/p:", true, OPT_BOOTCLASSPATH_P },
309 { "Xglibj:", true, OPT_GLIBJ },
312 { "Xdebug", false, OPT_DEBUG },
313 { "Xnoagent", false, OPT_NOAGENT },
314 { "Xrunjdwp", true, OPT_XRUNJDWP },
317 { "Xms", true, OPT_MS },
318 { "ms", true, OPT_MS },
319 { "Xmx", true, OPT_MX },
320 { "mx", true, OPT_MX },
321 { "Xss", true, OPT_SS },
322 { "ss", true, OPT_SS },
323 { "Xprof:", true, OPT_PROF_OPTION },
324 { "Xprof", false, OPT_PROF },
326 /* keep these at the end of the list */
328 #if defined(ENABLE_INLINING)
329 { "i", true, OPT_INLINING },
331 { "m", true, OPT_METHOD },
332 { "s", true, OPT_SHOW },
333 { "verbosecolor", false, OPT_COLORVERBOSE },
339 /* usage ***********************************************************************
341 Prints the correct usage syntax to stdout.
343 *******************************************************************************/
347 puts("Usage: cacao [-options] classname [arguments]");
348 puts(" (to run a class file)");
349 puts(" or cacao [-options] -jar jarfile [arguments]");
350 puts(" (to run a standalone jar file)\n");
352 puts("Java options:");
353 puts(" -d32 use 32-bit data model if available");
354 puts(" -d64 use 64-bit data model if available");
355 puts(" -client compatibility (currently ignored)");
356 puts(" -server compatibility (currently ignored)");
357 puts(" -jvm compatibility (currently ignored)");
358 puts(" -hotspot compatibility (currently ignored)\n");
360 puts(" -cp <path> specify a path to look for classes");
361 puts(" -classpath <path> specify a path to look for classes");
362 puts(" -D<name>=<value> add an entry to the property list");
363 puts(" -verbose[:class|gc|jni] enable specific verbose output");
364 puts(" -version print product version and exit");
365 puts(" -fullversion print jpackage-compatible product version and exit");
366 puts(" -showversion print product version and continue");
367 puts(" -help, -? print this help message");
368 puts(" -X print help on non-standard Java options");
369 puts(" -esa | -enablesystemassertions");
370 puts(" enable system assertions");
371 puts(" -dsa | -disablesystemassertions");
372 puts(" disable system assertions");
376 puts(" -agentlib:<agent-lib-name>=<options> library to load containg JVMTI agent");
377 puts (" for jdwp help use: -agentlib:jdwp=help");
378 puts(" -agentpath:<path-to-agent>=<options> path to library containg JVMTI agent");
381 puts("CACAO options:");
382 puts(" -v write state-information");
383 puts(" -verbose[:call|exception|jit]");
384 puts(" enable specific verbose output");
385 puts(" -verbosecolor colored output for ANSI terms");
386 #ifdef TYPECHECK_VERBOSE
387 puts(" -verbosetc write debug messages while typechecking");
389 #if defined(__ALPHA__)
390 puts(" -noieee don't use ieee compliant arithmetic");
392 #if defined(ENABLE_VERIFIER)
393 puts(" -noverify don't verify classfiles");
395 puts(" -softnull use software nullpointer check");
396 #if defined(ENABLE_STATISTICS)
397 puts(" -time measure the runtime");
398 puts(" -stat detailed compiler statistics");
400 puts(" -log logfile specify a name for the logfile");
401 puts(" -c(heck)b(ounds) don't check array bounds");
402 puts(" s(ync) don't check for synchronization");
403 #if defined(ENABLE_LOOP)
404 puts(" -oloop optimize array accesses in loops");
406 puts(" -l don't start the class after loading");
407 puts(" -eager perform eager class loading and linking");
408 puts(" -all compile all methods, no execution");
409 puts(" -m compile only a specific method");
410 puts(" -sig specify signature for a specific method");
411 puts(" -s(how)... show...");
412 puts(" c(onstants) the constant pool");
413 puts(" m(ethods) class fields and methods");
414 puts(" u(tf) the utf - hash");
415 puts(" i(ntermediate) intermediate representation");
416 #if defined(ENABLE_DISASSEMBLER)
417 puts(" a(ssembler) disassembled listing");
418 puts(" e(xceptionstubs) disassembled exception stubs (only with -sa)");
419 puts(" n(ative) disassembled native stubs");
421 puts(" d(atasegment) data segment listing");
422 #if defined(ENABLE_INLINING)
423 puts(" -i n(line) activate inlining");
424 puts(" v(irtual) inline virtual methods (uses/turns rt option on)");
425 puts(" e(exception) inline methods with exceptions");
426 puts(" p(aramopt) optimize argument renaming");
427 puts(" o(utsiders) inline methods of foreign classes");
428 #endif /* defined(ENABLE_INLINING) */
429 #if defined(ENABLE_IFCONV)
430 puts(" -ifconv use if-conversion");
432 #if defined(ENABLE_LSRA)
433 puts(" -lsra use linear scan register allocation");
435 #if defined(ENABLE_SSA)
436 puts(" -lsra use linear scan register allocation (with SSA)");
439 /* exit with error code */
445 static void Xusage(void)
447 #if defined(ENABLE_JIT)
448 puts(" -Xjit JIT mode execution (default)");
450 #if defined(ENABLE_INTRP)
451 puts(" -Xint interpreter mode execution");
453 puts(" -Xbootclasspath:<zip/jar files and directories separated by :>");
454 puts(" value is set as bootstrap class path");
455 puts(" -Xbootclasspath/a:<zip/jar files and directories separated by :>");
456 puts(" value is appended to the bootstrap class path");
457 puts(" -Xbootclasspath/p:<zip/jar files and directories separated by :>");
458 puts(" value is prepended to the bootstrap class path");
459 puts(" -Xglibj:<zip/jar files and directories separated by :>");
460 puts(" value is used as Java core library, but the");
461 puts(" hardcoded VM interface classes are prepended");
462 printf(" -Xms<size> set the initial size of the heap (default: %dMB)\n", HEAP_STARTSIZE / 1024 / 1024);
463 printf(" -Xmx<size> set the maximum size of the heap (default: %dMB)\n", HEAP_MAXSIZE / 1024 / 1024);
464 printf(" -Xss<size> set the thread stack size (default: %dkB)\n", STACK_SIZE / 1024);
465 puts(" -Xprof[:bb] collect and print profiling data");
466 #if defined(ENABLE_JVMTI)
467 /* -Xdebug option depend on gnu classpath JDWP options. options:
468 transport=dt_socket,address=<hostname:port>,server=(y|n),suspend(y|n) */
469 puts(" -Xdebug enable remote debugging\n");
470 puts(" -Xrunjdwp transport=[dt_socket|...],address=<hostname:port>,server=[y|n],suspend=[y|n]\n");
471 puts(" enable remote debugging\n");
474 /* exit with error code */
480 /* version *********************************************************************
482 Only prints cacao version information.
484 *******************************************************************************/
486 static void version(bool opt_exit)
488 puts("java version \""JAVA_VERSION"\"");
489 puts("CACAO version "VERSION"");
491 puts("Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,");
492 puts("C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,");
493 puts("E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,");
494 puts("J. Wenninger, Institut f. Computersprachen - TU Wien\n");
496 puts("This program is free software; you can redistribute it and/or");
497 puts("modify it under the terms of the GNU General Public License as");
498 puts("published by the Free Software Foundation; either version 2, or (at");
499 puts("your option) any later version.\n");
501 puts("This program is distributed in the hope that it will be useful, but");
502 puts("WITHOUT ANY WARRANTY; without even the implied warranty of");
503 puts("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU");
504 puts("General Public License for more details.\n");
506 puts("Configure/Build options:\n");
507 puts(" ./configure: "VERSION_CONFIGURE_ARGS"");
508 #if defined(__VERSION__)
509 puts(" CC : "VERSION_CC" ("__VERSION__")");
511 puts(" CC : "VERSION_CC"");
513 puts(" CFLAGS : "VERSION_CFLAGS"\n");
515 puts("Default variables:\n");
516 printf(" maximum heap size : %d\n", HEAP_MAXSIZE);
517 printf(" initial heap size : %d\n", HEAP_STARTSIZE);
518 printf(" stack size : %d\n", STACK_SIZE);
519 puts(" java.boot.class.path: "CACAO_VM_ZIP":"CLASSPATH_GLIBJ_ZIP"");
520 puts(" java.library.path : "CLASSPATH_LIBRARY_PATH"\n");
522 puts("Runtime variables:\n");
523 printf(" maximum heap size : %d\n", opt_heapmaxsize);
524 printf(" initial heap size : %d\n", opt_heapstartsize);
525 printf(" stack size : %d\n", opt_stacksize);
526 printf(" java.boot.class.path: %s\n", bootclasspath);
528 /* exit normally, if requested */
535 /* fullversion *****************************************************************
537 Prints a Sun compatible version information (required e.g. by
538 jpackage, www.jpackage.org).
540 *******************************************************************************/
542 static void fullversion(void)
544 puts("java full version \"cacao-"JAVA_VERSION"\"");
552 /* vm_create *******************************************************************
554 Creates a JVM. Called by JNI_CreateJavaVM.
556 *******************************************************************************/
558 bool vm_create(JavaVMInitArgs *vm_args)
567 #if defined(ENABLE_JVMTI)
569 char *libname, *agentarg;
570 bool jdwp,agentbypath;
571 jdwp = agentbypath = false;
574 /* check the JNI version requested */
576 switch (vm_args->version) {
577 case JNI_VERSION_1_1:
579 case JNI_VERSION_1_2:
580 case JNI_VERSION_1_4:
586 /* we only support 1 JVM instance */
591 /* set the VM starttime */
593 _Jv_jvm->starttime = builtin_currenttimemillis();
595 /* get stuff from the environment *****************************************/
597 #if defined(DISABLE_GC)
598 nogc_init(HEAP_MAXSIZE, HEAP_STARTSIZE);
601 /* set the bootclasspath */
603 cp = getenv("BOOTCLASSPATH");
606 bootclasspath = MNEW(char, strlen(cp) + strlen("0"));
607 strcpy(bootclasspath, cp);
610 len = strlen(CACAO_VM_ZIP) +
612 strlen(CLASSPATH_GLIBJ_ZIP) +
615 bootclasspath = MNEW(char, len);
616 strcat(bootclasspath, CACAO_VM_ZIP);
617 strcat(bootclasspath, ":");
618 strcat(bootclasspath, CLASSPATH_GLIBJ_ZIP);
621 /* set the classpath */
623 cp = getenv("CLASSPATH");
626 classpath = MNEW(char, strlen(cp) + strlen("0"));
627 strcat(classpath, cp);
630 classpath = MNEW(char, strlen(".") + strlen("0"));
631 strcpy(classpath, ".");
635 /* interpret the options **************************************************/
643 opt_heapmaxsize = HEAP_MAXSIZE;
644 opt_heapstartsize = HEAP_STARTSIZE;
645 opt_stacksize = STACK_SIZE;
648 #if defined(ENABLE_JVMTI)
649 /* initialize JVMTI related **********************************************/
653 /* initialize properties before commandline handling */
655 if (!properties_init())
656 throw_cacao_exception_exit(string_java_lang_InternalError,
657 "Unable to init properties");
659 /* add some default properties */
661 properties_add("java.endorsed.dirs", ""CACAO_PREFIX"/jre/lib/endorsed");
664 /* iterate over all passed options */
666 while ((opt = options_get(opts, vm_args)) != OPT_DONE) {
680 #if SIZEOF_VOID_P == 8
681 puts("Running a 32-bit JVM is not supported on this platform.");
687 #if SIZEOF_VOID_P == 4
688 puts("Running a 64-bit JVM is not supported on this platform.");
694 /* forget old classpath and set the argument as new classpath */
695 MFREE(classpath, char, strlen(classpath));
697 classpath = MNEW(char, strlen(opt_arg) + strlen("0"));
698 strcpy(classpath, opt_arg);
702 for (j = 0; j < strlen(opt_arg); j++) {
703 if (opt_arg[j] == '=') {
705 properties_add(opt_arg, opt_arg + j + 1);
710 /* if no '=' is given, just create an empty property */
712 properties_add(opt_arg, "");
717 case OPT_BOOTCLASSPATH:
718 /* Forget default bootclasspath and set the argument as
719 new boot classpath. */
721 MFREE(bootclasspath, char, strlen(bootclasspath));
723 bootclasspath = MNEW(char, strlen(opt_arg) + strlen("0"));
724 strcpy(bootclasspath, opt_arg);
727 case OPT_BOOTCLASSPATH_A:
728 /* append to end of bootclasspath */
730 len = strlen(bootclasspath);
732 bootclasspath = MREALLOC(bootclasspath,
736 strlen(opt_arg) + strlen("0"));
738 strcat(bootclasspath, ":");
739 strcat(bootclasspath, opt_arg);
742 case OPT_BOOTCLASSPATH_P:
743 /* prepend in front of bootclasspath */
748 bootclasspath = MNEW(char, strlen(opt_arg) + strlen(":") +
751 strcpy(bootclasspath, opt_arg);
752 strcat(bootclasspath, ":");
753 strcat(bootclasspath, cp);
755 MFREE(cp, char, len);
759 /* use as Java core library, but prepend VM interface classes */
761 MFREE(bootclasspath, char, strlen(bootclasspath));
763 len = strlen(CACAO_VM_ZIP) +
768 bootclasspath = MNEW(char, len);
770 strcpy(bootclasspath, CACAO_VM_ZIP);
771 strcat(bootclasspath, ":");
772 strcat(bootclasspath, opt_arg);
775 #if defined(ENABLE_JVMTI)
777 /* this option exists only for compatibility reasons */
781 /* I don't know yet what Xnoagent should do. This is only for
782 compatiblity with eclipse - motse */
791 strlen(CACAO_LIBDIR) +
792 strlen("/libjdwp.so=") +
796 agentarg = MNEW(char, len);
798 strcpy(agentarg, CACAO_LIBDIR);
799 strcat(agentarg, "/libjdwp.so=");
800 strcat(agentarg, &opt_arg[1]);
817 c = opt_arg[strlen(opt_arg) - 1];
819 if ((c == 'k') || (c == 'K')) {
820 j = atoi(opt_arg) * 1024;
822 } else if ((c == 'm') || (c == 'M')) {
823 j = atoi(opt_arg) * 1024 * 1024;
830 else if (opt == OPT_MS)
831 opt_heapstartsize = j;
842 if (strcmp("class", opt_arg) == 0)
843 opt_verboseclass = true;
845 else if (strcmp("gc", opt_arg) == 0)
846 opt_verbosegc = true;
848 else if (strcmp("jni", opt_arg) == 0)
849 opt_verbosejni = true;
851 else if (strcmp("call", opt_arg) == 0)
852 opt_verbosecall = true;
854 else if (strcmp("jit", opt_arg) == 0) {
859 compileverbose = true;
861 else if (strcmp("exception", opt_arg) == 0)
862 opt_verboseexception = true;
864 case OPT_COLORVERBOSE:
865 opt_colorverbose = true;
868 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
870 opt_typecheckverbose = true;
879 case OPT_FULLVERSION:
883 case OPT_SHOWVERSION:
891 #if defined(ENABLE_VERIFIER)
901 #if defined(ENABLE_STATISTICS)
903 opt_getcompilingtime = true;
904 opt_getloadingtime = true;
917 for (j = 0; j < strlen(opt_arg); j++) {
918 switch (opt_arg[j]) {
933 makeinitializations = false;
942 opt_method = opt_arg;
943 makeinitializations = false;
947 opt_signature = opt_arg;
953 makeinitializations = false;
956 case OPT_SHOW: /* Display options */
957 for (j = 0; j < strlen(opt_arg); j++) {
958 switch (opt_arg[j]) {
960 showconstantpool = true;
972 opt_showintermediate = true;
973 compileverbose = true;
976 #if defined(ENABLE_DISASSEMBLER)
978 opt_showdisassemble = true;
979 compileverbose = true;
983 opt_showexceptionstubs = true;
987 opt_shownativestub = true;
992 opt_showddatasegment = true;
1001 #if defined(ENABLE_LOOP)
1007 #if defined(ENABLE_INLINING)
1009 for (j = 0; j < strlen(opt_arg); j++) {
1010 switch (opt_arg[j]) {
1012 /* define in options.h; Used in main.c, jit.c
1013 & inline.c inlining is currently
1017 inlinevirtuals = true;
1020 inlineexceptions = true;
1023 inlineparamopt = true;
1026 inlineoutsiders = true;
1033 #endif /* defined(ENABLE_INLINING) */
1035 #if defined(ENABLE_IFCONV)
1041 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
1056 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = true;
1060 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = false;
1063 case OPT_PROF_OPTION:
1064 /* use <= to get the last \0 too */
1066 for (j = 0, k = 0; j <= strlen(opt_arg); j++) {
1067 if (opt_arg[j] == ',')
1070 if (opt_arg[j] == '\0') {
1071 if (strcmp("bb", opt_arg + k) == 0)
1075 printf("Unknown option: -Xprof:%s\n", opt_arg + k);
1079 /* set k to next char */
1091 #if defined(ENABLE_JIT)
1094 printf("-Xjit option not enabled.\n");
1100 #if defined(ENABLE_INTRP)
1103 printf("-Xint option not enabled.\n");
1108 #if defined(ENABLE_INTRP)
1109 case OPT_STATIC_SUPERS:
1110 opt_static_supers = atoi(opt_arg);
1113 case OPT_NO_DYNAMIC:
1114 opt_no_dynamic = true;
1117 case OPT_NO_REPLICATION:
1118 opt_no_replication = true;
1121 case OPT_NO_QUICKSUPER:
1122 opt_no_quicksuper = true;
1131 printf("Unknown option: %s\n",
1132 vm_args->options[opt_index].optionString);
1138 /* Now we have all options handled and we can print the version
1145 /* get the main class *****************************************************/
1147 if (opt_index < vm_args->nOptions) {
1148 mainstring = vm_args->options[opt_index++].optionString;
1150 /* Put the jar file into the classpath (if any). */
1152 if (opt_jar == true) {
1153 /* free old classpath */
1155 MFREE(classpath, char, strlen(classpath));
1157 /* put jarfile into classpath */
1159 classpath = MNEW(char, strlen(mainstring) + strlen("0"));
1161 strcpy(classpath, mainstring);
1164 /* replace .'s with /'s in classname */
1166 for (i = strlen(mainstring) - 1; i >= 0; i--)
1167 if (mainstring[i] == '.')
1168 mainstring[i] = '/';
1172 #if defined(ENABLE_JVMTI)
1174 jvmti_set_phase(JVMTI_PHASE_ONLOAD);
1175 jvmti_agentload(agentarg, agentbypath, &handle, &libname);
1178 MFREE(agentarg, char, strlen(agentarg));
1180 jvmti_set_phase(JVMTI_PHASE_PRIMORDIAL);
1186 /* initialize this JVM ****************************************************/
1188 vm_initializing = true;
1190 /* initialize the garbage collector */
1192 gc_init(opt_heapmaxsize, opt_heapstartsize);
1194 #if defined(ENABLE_INTRP)
1195 /* Allocate main thread stack on the Java heap. */
1198 intrp_main_stack = GCMNEW(u1, opt_stacksize);
1199 MSET(intrp_main_stack, 0, u1, opt_stacksize);
1203 #if defined(ENABLE_THREADS)
1207 /* initialize the string hashtable stuff: lock (must be done
1208 _after_ threads_preinit) */
1211 throw_main_exception_exit();
1213 /* initialize the utf8 hashtable stuff: lock, often used utf8
1214 strings (must be done _after_ threads_preinit) */
1217 throw_main_exception_exit();
1219 /* initialize the classcache hashtable stuff: lock, hashtable
1220 (must be done _after_ threads_preinit) */
1222 if (!classcache_init())
1223 throw_main_exception_exit();
1225 /* initialize the loader with bootclasspath (must be done _after_
1229 throw_main_exception_exit();
1231 suck_add_from_property("java.endorsed.dirs");
1232 suck_add(bootclasspath);
1234 /* initialize the memory subsystem (must be done _after_
1238 throw_main_exception_exit();
1240 /* initialize the finalizer stuff (must be done _after_
1243 if (!finalizer_init())
1244 throw_main_exception_exit();
1246 /* install architecture dependent signal handler used for exceptions */
1250 /* initialize the codegen subsystems */
1254 /* initializes jit compiler */
1258 /* machine dependent initialization */
1260 #if defined(ENABLE_JIT)
1261 # if defined(ENABLE_INTRP)
1271 /* initialize the loader subsystems (must be done _after_
1275 throw_main_exception_exit();
1278 throw_main_exception_exit();
1281 throw_main_exception_exit();
1283 if (!exceptions_init())
1284 throw_main_exception_exit();
1286 if (!builtin_init())
1287 throw_main_exception_exit();
1289 /* Initialize the JNI subsystem (must be done _before_
1290 threads_init, as threads_init can call JNI methods
1291 (e.g. NewGlobalRef). */
1294 throw_main_exception_exit();
1296 #if defined(ENABLE_THREADS)
1297 if (!threads_init())
1298 throw_main_exception_exit();
1301 /* That's important, otherwise we get into trouble, if the Runtime
1302 static initializer is called before (circular dependency. This
1303 is with classpath 0.09. Another important thing is, that this
1304 has to happen after initThreads!!! */
1306 if (!initialize_class(class_java_lang_System))
1307 throw_main_exception_exit();
1309 #if defined(ENABLE_PROFILING)
1310 /* initialize profiling */
1312 if (!profile_init())
1313 throw_main_exception_exit();
1316 #if defined(ENABLE_THREADS)
1317 /* initialize recompilation */
1319 if (!recompile_init())
1320 throw_main_exception_exit();
1322 /* finally, start the finalizer thread */
1324 if (!finalizer_start_thread())
1325 throw_main_exception_exit();
1327 /* start the recompilation thread (must be done before the
1328 profiling thread) */
1330 if (!recompile_start_thread())
1331 throw_main_exception_exit();
1333 # if defined(ENABLE_PROFILING)
1334 /* start the profile sampling thread */
1337 if (!profile_start_thread())
1338 throw_main_exception_exit();
1342 #if defined(ENABLE_JVMTI)
1344 /* add agent library to native library hashtable */
1345 native_hashtable_library_add(utf_new_char(libname), class_java_lang_Object->classloader, handle);
1349 /* increment the number of VMs */
1353 /* initialization is done */
1355 vm_initializing = false;
1357 /* everything's ok */
1363 /* vm_destroy ******************************************************************
1365 Unloads a Java VM and reclaims its resources.
1367 *******************************************************************************/
1369 s4 vm_destroy(JavaVM *vm)
1371 #if defined(ENABLE_THREADS)
1372 threads_join_all_threads();
1375 /* everything's ok */
1381 /* vm_exit *********************************************************************
1383 Calls java.lang.System.exit(I)V to exit the JavaVM correctly.
1385 *******************************************************************************/
1387 void vm_exit(s4 status)
1391 /* signal that we are exiting */
1395 assert(class_java_lang_System);
1396 assert(class_java_lang_System->state & CLASS_LOADED);
1398 #if defined(ENABLE_JVMTI)
1399 if (jvmti || (dbgcom!=NULL)) {
1400 jvmti_set_phase(JVMTI_PHASE_DEAD);
1401 if (jvmti) jvmti_agentunload();
1405 if (!link_class(class_java_lang_System))
1406 throw_main_exception_exit();
1408 /* call java.lang.System.exit(I)V */
1410 m = class_resolveclassmethod(class_java_lang_System,
1411 utf_new_char("exit"),
1413 class_java_lang_Object,
1417 throw_main_exception_exit();
1419 /* call the exit function with passed exit status */
1421 (void) vm_call_method(m, NULL, status);
1423 /* If we had an exception, just ignore the exception and exit with
1426 vm_shutdown(status);
1430 /* vm_shutdown *****************************************************************
1432 Terminates the system immediately without freeing memory explicitly
1433 (to be used only for abnormal termination).
1435 *******************************************************************************/
1437 void vm_shutdown(s4 status)
1440 #if defined(ENABLE_STATISTICS)
1441 || opt_getcompilingtime || opt_stat
1445 log_text("CACAO terminated by shutdown");
1446 dolog("Exit status: %d\n", (s4) status);
1450 #if defined(ENABLE_JVMTI)
1451 /* terminate cacaodbgserver */
1453 pthread_mutex_lock(&dbgcomlock);
1455 pthread_mutex_unlock(&dbgcomlock);
1456 jvmti_cacaodbgserver_quit();
1464 /* vm_exit_handler *************************************************************
1466 The exit_handler function is called upon program termination.
1468 ATTENTION: Don't free system resources here! Some threads may still
1469 be running as this is called from VMRuntime.exit(). The OS does the
1472 *******************************************************************************/
1474 void vm_exit_handler(void)
1476 #if !defined(NDEBUG)
1478 class_showmethods(mainclass);
1480 if (showconstantpool)
1481 class_showconstantpool(mainclass);
1486 # if defined(ENABLE_PROFILING)
1488 profile_printstats();
1490 #endif /* !defined(NDEBUG) */
1492 #if defined(ENABLE_RT_TIMING)
1493 rt_timing_print_time_stats(stderr);
1496 #if defined(ENABLE_CYCLES_STATS)
1497 builtin_print_cycles_stats(stderr);
1498 stacktrace_print_cycles_stats(stderr);
1502 #if defined(ENABLE_STATISTICS)
1503 || opt_getcompilingtime || opt_stat
1507 log_text("CACAO terminated");
1509 #if defined(ENABLE_STATISTICS)
1512 #ifdef TYPECHECK_STATISTICS
1513 typecheck_print_statistics(get_logfile());
1519 if (opt_getcompilingtime)
1521 #endif /* defined(ENABLE_STATISTICS) */
1523 /* vm_print_profile(stderr);*/
1527 /* vm_abort ********************************************************************
1529 Prints an error message and aborts the VM.
1531 *******************************************************************************/
1533 void vm_abort(const char *text, ...)
1537 /* print the log message */
1542 log_vprint(text, ap);
1547 /* now abort the VM */
1553 /* vm_vmargs_from_valist *******************************************************
1557 *******************************************************************************/
1559 static void vm_vmargs_from_valist(methodinfo *m, java_objectheader *o,
1560 vm_arg *vmargs, va_list ap)
1562 typedesc *paramtypes;
1565 paramtypes = m->parseddesc->paramtypes;
1567 /* if method is non-static fill first block and skip `this' pointer */
1572 /* the `this' pointer */
1573 vmargs[0].type = TYPE_ADR;
1574 vmargs[0].data.l = (u8) (ptrint) o;
1580 for (; i < m->parseddesc->paramcount; i++, paramtypes++) {
1581 switch (paramtypes->decltype) {
1582 /* primitive types */
1583 case PRIMITIVETYPE_BOOLEAN:
1584 case PRIMITIVETYPE_BYTE:
1585 case PRIMITIVETYPE_CHAR:
1586 case PRIMITIVETYPE_SHORT:
1587 case PRIMITIVETYPE_INT:
1588 vmargs[i].type = TYPE_INT;
1589 vmargs[i].data.l = (s8) va_arg(ap, s4);
1592 case PRIMITIVETYPE_LONG:
1593 vmargs[i].type = TYPE_LNG;
1594 vmargs[i].data.l = (s8) va_arg(ap, s8);
1597 case PRIMITIVETYPE_FLOAT:
1598 vmargs[i].type = TYPE_FLT;
1599 #if defined(__ALPHA__)
1600 /* this keeps the assembler function much simpler */
1602 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1604 vmargs[i].data.f = (jfloat) va_arg(ap, jdouble);
1608 case PRIMITIVETYPE_DOUBLE:
1609 vmargs[i].type = TYPE_DBL;
1610 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1614 vmargs[i].type = TYPE_ADR;
1615 vmargs[i].data.l = (u8) (ptrint) va_arg(ap, void*);
1622 /* vm_vmargs_from_jvalue *******************************************************
1626 *******************************************************************************/
1628 static void vm_vmargs_from_jvalue(methodinfo *m, java_objectheader *o,
1629 vm_arg *vmargs, jvalue *args)
1631 typedesc *paramtypes;
1635 paramtypes = m->parseddesc->paramtypes;
1637 /* if method is non-static fill first block and skip `this' pointer */
1642 /* the `this' pointer */
1643 vmargs[0].type = TYPE_ADR;
1644 vmargs[0].data.l = (u8) (ptrint) o;
1650 for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) {
1651 switch (paramtypes->decltype) {
1652 /* primitive types */
1653 case PRIMITIVETYPE_BOOLEAN:
1654 case PRIMITIVETYPE_BYTE:
1655 case PRIMITIVETYPE_CHAR:
1656 case PRIMITIVETYPE_SHORT:
1657 case PRIMITIVETYPE_INT:
1658 vmargs[i].type = TYPE_INT;
1659 vmargs[i].data.l = (s8) args[j].i;
1662 case PRIMITIVETYPE_LONG:
1663 vmargs[i].type = TYPE_LNG;
1664 vmargs[i].data.l = (s8) args[j].j;
1667 case PRIMITIVETYPE_FLOAT:
1668 vmargs[i].type = TYPE_FLT;
1669 #if defined(__ALPHA__)
1670 /* this keeps the assembler function much simpler */
1672 vmargs[i].data.d = (jdouble) args[j].f;
1674 vmargs[i].data.f = args[j].f;
1678 case PRIMITIVETYPE_DOUBLE:
1679 vmargs[i].type = TYPE_DBL;
1680 vmargs[i].data.d = args[j].d;
1684 vmargs[i].type = TYPE_ADR;
1685 vmargs[i].data.l = (u8) (ptrint) args[j].l;
1692 /* vm_call_method **************************************************************
1694 Calls a Java method with a variable number of arguments and returns
1697 *******************************************************************************/
1699 java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
1702 java_objectheader *ro;
1705 ro = vm_call_method_valist(m, o, ap);
1712 /* vm_call_method_valist *******************************************************
1714 Calls a Java method with a variable number of arguments, passed via
1715 a va_list, and returns an address.
1717 *******************************************************************************/
1719 java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o,
1724 java_objectheader *ro;
1727 /* mark start of dump memory area */
1729 dumpsize = dump_size();
1731 /* get number of Java method arguments */
1733 vmargscount = m->parseddesc->paramcount;
1735 /* allocate vm_arg array */
1737 vmargs = DMNEW(vm_arg, vmargscount);
1739 /* fill the vm_arg array from a va_list */
1741 vm_vmargs_from_valist(m, o, vmargs, ap);
1743 /* call the Java method */
1745 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1747 /* release dump area */
1749 dump_release(dumpsize);
1755 /* vm_call_method_jvalue *******************************************************
1757 Calls a Java method with a variable number of arguments, passed via
1758 a jvalue array, and returns an address.
1760 *******************************************************************************/
1762 java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o,
1767 java_objectheader *ro;
1770 /* mark start of dump memory area */
1772 dumpsize = dump_size();
1774 /* get number of Java method arguments */
1776 vmargscount = m->parseddesc->paramcount;
1778 /* allocate vm_arg array */
1780 vmargs = DMNEW(vm_arg, vmargscount);
1782 /* fill the vm_arg array from a va_list */
1784 vm_vmargs_from_jvalue(m, o, vmargs, args);
1786 /* call the Java method */
1788 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1790 /* release dump area */
1792 dump_release(dumpsize);
1798 /* vm_call_method_vmarg ********************************************************
1800 Calls a Java method with a variable number of arguments, passed via
1801 a vm_arg array, and returns an address.
1803 *******************************************************************************/
1805 java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
1808 java_objectheader *o;
1810 #if defined(ENABLE_JIT)
1811 # if defined(ENABLE_INTRP)
1813 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1816 o = asm_vm_call_method(m, vmargscount, vmargs);
1818 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1825 /* vm_call_method_int **********************************************************
1827 Calls a Java method with a variable number of arguments and returns
1830 *******************************************************************************/
1832 s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...)
1838 i = vm_call_method_int_valist(m, o, ap);
1845 /* vm_call_method_int_valist ***************************************************
1847 Calls a Java method with a variable number of arguments, passed via
1848 a va_list, and returns an integer (s4).
1850 *******************************************************************************/
1852 s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap)
1859 /* mark start of dump memory area */
1861 dumpsize = dump_size();
1863 /* get number of Java method arguments */
1865 vmargscount = m->parseddesc->paramcount;
1867 /* allocate vm_arg array */
1869 vmargs = DMNEW(vm_arg, vmargscount);
1871 /* fill the vm_arg array from a va_list */
1873 vm_vmargs_from_valist(m, o, vmargs, ap);
1875 /* call the Java method */
1877 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1879 /* release dump area */
1881 dump_release(dumpsize);
1887 /* vm_call_method_int_jvalue ***************************************************
1889 Calls a Java method with a variable number of arguments, passed via
1890 a jvalue array, and returns an integer (s4).
1892 *******************************************************************************/
1894 s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
1901 /* mark start of dump memory area */
1903 dumpsize = dump_size();
1905 /* get number of Java method arguments */
1907 vmargscount = m->parseddesc->paramcount;
1909 /* allocate vm_arg array */
1911 vmargs = DMNEW(vm_arg, vmargscount);
1913 /* fill the vm_arg array from a va_list */
1915 vm_vmargs_from_jvalue(m, o, vmargs, args);
1917 /* call the Java method */
1919 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1921 /* release dump area */
1923 dump_release(dumpsize);
1929 /* vm_call_method_int_vmarg ****************************************************
1931 Calls a Java method with a variable number of arguments, passed via
1932 a vm_arg array, and returns an integer (s4).
1934 *******************************************************************************/
1936 s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
1940 #if defined(ENABLE_JIT)
1941 # if defined(ENABLE_INTRP)
1943 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1946 i = asm_vm_call_method_int(m, vmargscount, vmargs);
1948 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1955 /* vm_call_method_long *********************************************************
1957 Calls a Java method with a variable number of arguments and returns
1960 *******************************************************************************/
1962 s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...)
1968 l = vm_call_method_long_valist(m, o, ap);
1975 /* vm_call_method_long_valist **************************************************
1977 Calls a Java method with a variable number of arguments, passed via
1978 a va_list, and returns a long (s8).
1980 *******************************************************************************/
1982 s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap)
1989 /* mark start of dump memory area */
1991 dumpsize = dump_size();
1993 /* get number of Java method arguments */
1995 vmargscount = m->parseddesc->paramcount;
1997 /* allocate vm_arg array */
1999 vmargs = DMNEW(vm_arg, vmargscount);
2001 /* fill the vm_arg array from a va_list */
2003 vm_vmargs_from_valist(m, o, vmargs, ap);
2005 /* call the Java method */
2007 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2009 /* release dump area */
2011 dump_release(dumpsize);
2017 /* vm_call_method_long_jvalue **************************************************
2019 Calls a Java method with a variable number of arguments, passed via
2020 a jvalue array, and returns a long (s8).
2022 *******************************************************************************/
2024 s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
2031 /* mark start of dump memory area */
2033 dumpsize = dump_size();
2035 /* get number of Java method arguments */
2037 vmargscount = m->parseddesc->paramcount;
2039 /* allocate vm_arg array */
2041 vmargs = DMNEW(vm_arg, vmargscount);
2043 /* fill the vm_arg array from a va_list */
2045 vm_vmargs_from_jvalue(m, o, vmargs, args);
2047 /* call the Java method */
2049 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2051 /* release dump area */
2053 dump_release(dumpsize);
2059 /* vm_call_method_long_vmarg ***************************************************
2061 Calls a Java method with a variable number of arguments, passed via
2062 a vm_arg array, and returns a long (s8).
2064 *******************************************************************************/
2066 s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2070 #if defined(ENABLE_JIT)
2071 # if defined(ENABLE_INTRP)
2073 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2076 l = asm_vm_call_method_long(m, vmargscount, vmargs);
2078 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2085 /* vm_call_method_float ********************************************************
2087 Calls a Java method with a variable number of arguments and returns
2090 *******************************************************************************/
2092 float vm_call_method_float(methodinfo *m, java_objectheader *o, ...)
2098 f = vm_call_method_float_valist(m, o, ap);
2105 /* vm_call_method_float_valist *************************************************
2107 Calls a Java method with a variable number of arguments, passed via
2108 a va_list, and returns a float.
2110 *******************************************************************************/
2112 float vm_call_method_float_valist(methodinfo *m, java_objectheader *o,
2120 /* mark start of dump memory area */
2122 dumpsize = dump_size();
2124 /* get number of Java method arguments */
2126 vmargscount = m->parseddesc->paramcount;
2128 /* allocate vm_arg array */
2130 vmargs = DMNEW(vm_arg, vmargscount);
2132 /* fill the vm_arg array from a va_list */
2134 vm_vmargs_from_valist(m, o, vmargs, ap);
2136 /* call the Java method */
2138 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2140 /* release dump area */
2142 dump_release(dumpsize);
2148 /* vm_call_method_float_jvalue *************************************************
2150 Calls a Java method with a variable number of arguments, passed via
2151 a jvalue array, and returns a float.
2153 *******************************************************************************/
2155 float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o,
2163 /* mark start of dump memory area */
2165 dumpsize = dump_size();
2167 /* get number of Java method arguments */
2169 vmargscount = m->parseddesc->paramcount;
2171 /* allocate vm_arg array */
2173 vmargs = DMNEW(vm_arg, vmargscount);
2175 /* fill the vm_arg array from a va_list */
2177 vm_vmargs_from_jvalue(m, o, vmargs, args);
2179 /* call the Java method */
2181 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2183 /* release dump area */
2185 dump_release(dumpsize);
2191 /* vm_call_method_float_vmarg **************************************************
2193 Calls a Java method with a variable number of arguments and returns
2196 *******************************************************************************/
2198 float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2202 #if defined(ENABLE_JIT)
2203 # if defined(ENABLE_INTRP)
2205 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2208 f = asm_vm_call_method_float(m, vmargscount, vmargs);
2210 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2217 /* vm_call_method_double *******************************************************
2219 Calls a Java method with a variable number of arguments and returns
2222 *******************************************************************************/
2224 double vm_call_method_double(methodinfo *m, java_objectheader *o, ...)
2230 d = vm_call_method_double_valist(m, o, ap);
2237 /* vm_call_method_double_valist ************************************************
2239 Calls a Java method with a variable number of arguments, passed via
2240 a va_list, and returns a double.
2242 *******************************************************************************/
2244 double vm_call_method_double_valist(methodinfo *m, java_objectheader *o,
2252 /* mark start of dump memory area */
2254 dumpsize = dump_size();
2256 /* get number of Java method arguments */
2258 vmargscount = m->parseddesc->paramcount;
2260 /* allocate vm_arg array */
2262 vmargs = DMNEW(vm_arg, vmargscount);
2264 /* fill the vm_arg array from a va_list */
2266 vm_vmargs_from_valist(m, o, vmargs, ap);
2268 /* call the Java method */
2270 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2272 /* release dump area */
2274 dump_release(dumpsize);
2280 /* vm_call_method_double_jvalue ************************************************
2282 Calls a Java method with a variable number of arguments, passed via
2283 a jvalue array, and returns a double.
2285 *******************************************************************************/
2287 double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o,
2295 /* mark start of dump memory area */
2297 dumpsize = dump_size();
2299 /* get number of Java method arguments */
2301 vmargscount = m->parseddesc->paramcount;
2303 /* allocate vm_arg array */
2305 vmargs = DMNEW(vm_arg, vmargscount);
2307 /* fill the vm_arg array from a va_list */
2309 vm_vmargs_from_jvalue(m, o, vmargs, args);
2311 /* call the Java method */
2313 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2315 /* release dump area */
2317 dump_release(dumpsize);
2323 /* vm_call_method_double_vmarg *************************************************
2325 Calls a Java method with a variable number of arguments and returns
2328 *******************************************************************************/
2330 double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
2335 #if defined(ENABLE_JIT)
2336 # if defined(ENABLE_INTRP)
2338 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2341 d = asm_vm_call_method_double(m, vmargscount, vmargs);
2343 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2351 * These are local overrides for various environment variables in Emacs.
2352 * Please do not remove this and leave it at the end of the file, where
2353 * Emacs will automagically detect them.
2354 * ---------------------------------------------------------------------
2357 * indent-tabs-mode: t