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)
172 #if defined(ENABLE_VERIFIER)
174 #if defined(TYPECHECK_VERBOSE)
177 #endif /* defined(ENABLE_VERIFIER) */
180 /* optimization options */
182 #if defined(ENABLE_LOOP)
186 #if defined(ENABLE_IFCONV)
190 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
194 #if defined(ENABLE_INLINING)
198 #if defined(ENABLE_INTRP)
199 /* interpreter options */
222 opt_struct opts[] = {
223 { "foo", false, OPT_FOO },
227 { "jar", false, OPT_JAR },
229 { "d32", false, OPT_D32 },
230 { "d64", false, OPT_D64 },
231 { "client", false, OPT_IGNORE },
232 { "server", false, OPT_IGNORE },
233 { "jvm", false, OPT_IGNORE },
234 { "hotspot", false, OPT_IGNORE },
236 { "classpath", true, OPT_CLASSPATH },
237 { "cp", true, OPT_CLASSPATH },
238 { "D", true, OPT_D },
239 { "version", false, OPT_VERSION },
240 { "showversion", false, OPT_SHOWVERSION },
241 { "fullversion", false, OPT_FULLVERSION },
242 { "help", false, OPT_HELP },
243 { "?", false, OPT_HELP },
244 { "X", false, OPT_X },
246 { "esa", false, OPT_ESA },
247 { "enablesystemassertions", false, OPT_ESA },
248 { "dsa", false, OPT_DSA },
249 { "disablesystemassertions", false, OPT_DSA },
251 { "noasyncgc", false, OPT_IGNORE },
252 #if defined(ENABLE_VERIFIER)
253 { "noverify", false, OPT_NOVERIFY },
255 { "v", false, OPT_VERBOSE1 },
256 { "verbose:", true, OPT_VERBOSE },
258 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
259 { "verbosetc", false, OPT_VERBOSETC },
261 #if defined(__ALPHA__)
262 { "noieee", false, OPT_NOIEEE },
264 { "softnull", false, OPT_SOFTNULL },
265 #if defined(ENABLE_STATISTICS)
266 { "time", false, OPT_TIME },
267 { "stat", false, OPT_STAT },
269 { "log", true, OPT_LOG },
270 { "c", true, OPT_CHECK },
271 { "l", false, OPT_LOAD },
272 { "eager", false, OPT_EAGER },
273 { "sig", true, OPT_SIGNATURE },
274 { "all", false, OPT_ALL },
275 #if defined(ENABLE_LOOP)
276 { "oloop", false, OPT_OLOOP },
278 #if defined(ENABLE_IFCONV)
279 { "ifconv", false, OPT_IFCONV },
281 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
282 { "lsra", false, OPT_LSRA },
285 #if defined(ENABLE_INTRP)
286 /* interpreter options */
288 { "trace", false, OPT_TRACE },
289 { "static-supers", true, OPT_STATIC_SUPERS },
290 { "no-dynamic", false, OPT_NO_DYNAMIC },
291 { "no-replication", false, OPT_NO_REPLICATION },
292 { "no-quicksuper", false, OPT_NO_QUICKSUPER },
295 /* JVMTI Agent Command Line Options */
297 { "agentlib:", true, OPT_AGENTLIB },
298 { "agentpath:", true, OPT_AGENTPATH },
301 /* Java non-standard options */
303 { "Xjit", false, OPT_JIT },
304 { "Xint", false, OPT_INTRP },
305 { "Xbootclasspath:", true, OPT_BOOTCLASSPATH },
306 { "Xbootclasspath/a:", true, OPT_BOOTCLASSPATH_A },
307 { "Xbootclasspath/p:", true, OPT_BOOTCLASSPATH_P },
308 { "Xglibj:", true, OPT_GLIBJ },
311 { "Xdebug", false, OPT_DEBUG },
312 { "Xnoagent", false, OPT_NOAGENT },
313 { "Xrunjdwp", true, OPT_XRUNJDWP },
316 { "Xms", true, OPT_MS },
317 { "ms", true, OPT_MS },
318 { "Xmx", true, OPT_MX },
319 { "mx", true, OPT_MX },
320 { "Xss", true, OPT_SS },
321 { "ss", true, OPT_SS },
322 { "Xprof:", true, OPT_PROF_OPTION },
323 { "Xprof", false, OPT_PROF },
325 /* keep these at the end of the list */
327 #if defined(ENABLE_INLINING)
328 { "i", true, OPT_INLINING },
330 { "m", true, OPT_METHOD },
331 { "s", true, OPT_SHOW },
337 /* usage ***********************************************************************
339 Prints the correct usage syntax to stdout.
341 *******************************************************************************/
345 puts("Usage: cacao [-options] classname [arguments]");
346 puts(" (to run a class file)");
347 puts(" or cacao [-options] -jar jarfile [arguments]");
348 puts(" (to run a standalone jar file)\n");
350 puts("Java options:");
351 puts(" -d32 use 32-bit data model if available");
352 puts(" -d64 use 64-bit data model if available");
353 puts(" -client compatibility (currently ignored)");
354 puts(" -server compatibility (currently ignored)");
355 puts(" -jvm compatibility (currently ignored)");
356 puts(" -hotspot compatibility (currently ignored)\n");
358 puts(" -cp <path> specify a path to look for classes");
359 puts(" -classpath <path> specify a path to look for classes");
360 puts(" -D<name>=<value> add an entry to the property list");
361 puts(" -verbose[:class|gc|jni] enable specific verbose output");
362 puts(" -version print product version and exit");
363 puts(" -fullversion print jpackage-compatible product version and exit");
364 puts(" -showversion print product version and continue");
365 puts(" -help, -? print this help message");
366 puts(" -X print help on non-standard Java options");
367 puts(" -esa | -enablesystemassertions");
368 puts(" enable system assertions");
369 puts(" -dsa | -disablesystemassertions");
370 puts(" disable system assertions");
374 puts(" -agentlib:<agent-lib-name>=<options> library to load containg JVMTI agent");
375 puts (" for jdwp help use: -agentlib:jdwp=help");
376 puts(" -agentpath:<path-to-agent>=<options> path to library containg JVMTI agent");
379 puts("CACAO options:");
380 puts(" -v write state-information");
381 puts(" -verbose[:call|exception|jit]");
382 puts(" enable specific verbose output");
383 #ifdef TYPECHECK_VERBOSE
384 puts(" -verbosetc write debug messages while typechecking");
386 #if defined(__ALPHA__)
387 puts(" -noieee don't use ieee compliant arithmetic");
389 #if defined(ENABLE_VERIFIER)
390 puts(" -noverify don't verify classfiles");
392 puts(" -softnull use software nullpointer check");
393 #if defined(ENABLE_STATISTICS)
394 puts(" -time measure the runtime");
395 puts(" -stat detailed compiler statistics");
397 puts(" -log logfile specify a name for the logfile");
398 puts(" -c(heck)b(ounds) don't check array bounds");
399 puts(" s(ync) don't check for synchronization");
400 #if defined(ENABLE_LOOP)
401 puts(" -oloop optimize array accesses in loops");
403 puts(" -l don't start the class after loading");
404 puts(" -eager perform eager class loading and linking");
405 puts(" -all compile all methods, no execution");
406 puts(" -m compile only a specific method");
407 puts(" -sig specify signature for a specific method");
408 puts(" -s(how)... show...");
409 puts(" c(onstants) the constant pool");
410 puts(" m(ethods) class fields and methods");
411 puts(" u(tf) the utf - hash");
412 puts(" i(ntermediate) intermediate representation");
413 #if defined(ENABLE_DISASSEMBLER)
414 puts(" a(ssembler) disassembled listing");
415 puts(" e(xceptionstubs) disassembled exception stubs (only with -sa)");
416 puts(" n(ative) disassembled native stubs");
418 puts(" d(atasegment) data segment listing");
419 #if defined(ENABLE_INLINING)
420 puts(" -i n(line) activate inlining");
421 puts(" v(irtual) inline virtual methods (uses/turns rt option on)");
422 puts(" e(exception) inline methods with exceptions");
423 puts(" p(aramopt) optimize argument renaming");
424 puts(" o(utsiders) inline methods of foreign classes");
425 #endif /* defined(ENABLE_INLINING) */
426 #if defined(ENABLE_IFCONV)
427 puts(" -ifconv use if-conversion");
429 #if defined(ENABLE_LSRA)
430 puts(" -lsra use linear scan register allocation");
432 #if defined(ENABLE_SSA)
433 puts(" -lsra use linear scan register allocation (with SSA)");
436 /* exit with error code */
442 static void Xusage(void)
444 #if defined(ENABLE_JIT)
445 puts(" -Xjit JIT mode execution (default)");
447 #if defined(ENABLE_INTRP)
448 puts(" -Xint interpreter mode execution");
450 puts(" -Xbootclasspath:<zip/jar files and directories separated by :>");
451 puts(" value is set as bootstrap class path");
452 puts(" -Xbootclasspath/a:<zip/jar files and directories separated by :>");
453 puts(" value is appended to the bootstrap class path");
454 puts(" -Xbootclasspath/p:<zip/jar files and directories separated by :>");
455 puts(" value is prepended to the bootstrap class path");
456 puts(" -Xglibj:<zip/jar files and directories separated by :>");
457 puts(" value is used as Java core library, but the");
458 puts(" hardcoded VM interface classes are prepended");
459 printf(" -Xms<size> set the initial size of the heap (default: %dMB)\n", HEAP_STARTSIZE / 1024 / 1024);
460 printf(" -Xmx<size> set the maximum size of the heap (default: %dMB)\n", HEAP_MAXSIZE / 1024 / 1024);
461 printf(" -Xss<size> set the thread stack size (default: %dkB)\n", STACK_SIZE / 1024);
462 puts(" -Xprof[:bb] collect and print profiling data");
463 #if defined(ENABLE_JVMTI)
464 /* -Xdebug option depend on gnu classpath JDWP options. options:
465 transport=dt_socket,address=<hostname:port>,server=(y|n),suspend(y|n) */
466 puts(" -Xdebug enable remote debugging\n");
467 puts(" -Xrunjdwp transport=[dt_socket|...],address=<hostname:port>,server=[y|n],suspend=[y|n]\n");
468 puts(" enable remote debugging\n");
471 /* exit with error code */
477 /* version *********************************************************************
479 Only prints cacao version information.
481 *******************************************************************************/
483 static void version(bool opt_exit)
485 puts("java version \""JAVA_VERSION"\"");
486 puts("CACAO version "VERSION"");
488 puts("Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,");
489 puts("C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,");
490 puts("E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,");
491 puts("J. Wenninger, Institut f. Computersprachen - TU Wien\n");
493 puts("This program is free software; you can redistribute it and/or");
494 puts("modify it under the terms of the GNU General Public License as");
495 puts("published by the Free Software Foundation; either version 2, or (at");
496 puts("your option) any later version.\n");
498 puts("This program is distributed in the hope that it will be useful, but");
499 puts("WITHOUT ANY WARRANTY; without even the implied warranty of");
500 puts("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU");
501 puts("General Public License for more details.\n");
503 puts("Configure/Build options:\n");
504 puts(" ./configure: "VERSION_CONFIGURE_ARGS"");
505 #if defined(__VERSION__)
506 puts(" CC : "VERSION_CC" ("__VERSION__")");
508 puts(" CC : "VERSION_CC"");
510 puts(" CFLAGS : "VERSION_CFLAGS"\n");
512 puts("Default variables:\n");
513 printf(" maximum heap size : %d\n", HEAP_MAXSIZE);
514 printf(" initial heap size : %d\n", HEAP_STARTSIZE);
515 printf(" stack size : %d\n", STACK_SIZE);
516 puts(" java.boot.class.path: "CACAO_VM_ZIP":"CLASSPATH_GLIBJ_ZIP"");
517 puts(" java.library.path : "CLASSPATH_LIBRARY_PATH"\n");
519 puts("Runtime variables:\n");
520 printf(" maximum heap size : %d\n", opt_heapmaxsize);
521 printf(" initial heap size : %d\n", opt_heapstartsize);
522 printf(" stack size : %d\n", opt_stacksize);
523 printf(" java.boot.class.path: %s\n", bootclasspath);
525 /* exit normally, if requested */
532 /* fullversion *****************************************************************
534 Prints a Sun compatible version information (required e.g. by
535 jpackage, www.jpackage.org).
537 *******************************************************************************/
539 static void fullversion(void)
541 puts("java full version \"cacao-"JAVA_VERSION"\"");
549 /* vm_create *******************************************************************
551 Creates a JVM. Called by JNI_CreateJavaVM.
553 *******************************************************************************/
555 bool vm_create(JavaVMInitArgs *vm_args)
564 #if defined(ENABLE_JVMTI)
566 char *libname, *agentarg;
567 bool jdwp,agentbypath;
568 jdwp = agentbypath = false;
571 /* check the JNI version requested */
573 switch (vm_args->version) {
574 case JNI_VERSION_1_1:
576 case JNI_VERSION_1_2:
577 case JNI_VERSION_1_4:
583 /* we only support 1 JVM instance */
588 /* set the VM starttime */
590 _Jv_jvm->starttime = builtin_currenttimemillis();
592 /* get stuff from the environment *****************************************/
594 #if defined(DISABLE_GC)
595 nogc_init(HEAP_MAXSIZE, HEAP_STARTSIZE);
598 /* set the bootclasspath */
600 cp = getenv("BOOTCLASSPATH");
603 bootclasspath = MNEW(char, strlen(cp) + strlen("0"));
604 strcpy(bootclasspath, cp);
607 len = strlen(CACAO_VM_ZIP) +
609 strlen(CLASSPATH_GLIBJ_ZIP) +
612 bootclasspath = MNEW(char, len);
613 strcat(bootclasspath, CACAO_VM_ZIP);
614 strcat(bootclasspath, ":");
615 strcat(bootclasspath, CLASSPATH_GLIBJ_ZIP);
618 /* set the classpath */
620 cp = getenv("CLASSPATH");
623 classpath = MNEW(char, strlen(cp) + strlen("0"));
624 strcat(classpath, cp);
627 classpath = MNEW(char, strlen(".") + strlen("0"));
628 strcpy(classpath, ".");
632 /* interpret the options **************************************************/
640 opt_heapmaxsize = HEAP_MAXSIZE;
641 opt_heapstartsize = HEAP_STARTSIZE;
642 opt_stacksize = STACK_SIZE;
645 #if defined(ENABLE_JVMTI)
646 /* initialize JVMTI related **********************************************/
650 /* initialize properties before commandline handling */
652 if (!properties_init())
653 throw_cacao_exception_exit(string_java_lang_InternalError,
654 "Unable to init properties");
656 /* add some default properties */
658 properties_add("java.endorsed.dirs", ""CACAO_PREFIX"/jre/lib/endorsed");
661 /* iterate over all passed options */
663 while ((opt = options_get(opts, vm_args)) != OPT_DONE) {
677 #if SIZEOF_VOID_P == 8
678 puts("Running a 32-bit JVM is not supported on this platform.");
684 #if SIZEOF_VOID_P == 4
685 puts("Running a 64-bit JVM is not supported on this platform.");
691 /* forget old classpath and set the argument as new classpath */
692 MFREE(classpath, char, strlen(classpath));
694 classpath = MNEW(char, strlen(opt_arg) + strlen("0"));
695 strcpy(classpath, opt_arg);
699 for (j = 0; j < strlen(opt_arg); j++) {
700 if (opt_arg[j] == '=') {
702 properties_add(opt_arg, opt_arg + j + 1);
707 /* if no '=' is given, just create an empty property */
709 properties_add(opt_arg, "");
714 case OPT_BOOTCLASSPATH:
715 /* Forget default bootclasspath and set the argument as
716 new boot classpath. */
718 MFREE(bootclasspath, char, strlen(bootclasspath));
720 bootclasspath = MNEW(char, strlen(opt_arg) + strlen("0"));
721 strcpy(bootclasspath, opt_arg);
724 case OPT_BOOTCLASSPATH_A:
725 /* append to end of bootclasspath */
727 len = strlen(bootclasspath);
729 bootclasspath = MREALLOC(bootclasspath,
733 strlen(opt_arg) + strlen("0"));
735 strcat(bootclasspath, ":");
736 strcat(bootclasspath, opt_arg);
739 case OPT_BOOTCLASSPATH_P:
740 /* prepend in front of bootclasspath */
745 bootclasspath = MNEW(char, strlen(opt_arg) + strlen(":") +
748 strcpy(bootclasspath, opt_arg);
749 strcat(bootclasspath, ":");
750 strcat(bootclasspath, cp);
752 MFREE(cp, char, len);
756 /* use as Java core library, but prepend VM interface classes */
758 MFREE(bootclasspath, char, strlen(bootclasspath));
760 len = strlen(CACAO_VM_ZIP) +
765 bootclasspath = MNEW(char, len);
767 strcpy(bootclasspath, CACAO_VM_ZIP);
768 strcat(bootclasspath, ":");
769 strcat(bootclasspath, opt_arg);
772 #if defined(ENABLE_JVMTI)
774 /* this option exists only for compatibility reasons */
778 /* I don't know yet what Xnoagent should do. This is only for
779 compatiblity with eclipse - motse */
788 strlen(CACAO_LIBDIR) +
789 strlen("/libjdwp.so=") +
793 agentarg = MNEW(char, len);
795 strcpy(agentarg, CACAO_LIBDIR);
796 strcat(agentarg, "/libjdwp.so=");
797 strcat(agentarg, &opt_arg[1]);
814 c = opt_arg[strlen(opt_arg) - 1];
816 if ((c == 'k') || (c == 'K')) {
817 j = atoi(opt_arg) * 1024;
819 } else if ((c == 'm') || (c == 'M')) {
820 j = atoi(opt_arg) * 1024 * 1024;
827 else if (opt == OPT_MS)
828 opt_heapstartsize = j;
839 if (strcmp("class", opt_arg) == 0)
840 opt_verboseclass = true;
842 else if (strcmp("gc", opt_arg) == 0)
843 opt_verbosegc = true;
845 else if (strcmp("jni", opt_arg) == 0)
846 opt_verbosejni = true;
848 else if (strcmp("call", opt_arg) == 0)
849 opt_verbosecall = true;
851 else if (strcmp("jit", opt_arg) == 0) {
856 compileverbose = true;
858 else if (strcmp("exception", opt_arg) == 0)
859 opt_verboseexception = true;
862 #if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
864 opt_typecheckverbose = true;
873 case OPT_FULLVERSION:
877 case OPT_SHOWVERSION:
885 #if defined(ENABLE_VERIFIER)
895 #if defined(ENABLE_STATISTICS)
897 opt_getcompilingtime = true;
898 opt_getloadingtime = true;
911 for (j = 0; j < strlen(opt_arg); j++) {
912 switch (opt_arg[j]) {
927 makeinitializations = false;
936 opt_method = opt_arg;
937 makeinitializations = false;
941 opt_signature = opt_arg;
947 makeinitializations = false;
950 case OPT_SHOW: /* Display options */
951 for (j = 0; j < strlen(opt_arg); j++) {
952 switch (opt_arg[j]) {
954 showconstantpool = true;
966 opt_showintermediate = true;
967 compileverbose = true;
970 #if defined(ENABLE_DISASSEMBLER)
972 opt_showdisassemble = true;
973 compileverbose = true;
977 opt_showexceptionstubs = true;
981 opt_shownativestub = true;
986 opt_showddatasegment = true;
995 #if defined(ENABLE_LOOP)
1001 #if defined(ENABLE_INLINING)
1003 for (j = 0; j < strlen(opt_arg); j++) {
1004 switch (opt_arg[j]) {
1006 /* define in options.h; Used in main.c, jit.c
1007 & inline.c inlining is currently
1011 inlinevirtuals = true;
1014 inlineexceptions = true;
1017 inlineparamopt = true;
1020 inlineoutsiders = true;
1027 #endif /* defined(ENABLE_INLINING) */
1029 #if defined(ENABLE_IFCONV)
1035 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
1050 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = true;
1054 _Jv_jvm->Java_java_lang_VMClassLoader_defaultAssertionStatus = false;
1057 case OPT_PROF_OPTION:
1058 /* use <= to get the last \0 too */
1060 for (j = 0, k = 0; j <= strlen(opt_arg); j++) {
1061 if (opt_arg[j] == ',')
1064 if (opt_arg[j] == '\0') {
1065 if (strcmp("bb", opt_arg + k) == 0)
1069 printf("Unknown option: -Xprof:%s\n", opt_arg + k);
1073 /* set k to next char */
1085 #if defined(ENABLE_JIT)
1088 printf("-Xjit option not enabled.\n");
1094 #if defined(ENABLE_INTRP)
1097 printf("-Xint option not enabled.\n");
1102 #if defined(ENABLE_INTRP)
1103 case OPT_STATIC_SUPERS:
1104 opt_static_supers = atoi(opt_arg);
1107 case OPT_NO_DYNAMIC:
1108 opt_no_dynamic = true;
1111 case OPT_NO_REPLICATION:
1112 opt_no_replication = true;
1115 case OPT_NO_QUICKSUPER:
1116 opt_no_quicksuper = true;
1125 printf("Unknown option: %s\n",
1126 vm_args->options[opt_index].optionString);
1132 /* Now we have all options handled and we can print the version
1139 /* get the main class *****************************************************/
1141 if (opt_index < vm_args->nOptions) {
1142 mainstring = vm_args->options[opt_index++].optionString;
1144 /* Put the jar file into the classpath (if any). */
1146 if (opt_jar == true) {
1147 /* free old classpath */
1149 MFREE(classpath, char, strlen(classpath));
1151 /* put jarfile into classpath */
1153 classpath = MNEW(char, strlen(mainstring) + strlen("0"));
1155 strcpy(classpath, mainstring);
1158 /* replace .'s with /'s in classname */
1160 for (i = strlen(mainstring) - 1; i >= 0; i--)
1161 if (mainstring[i] == '.')
1162 mainstring[i] = '/';
1166 #if defined(ENABLE_JVMTI)
1168 jvmti_set_phase(JVMTI_PHASE_ONLOAD);
1169 jvmti_agentload(agentarg, agentbypath, &handle, &libname);
1172 MFREE(agentarg, char, strlen(agentarg));
1174 jvmti_set_phase(JVMTI_PHASE_PRIMORDIAL);
1180 /* initialize this JVM ****************************************************/
1182 vm_initializing = true;
1184 /* initialize the garbage collector */
1186 gc_init(opt_heapmaxsize, opt_heapstartsize);
1188 #if defined(ENABLE_INTRP)
1189 /* Allocate main thread stack on the Java heap. */
1192 intrp_main_stack = GCMNEW(u1, opt_stacksize);
1193 MSET(intrp_main_stack, 0, u1, opt_stacksize);
1197 #if defined(ENABLE_THREADS)
1201 /* initialize the string hashtable stuff: lock (must be done
1202 _after_ threads_preinit) */
1205 throw_main_exception_exit();
1207 /* initialize the utf8 hashtable stuff: lock, often used utf8
1208 strings (must be done _after_ threads_preinit) */
1211 throw_main_exception_exit();
1213 /* initialize the classcache hashtable stuff: lock, hashtable
1214 (must be done _after_ threads_preinit) */
1216 if (!classcache_init())
1217 throw_main_exception_exit();
1219 /* initialize the loader with bootclasspath (must be done _after_
1223 throw_main_exception_exit();
1225 suck_add_from_property("java.endorsed.dirs");
1226 suck_add(bootclasspath);
1228 /* initialize the memory subsystem (must be done _after_
1232 throw_main_exception_exit();
1234 /* initialize the finalizer stuff (must be done _after_
1237 if (!finalizer_init())
1238 throw_main_exception_exit();
1240 /* install architecture dependent signal handler used for exceptions */
1244 /* initialize the codegen subsystems */
1248 /* initializes jit compiler */
1252 /* machine dependent initialization */
1254 #if defined(ENABLE_JIT)
1255 # if defined(ENABLE_INTRP)
1265 /* initialize the loader subsystems (must be done _after_
1269 throw_main_exception_exit();
1272 throw_main_exception_exit();
1275 throw_main_exception_exit();
1277 if (!exceptions_init())
1278 throw_main_exception_exit();
1280 if (!builtin_init())
1281 throw_main_exception_exit();
1283 /* Initialize the JNI subsystem (must be done _before_
1284 threads_init, as threads_init can call JNI methods
1285 (e.g. NewGlobalRef). */
1288 throw_main_exception_exit();
1290 #if defined(ENABLE_THREADS)
1291 if (!threads_init())
1292 throw_main_exception_exit();
1295 /* That's important, otherwise we get into trouble, if the Runtime
1296 static initializer is called before (circular dependency. This
1297 is with classpath 0.09. Another important thing is, that this
1298 has to happen after initThreads!!! */
1300 if (!initialize_class(class_java_lang_System))
1301 throw_main_exception_exit();
1303 #if defined(ENABLE_PROFILING)
1304 /* initialize profiling */
1306 if (!profile_init())
1307 throw_main_exception_exit();
1310 #if defined(ENABLE_THREADS)
1311 /* initialize recompilation */
1313 if (!recompile_init())
1314 throw_main_exception_exit();
1316 /* finally, start the finalizer thread */
1318 if (!finalizer_start_thread())
1319 throw_main_exception_exit();
1321 /* start the recompilation thread (must be done before the
1322 profiling thread) */
1324 if (!recompile_start_thread())
1325 throw_main_exception_exit();
1327 # if defined(ENABLE_PROFILING)
1328 /* start the profile sampling thread */
1331 if (!profile_start_thread())
1332 throw_main_exception_exit();
1336 #if defined(ENABLE_JVMTI)
1338 /* add agent library to native library hashtable */
1339 native_hashtable_library_add(utf_new_char(libname), class_java_lang_Object->classloader, handle);
1343 /* increment the number of VMs */
1347 /* initialization is done */
1349 vm_initializing = false;
1351 /* everything's ok */
1357 /* vm_destroy ******************************************************************
1359 Unloads a Java VM and reclaims its resources.
1361 *******************************************************************************/
1363 s4 vm_destroy(JavaVM *vm)
1365 #if defined(ENABLE_THREADS)
1366 threads_join_all_threads();
1369 /* everything's ok */
1375 /* vm_exit *********************************************************************
1377 Calls java.lang.System.exit(I)V to exit the JavaVM correctly.
1379 *******************************************************************************/
1381 void vm_exit(s4 status)
1385 /* signal that we are exiting */
1389 assert(class_java_lang_System);
1390 assert(class_java_lang_System->state & CLASS_LOADED);
1392 #if defined(ENABLE_JVMTI)
1393 if (jvmti || (dbgcom!=NULL)) {
1394 jvmti_set_phase(JVMTI_PHASE_DEAD);
1395 if (jvmti) jvmti_agentunload();
1399 if (!link_class(class_java_lang_System))
1400 throw_main_exception_exit();
1402 /* call java.lang.System.exit(I)V */
1404 m = class_resolveclassmethod(class_java_lang_System,
1405 utf_new_char("exit"),
1407 class_java_lang_Object,
1411 throw_main_exception_exit();
1413 /* call the exit function with passed exit status */
1415 (void) vm_call_method(m, NULL, status);
1417 /* If we had an exception, just ignore the exception and exit with
1420 vm_shutdown(status);
1424 /* vm_shutdown *****************************************************************
1426 Terminates the system immediately without freeing memory explicitly
1427 (to be used only for abnormal termination).
1429 *******************************************************************************/
1431 void vm_shutdown(s4 status)
1434 #if defined(ENABLE_STATISTICS)
1435 || opt_getcompilingtime || opt_stat
1439 log_text("CACAO terminated by shutdown");
1440 dolog("Exit status: %d\n", (s4) status);
1444 #if defined(ENABLE_JVMTI)
1445 /* terminate cacaodbgserver */
1447 pthread_mutex_lock(&dbgcomlock);
1449 pthread_mutex_unlock(&dbgcomlock);
1450 jvmti_cacaodbgserver_quit();
1458 /* vm_exit_handler *************************************************************
1460 The exit_handler function is called upon program termination.
1462 ATTENTION: Don't free system resources here! Some threads may still
1463 be running as this is called from VMRuntime.exit(). The OS does the
1466 *******************************************************************************/
1468 void vm_exit_handler(void)
1470 #if !defined(NDEBUG)
1472 class_showmethods(mainclass);
1474 if (showconstantpool)
1475 class_showconstantpool(mainclass);
1480 # if defined(ENABLE_PROFILING)
1482 profile_printstats();
1484 #endif /* !defined(NDEBUG) */
1486 #if defined(ENABLE_RT_TIMING)
1487 rt_timing_print_time_stats(stderr);
1490 #if defined(ENABLE_CYCLES_STATS)
1491 builtin_print_cycles_stats(stderr);
1492 stacktrace_print_cycles_stats(stderr);
1496 #if defined(ENABLE_STATISTICS)
1497 || opt_getcompilingtime || opt_stat
1501 log_text("CACAO terminated");
1503 #if defined(ENABLE_STATISTICS)
1506 #ifdef TYPECHECK_STATISTICS
1507 typecheck_print_statistics(get_logfile());
1513 if (opt_getcompilingtime)
1515 #endif /* defined(ENABLE_STATISTICS) */
1517 /* vm_print_profile(stderr);*/
1521 /* vm_abort ********************************************************************
1523 Prints an error message and aborts the VM.
1525 *******************************************************************************/
1527 void vm_abort(const char *text, ...)
1531 /* print the log message */
1536 log_vprint(text, ap);
1541 /* now abort the VM */
1547 /* vm_vmargs_from_valist *******************************************************
1551 *******************************************************************************/
1553 static void vm_vmargs_from_valist(methodinfo *m, java_objectheader *o,
1554 vm_arg *vmargs, va_list ap)
1556 typedesc *paramtypes;
1559 paramtypes = m->parseddesc->paramtypes;
1561 /* if method is non-static fill first block and skip `this' pointer */
1566 /* the `this' pointer */
1567 vmargs[0].type = TYPE_ADR;
1568 vmargs[0].data.l = (u8) (ptrint) o;
1574 for (; i < m->parseddesc->paramcount; i++, paramtypes++) {
1575 switch (paramtypes->decltype) {
1576 /* primitive types */
1577 case PRIMITIVETYPE_BOOLEAN:
1578 case PRIMITIVETYPE_BYTE:
1579 case PRIMITIVETYPE_CHAR:
1580 case PRIMITIVETYPE_SHORT:
1581 case PRIMITIVETYPE_INT:
1582 vmargs[i].type = TYPE_INT;
1583 vmargs[i].data.l = (s8) va_arg(ap, s4);
1586 case PRIMITIVETYPE_LONG:
1587 vmargs[i].type = TYPE_LNG;
1588 vmargs[i].data.l = (s8) va_arg(ap, s8);
1591 case PRIMITIVETYPE_FLOAT:
1592 vmargs[i].type = TYPE_FLT;
1593 #if defined(__ALPHA__)
1594 /* this keeps the assembler function much simpler */
1596 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1598 vmargs[i].data.f = (jfloat) va_arg(ap, jdouble);
1602 case PRIMITIVETYPE_DOUBLE:
1603 vmargs[i].type = TYPE_DBL;
1604 vmargs[i].data.d = (jdouble) va_arg(ap, jdouble);
1608 vmargs[i].type = TYPE_ADR;
1609 vmargs[i].data.l = (u8) (ptrint) va_arg(ap, void*);
1616 /* vm_vmargs_from_jvalue *******************************************************
1620 *******************************************************************************/
1622 static void vm_vmargs_from_jvalue(methodinfo *m, java_objectheader *o,
1623 vm_arg *vmargs, jvalue *args)
1625 typedesc *paramtypes;
1629 paramtypes = m->parseddesc->paramtypes;
1631 /* if method is non-static fill first block and skip `this' pointer */
1636 /* the `this' pointer */
1637 vmargs[0].type = TYPE_ADR;
1638 vmargs[0].data.l = (u8) (ptrint) o;
1644 for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) {
1645 switch (paramtypes->decltype) {
1646 /* primitive types */
1647 case PRIMITIVETYPE_BOOLEAN:
1648 case PRIMITIVETYPE_BYTE:
1649 case PRIMITIVETYPE_CHAR:
1650 case PRIMITIVETYPE_SHORT:
1651 case PRIMITIVETYPE_INT:
1652 vmargs[i].type = TYPE_INT;
1653 vmargs[i].data.l = (s8) args[j].i;
1656 case PRIMITIVETYPE_LONG:
1657 vmargs[i].type = TYPE_LNG;
1658 vmargs[i].data.l = (s8) args[j].j;
1661 case PRIMITIVETYPE_FLOAT:
1662 vmargs[i].type = TYPE_FLT;
1663 #if defined(__ALPHA__)
1664 /* this keeps the assembler function much simpler */
1666 vmargs[i].data.d = (jdouble) args[j].f;
1668 vmargs[i].data.f = args[j].f;
1672 case PRIMITIVETYPE_DOUBLE:
1673 vmargs[i].type = TYPE_DBL;
1674 vmargs[i].data.d = args[j].d;
1678 vmargs[i].type = TYPE_ADR;
1679 vmargs[i].data.l = (u8) (ptrint) args[j].l;
1686 /* vm_call_method **************************************************************
1688 Calls a Java method with a variable number of arguments and returns
1691 *******************************************************************************/
1693 java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
1696 java_objectheader *ro;
1699 ro = vm_call_method_valist(m, o, ap);
1706 /* vm_call_method_valist *******************************************************
1708 Calls a Java method with a variable number of arguments, passed via
1709 a va_list, and returns an address.
1711 *******************************************************************************/
1713 java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o,
1718 java_objectheader *ro;
1721 /* mark start of dump memory area */
1723 dumpsize = dump_size();
1725 /* get number of Java method arguments */
1727 vmargscount = m->parseddesc->paramcount;
1729 /* allocate vm_arg array */
1731 vmargs = DMNEW(vm_arg, vmargscount);
1733 /* fill the vm_arg array from a va_list */
1735 vm_vmargs_from_valist(m, o, vmargs, ap);
1737 /* call the Java method */
1739 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1741 /* release dump area */
1743 dump_release(dumpsize);
1749 /* vm_call_method_jvalue *******************************************************
1751 Calls a Java method with a variable number of arguments, passed via
1752 a jvalue array, and returns an address.
1754 *******************************************************************************/
1756 java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o,
1761 java_objectheader *ro;
1764 /* mark start of dump memory area */
1766 dumpsize = dump_size();
1768 /* get number of Java method arguments */
1770 vmargscount = m->parseddesc->paramcount;
1772 /* allocate vm_arg array */
1774 vmargs = DMNEW(vm_arg, vmargscount);
1776 /* fill the vm_arg array from a va_list */
1778 vm_vmargs_from_jvalue(m, o, vmargs, args);
1780 /* call the Java method */
1782 ro = vm_call_method_vmarg(m, vmargscount, vmargs);
1784 /* release dump area */
1786 dump_release(dumpsize);
1792 /* vm_call_method_vmarg ********************************************************
1794 Calls a Java method with a variable number of arguments, passed via
1795 a vm_arg array, and returns an address.
1797 *******************************************************************************/
1799 java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
1802 java_objectheader *o;
1804 #if defined(ENABLE_JIT)
1805 # if defined(ENABLE_INTRP)
1807 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1810 o = asm_vm_call_method(m, vmargscount, vmargs);
1812 o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
1819 /* vm_call_method_int **********************************************************
1821 Calls a Java method with a variable number of arguments and returns
1824 *******************************************************************************/
1826 s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...)
1832 i = vm_call_method_int_valist(m, o, ap);
1839 /* vm_call_method_int_valist ***************************************************
1841 Calls a Java method with a variable number of arguments, passed via
1842 a va_list, and returns an integer (s4).
1844 *******************************************************************************/
1846 s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap)
1853 /* mark start of dump memory area */
1855 dumpsize = dump_size();
1857 /* get number of Java method arguments */
1859 vmargscount = m->parseddesc->paramcount;
1861 /* allocate vm_arg array */
1863 vmargs = DMNEW(vm_arg, vmargscount);
1865 /* fill the vm_arg array from a va_list */
1867 vm_vmargs_from_valist(m, o, vmargs, ap);
1869 /* call the Java method */
1871 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1873 /* release dump area */
1875 dump_release(dumpsize);
1881 /* vm_call_method_int_jvalue ***************************************************
1883 Calls a Java method with a variable number of arguments, passed via
1884 a jvalue array, and returns an integer (s4).
1886 *******************************************************************************/
1888 s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
1895 /* mark start of dump memory area */
1897 dumpsize = dump_size();
1899 /* get number of Java method arguments */
1901 vmargscount = m->parseddesc->paramcount;
1903 /* allocate vm_arg array */
1905 vmargs = DMNEW(vm_arg, vmargscount);
1907 /* fill the vm_arg array from a va_list */
1909 vm_vmargs_from_jvalue(m, o, vmargs, args);
1911 /* call the Java method */
1913 i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
1915 /* release dump area */
1917 dump_release(dumpsize);
1923 /* vm_call_method_int_vmarg ****************************************************
1925 Calls a Java method with a variable number of arguments, passed via
1926 a vm_arg array, and returns an integer (s4).
1928 *******************************************************************************/
1930 s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
1934 #if defined(ENABLE_JIT)
1935 # if defined(ENABLE_INTRP)
1937 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1940 i = asm_vm_call_method_int(m, vmargscount, vmargs);
1942 i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
1949 /* vm_call_method_long *********************************************************
1951 Calls a Java method with a variable number of arguments and returns
1954 *******************************************************************************/
1956 s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...)
1962 l = vm_call_method_long_valist(m, o, ap);
1969 /* vm_call_method_long_valist **************************************************
1971 Calls a Java method with a variable number of arguments, passed via
1972 a va_list, and returns a long (s8).
1974 *******************************************************************************/
1976 s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap)
1983 /* mark start of dump memory area */
1985 dumpsize = dump_size();
1987 /* get number of Java method arguments */
1989 vmargscount = m->parseddesc->paramcount;
1991 /* allocate vm_arg array */
1993 vmargs = DMNEW(vm_arg, vmargscount);
1995 /* fill the vm_arg array from a va_list */
1997 vm_vmargs_from_valist(m, o, vmargs, ap);
1999 /* call the Java method */
2001 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2003 /* release dump area */
2005 dump_release(dumpsize);
2011 /* vm_call_method_long_jvalue **************************************************
2013 Calls a Java method with a variable number of arguments, passed via
2014 a jvalue array, and returns a long (s8).
2016 *******************************************************************************/
2018 s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
2025 /* mark start of dump memory area */
2027 dumpsize = dump_size();
2029 /* get number of Java method arguments */
2031 vmargscount = m->parseddesc->paramcount;
2033 /* allocate vm_arg array */
2035 vmargs = DMNEW(vm_arg, vmargscount);
2037 /* fill the vm_arg array from a va_list */
2039 vm_vmargs_from_jvalue(m, o, vmargs, args);
2041 /* call the Java method */
2043 l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
2045 /* release dump area */
2047 dump_release(dumpsize);
2053 /* vm_call_method_long_vmarg ***************************************************
2055 Calls a Java method with a variable number of arguments, passed via
2056 a vm_arg array, and returns a long (s8).
2058 *******************************************************************************/
2060 s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2064 #if defined(ENABLE_JIT)
2065 # if defined(ENABLE_INTRP)
2067 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2070 l = asm_vm_call_method_long(m, vmargscount, vmargs);
2072 l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
2079 /* vm_call_method_float ********************************************************
2081 Calls a Java method with a variable number of arguments and returns
2084 *******************************************************************************/
2086 float vm_call_method_float(methodinfo *m, java_objectheader *o, ...)
2092 f = vm_call_method_float_valist(m, o, ap);
2099 /* vm_call_method_float_valist *************************************************
2101 Calls a Java method with a variable number of arguments, passed via
2102 a va_list, and returns a float.
2104 *******************************************************************************/
2106 float vm_call_method_float_valist(methodinfo *m, java_objectheader *o,
2114 /* mark start of dump memory area */
2116 dumpsize = dump_size();
2118 /* get number of Java method arguments */
2120 vmargscount = m->parseddesc->paramcount;
2122 /* allocate vm_arg array */
2124 vmargs = DMNEW(vm_arg, vmargscount);
2126 /* fill the vm_arg array from a va_list */
2128 vm_vmargs_from_valist(m, o, vmargs, ap);
2130 /* call the Java method */
2132 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2134 /* release dump area */
2136 dump_release(dumpsize);
2142 /* vm_call_method_float_jvalue *************************************************
2144 Calls a Java method with a variable number of arguments, passed via
2145 a jvalue array, and returns a float.
2147 *******************************************************************************/
2149 float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o,
2157 /* mark start of dump memory area */
2159 dumpsize = dump_size();
2161 /* get number of Java method arguments */
2163 vmargscount = m->parseddesc->paramcount;
2165 /* allocate vm_arg array */
2167 vmargs = DMNEW(vm_arg, vmargscount);
2169 /* fill the vm_arg array from a va_list */
2171 vm_vmargs_from_jvalue(m, o, vmargs, args);
2173 /* call the Java method */
2175 f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
2177 /* release dump area */
2179 dump_release(dumpsize);
2185 /* vm_call_method_float_vmarg **************************************************
2187 Calls a Java method with a variable number of arguments and returns
2190 *******************************************************************************/
2192 float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
2196 #if defined(ENABLE_JIT)
2197 # if defined(ENABLE_INTRP)
2199 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2202 f = asm_vm_call_method_float(m, vmargscount, vmargs);
2204 f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
2211 /* vm_call_method_double *******************************************************
2213 Calls a Java method with a variable number of arguments and returns
2216 *******************************************************************************/
2218 double vm_call_method_double(methodinfo *m, java_objectheader *o, ...)
2224 d = vm_call_method_double_valist(m, o, ap);
2231 /* vm_call_method_double_valist ************************************************
2233 Calls a Java method with a variable number of arguments, passed via
2234 a va_list, and returns a double.
2236 *******************************************************************************/
2238 double vm_call_method_double_valist(methodinfo *m, java_objectheader *o,
2246 /* mark start of dump memory area */
2248 dumpsize = dump_size();
2250 /* get number of Java method arguments */
2252 vmargscount = m->parseddesc->paramcount;
2254 /* allocate vm_arg array */
2256 vmargs = DMNEW(vm_arg, vmargscount);
2258 /* fill the vm_arg array from a va_list */
2260 vm_vmargs_from_valist(m, o, vmargs, ap);
2262 /* call the Java method */
2264 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2266 /* release dump area */
2268 dump_release(dumpsize);
2274 /* vm_call_method_double_jvalue ************************************************
2276 Calls a Java method with a variable number of arguments, passed via
2277 a jvalue array, and returns a double.
2279 *******************************************************************************/
2281 double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o,
2289 /* mark start of dump memory area */
2291 dumpsize = dump_size();
2293 /* get number of Java method arguments */
2295 vmargscount = m->parseddesc->paramcount;
2297 /* allocate vm_arg array */
2299 vmargs = DMNEW(vm_arg, vmargscount);
2301 /* fill the vm_arg array from a va_list */
2303 vm_vmargs_from_jvalue(m, o, vmargs, args);
2305 /* call the Java method */
2307 d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
2309 /* release dump area */
2311 dump_release(dumpsize);
2317 /* vm_call_method_double_vmarg *************************************************
2319 Calls a Java method with a variable number of arguments and returns
2322 *******************************************************************************/
2324 double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
2329 #if defined(ENABLE_JIT)
2330 # if defined(ENABLE_INTRP)
2332 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2335 d = asm_vm_call_method_double(m, vmargscount, vmargs);
2337 d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
2345 * These are local overrides for various environment variables in Emacs.
2346 * Please do not remove this and leave it at the end of the file, where
2347 * Emacs will automagically detect them.
2348 * ---------------------------------------------------------------------
2351 * indent-tabs-mode: t