1 /* cacao/cacao.c - contains main() of cacao
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 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., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Reinhard Grafl
34 This module does the following tasks:
35 - Command line option handling
36 - Calling initialization routines
37 - Calling the class loader
38 - Running the main method
40 $Id: cacao.c 2000 2005-03-05 17:05:40Z twisti $
48 #include "cacao/cacao.h"
50 #include "mm/memory.h"
51 #include "native/jni.h"
52 #include "native/native.h"
53 #include "toolbox/logging.h"
54 #include "vm/exceptions.h"
55 #include "vm/global.h"
56 #include "vm/loader.h"
57 #include "vm/options.h"
58 #include "vm/statistics.h"
59 #include "vm/stringlocal.h"
60 #include "vm/tables.h"
61 #include "vm/jit/asmpart.h"
62 #include "vm/jit/jit.h"
64 #ifdef TYPEINFO_DEBUG_TEST
65 #include "vm/jit/verify/typeinfo.h"
69 /* define heap sizes **********************************************************/
71 #define HEAP_MAXSIZE 64 * 1024 * 1024; /* default 64MB */
72 #define HEAP_STARTSIZE 2 * 1024 * 1024; /* default 2MB */
75 /* Invocation API variables ***************************************************/
77 JavaVM *jvm; /* denotes a Java VM */
78 JNIEnv *env; /* pointer to native method interface */
80 JDK1_1InitArgs vm_args; /* JDK 1.1 VM initialization arguments */
83 bool cacao_initializing;
85 char *bootclasspath; /* contains the boot classpath */
86 char *classpath; /* contains the classpath */
89 static classinfo *mainclass;
91 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
92 void **stackbottom = 0;
96 /* define command line options ************************************************/
98 #define OPT_CLASSPATH 2
102 #define OPT_VERBOSE1 6
103 #define OPT_VERBOSE 7
104 #define OPT_VERBOSEGC 8
105 #define OPT_VERBOSECALL 9
106 #define OPT_NOIEEE 10
107 #define OPT_SOFTNULL 11
113 #define OPT_METHOD 17
114 #define OPT_SIGNATURE 18
118 #define OPT_INLINING 25
120 #define STATIC_ANALYSIS
121 #if defined(STATIC_ANALYSIS)
125 #endif /* STATIC_ANALYSIS */
127 #define OPT_VERBOSETC 29
128 #define OPT_NOVERIFY 30
129 #define OPT_LIBERALUTF 31
130 #define OPT_VERBOSEEXCEPTION 32
138 #define OPT_BOOTCLASSPATH 36
139 #define OPT_BOOTCLASSPATH_A 37
140 #define OPT_BOOTCLASSPATH_P 38
141 #define OPT_VERSION 39
144 opt_struct opts[] = {
145 { "classpath", true, OPT_CLASSPATH },
146 { "cp", true, OPT_CLASSPATH },
147 { "D", true, OPT_D },
148 { "Xms", true, OPT_MS },
149 { "Xmx", true, OPT_MX },
150 { "ms", true, OPT_MS },
151 { "mx", true, OPT_MX },
152 { "noasyncgc", false, OPT_IGNORE },
153 { "noverify", false, OPT_NOVERIFY },
154 { "liberalutf", false, OPT_LIBERALUTF },
155 { "oss", true, OPT_IGNORE },
156 { "ss", true, OPT_IGNORE },
157 { "v", false, OPT_VERBOSE1 },
158 { "verbose", false, OPT_VERBOSE },
159 { "verbosegc", false, OPT_VERBOSEGC },
160 { "verbosecall", false, OPT_VERBOSECALL },
161 { "verboseexception", false, OPT_VERBOSEEXCEPTION },
162 #ifdef TYPECHECK_VERBOSE
163 { "verbosetc", false, OPT_VERBOSETC },
165 #if defined(__ALPHA__)
166 { "noieee", false, OPT_NOIEEE },
168 { "softnull", false, OPT_SOFTNULL },
169 { "time", false, OPT_TIME },
170 { "stat", false, OPT_STAT },
171 { "log", true, OPT_LOG },
172 { "c", true, OPT_CHECK },
173 { "l", false, OPT_LOAD },
174 { "eager", false, OPT_EAGER },
175 { "m", true, OPT_METHOD },
176 { "sig", true, OPT_SIGNATURE },
177 { "s", true, OPT_SHOW },
178 { "all", false, OPT_ALL },
179 { "oloop", false, OPT_OLOOP },
180 { "i", true, OPT_INLINING },
181 #ifdef STATIC_ANALYSIS
182 { "rt", false, OPT_RT },
183 { "xta", false, OPT_XTA },
184 { "vta", false, OPT_VTA },
187 { "lsra", false, OPT_LSRA },
189 { "jar", false, OPT_JAR },
190 { "Xbootclasspath:", true, OPT_BOOTCLASSPATH },
191 { "Xbootclasspath/a:", true, OPT_BOOTCLASSPATH_A },
192 { "Xbootclasspath/p:", true, OPT_BOOTCLASSPATH_P },
193 { "version", false, OPT_VERSION },
198 /******************** interne Function: print_usage ************************
200 Prints the correct usage syntax to stdout.
202 ***************************************************************************/
206 printf("Usage: cacao [options] classname [program arguments]\n\n");
208 printf("Options:\n");
209 printf(" -cp <path> specify a path to look for classes\n");
210 printf(" -classpath <path> specify a path to look for classes\n");
211 printf(" -jar jarfile execute a jar file\n");
212 printf(" -D<name>=<value> add an entry to the property list\n");
213 printf(" -Xmx<size>[kK|mM] specify the size for the heap\n");
214 printf(" -Xms<size>[kK|mM] specify the initial size for the heap\n");
215 printf(" -mx<size>[kK|mM] specify the size for the heap\n");
216 printf(" -ms<size>[kK|mM] specify the initial size for the heap\n");
217 printf(" -Xbootclasspath:<path> set search path for bootstrap classes and resources\n");
218 printf(" -Xbootclasspath/a:<path> append to end of bootstrap class path\n");
219 printf(" -Xbootclasspath/p:<path> prepend in front of bootstrap class path\n");
220 printf(" -v ................... write state-information\n");
221 printf(" -verbose ............. write more information\n");
222 printf(" -verbosegc ........... write message for each GC\n");
223 printf(" -verbosecall ......... write message for each call\n");
224 printf(" -verboseexception .... write message for each step of stack unwinding\n");
225 #ifdef TYPECHECK_VERBOSE
226 printf(" -verbosetc ........... write debug messages while typechecking\n");
228 printf(" -version print product version and exit\n");
229 #if defined(__ALPHA__)
230 printf(" -noieee .............. don't use ieee compliant arithmetic\n");
232 printf(" -noverify ............ don't verify classfiles\n");
233 printf(" -liberalutf........... don't warn about overlong UTF-8 sequences\n");
234 printf(" -softnull ............ use software nullpointer check\n");
235 printf(" -time ................ measure the runtime\n");
236 printf(" -stat ................ detailed compiler statistics\n");
237 printf(" -log logfile ......... specify a name for the logfile\n");
238 printf(" -c(heck)b(ounds) ..... don't check array bounds\n");
239 printf(" s(ync) ....... don't check for synchronization\n");
240 printf(" -oloop ............... optimize array accesses in loops\n");
241 printf(" -l ................... don't start the class after loading\n");
242 printf(" -eager ............... perform eager class loading and linking\n");
243 printf(" -all ................. compile all methods, no execution\n");
244 printf(" -m ................... compile only a specific method\n");
245 printf(" -sig ................. specify signature for a specific method\n");
246 printf(" -s(how)a(ssembler) ... show disassembled listing\n");
247 printf(" c(onstants) ... show the constant pool\n");
248 printf(" d(atasegment).. show data segment listing\n");
249 printf(" i(ntermediate). show intermediate representation\n");
250 printf(" m(ethods)...... show class fields and methods\n");
251 printf(" u(tf) ......... show the utf - hash\n");
252 printf(" -i n ............. activate inlining\n");
253 printf(" v ............. inline virtual methods\n");
254 printf(" uses/turns rt option on\n");
255 printf(" e ............. inline methods with exceptions\n");
256 printf(" p ............. optimize argument renaming\n");
257 printf(" o ............. inline methods of foreign classes\n");
258 #ifdef STATIC_ANALYSIS
259 printf(" -rt .................. use rapid type analysis\n");
260 printf(" -xta ................. use x type analysis\n");
261 printf(" -vta ................. use variable type analysis\n");
264 printf(" -lsra ................ use linear scan register allocation\n");
267 /* exit with error code */
273 /* version *********************************************************************
275 Only prints cacao version information and exits.
277 *******************************************************************************/
279 static void version()
281 printf("cacao "VERSION"\n");
286 #ifdef TYPECHECK_STATISTICS
287 void typecheck_print_statistics(FILE *file);
292 /* getmainclassfromjar ************************************************************
294 gets the name of the main class form a jar's manifest file
296 **********************************************************************************/
298 char *getmainclassnamefromjar(JNIEnv *env, char *mainstring)
304 class = (*env)->FindClass(env, "java/util/jar/JarFile");
306 log_text("unable to find java.util.jar.JarFile");
307 throw_main_exception_exit();
310 mid = (*env)->GetMethodID(NULL, class, "<init>","(Ljava/lang/String;)V");
312 log_text("unable to find constructor in java.util.jar.JarFile");
317 obj = (*env)->NewObject(NULL,class,mid,((*env)->NewStringUTF(NULL,(char*)mainstring)));
318 if ((*env)->ExceptionOccurred(NULL) != NULL) {
319 (*env)->ExceptionDescribe(NULL);
323 mid = (*env)->GetMethodID(NULL, class, "getManifest","()Ljava/util/jar/Manifest;");
325 log_text("unable to find getMainfest method");
329 /* get manifest object */
330 obj = (*env)->CallObjectMethod(NULL,obj,mid);
331 if ((*env)->ExceptionOccurred(NULL) != NULL) {
332 (*env)->ExceptionDescribe(NULL);
336 mid = (*env)->GetMethodID(NULL, (jclass)((java_objectheader*) obj)->vftbl->class, "getMainAttributes","()Ljava/util/jar/Attributes;");
338 log_text("unable to find getMainAttributes method");
342 /* get Main Attributes */
343 obj = (*env)->CallObjectMethod(NULL,obj,mid);
344 if ((*env)->ExceptionOccurred(NULL) != NULL) {
345 (*env)->ExceptionDescribe(NULL);
350 mid = (*env)->GetMethodID(NULL, (jclass)((java_objectheader*) obj)->vftbl->class, "getValue","(Ljava/lang/String;)Ljava/lang/String;");
352 log_text("unable to find getValue method");
356 /* get property Main-Class */
357 obj = (*env)->CallObjectMethod(NULL,obj,mid,(*env)->NewStringUTF(NULL,"Main-Class"));
358 if ((*env)->ExceptionOccurred(NULL) != NULL) {
359 (*env)->ExceptionDescribe(NULL);
363 return javastring_tochar((java_objectheader *) obj);
368 * void exit_handler(void)
369 * -----------------------
370 * The exit_handler function is called upon program termination to shutdown
371 * the various subsystems and release the resources allocated to the VM.
373 void exit_handler(void)
375 /********************* Print debug tables ************************/
377 if (showmethods) class_showmethods(mainclass);
378 if (showconstantpool) class_showconstantpool(mainclass);
379 if (showutf) utf_show();
381 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
382 clear_thread_flags(); /* restores standard file descriptor
386 /************************ Free all resources *******************/
391 MFREE(classpath, u1, strlen(classpath));
393 if (opt_verbose || getcompilingtime || opt_stat) {
394 log_text("CACAO terminated");
397 #ifdef TYPECHECK_STATISTICS
398 typecheck_print_statistics(get_logfile());
401 if (getcompilingtime)
408 /************************** Function: main *******************************
412 **************************************************************************/
414 int main(int argc, char **argv)
419 /********** interne (nur fuer main relevante Optionen) **************/
421 char logfilename[200] = "";
427 char *specificmethodname = NULL;
428 char *specificsignature = NULL;
431 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
432 stackbottom = &dummy;
435 if (atexit(exit_handler))
436 throw_cacao_exception_exit(string_java_lang_InternalError,
437 "Unable to register exit_handler");
440 /************ Collect info from the environment ************************/
442 /* set the bootclasspath */
444 cp = getenv("BOOTCLASSPATH");
446 bootclasspath = MNEW(char, strlen(cp) + 1);
447 strcpy(bootclasspath, cp);
450 cplen = strlen(CACAO_INSTALL_PREFIX) + strlen(CACAO_RT_JAR_PATH);
452 bootclasspath = MNEW(char, cplen + 1);
453 strcpy(bootclasspath, CACAO_INSTALL_PREFIX);
454 strcat(bootclasspath, CACAO_RT_JAR_PATH);
458 /* set the classpath */
460 cp = getenv("CLASSPATH");
462 classpath = MNEW(char, strlen(cp) + 1);
463 strcat(classpath, cp);
466 classpath = MNEW(char, 2);
467 strcpy(classpath, ".");
471 /***************** Interpret the command line *****************/
476 heapmaxsize = HEAP_MAXSIZE;
477 heapstartsize = HEAP_STARTSIZE;
480 while ((i = get_opt(argc, argv, opts)) != OPT_DONE) {
485 case OPT_BOOTCLASSPATH:
486 /* Forget default bootclasspath and set the argument as new boot */
488 MFREE(bootclasspath, char, strlen(bootclasspath));
490 bootclasspath = MNEW(char, strlen(opt_arg) + 1);
491 strcpy(bootclasspath, opt_arg);
494 case OPT_BOOTCLASSPATH_A:
495 /* append to end of bootclasspath */
496 cplen = strlen(bootclasspath);
498 bootclasspath = MREALLOC(bootclasspath,
501 cplen + 1 + strlen(opt_arg) + 1);
503 strcat(bootclasspath, ":");
504 strcat(bootclasspath, opt_arg);
507 case OPT_BOOTCLASSPATH_P:
508 /* prepend in front of bootclasspath */
512 bootclasspath = MNEW(char, strlen(opt_arg) + 1 + cplen + 1);
514 strcpy(bootclasspath, opt_arg);
515 strcat(bootclasspath, ":");
516 strcat(bootclasspath, cp);
518 MFREE(cp, char, cplen);
522 /* forget old classpath and set the argument as new classpath */
523 MFREE(classpath, char, strlen(classpath));
525 classpath = MNEW(char, strlen(opt_arg) + 1);
526 strcpy(classpath, opt_arg);
535 for (j = 0; j < strlen(opt_arg); j++) {
536 if (opt_arg[j] == '=') {
538 create_property(opt_arg, opt_arg + j + 1);
543 /* if no '=' is given, just create an empty property */
544 create_property(opt_arg, "");
554 c = opt_arg[strlen(opt_arg) - 1];
556 if (c == 'k' || c == 'K') {
557 j = 1024 * atoi(opt_arg);
559 } else if (c == 'm' || c == 'M') {
560 j = 1024 * 1024 * atoi(opt_arg);
562 } else j = atoi(opt_arg);
564 if (i == OPT_MX) heapmaxsize = j;
565 else heapstartsize = j;
578 compileverbose = true;
581 case OPT_VERBOSEEXCEPTION:
582 verboseexception = true;
586 collectverbose = true;
589 #ifdef TYPECHECK_VERBOSE
591 typecheckverbose = true;
595 case OPT_VERBOSECALL:
612 opt_liberalutf = true;
620 getcompilingtime = true;
621 getloadingtime = true;
629 strcpy(logfilename, opt_arg);
633 for (j = 0; j < strlen(opt_arg); j++) {
634 switch (opt_arg[j]) {
649 makeinitializations = false;
658 specificmethodname = opt_arg;
659 makeinitializations = false;
663 specificsignature = opt_arg;
669 makeinitializations = false;
672 case OPT_SHOW: /* Display options */
673 for (j = 0; j < strlen(opt_arg); j++) {
674 switch (opt_arg[j]) {
676 showdisassemble = true;
677 compileverbose = true;
680 showconstantpool = true;
683 showddatasegment = true;
686 showintermediate = true;
687 compileverbose = true;
706 for (j = 0; j < strlen(opt_arg); j++) {
707 switch (opt_arg[j]) {
709 /* define in options.h; Used in main.c, jit.c & inline.c */
718 inlinevirtuals = true;
722 inlineexceptions = true;
725 inlineparamopt = true;
728 inlineoutsiders = true;
736 #ifdef STATIC_ANALYSIS
738 opt_rt = true; /* default for inlining */
742 opt_xta = true; /* in test currently */
746 printf("\nVTA is not yet available\n");
748 /***opt_vta = true; not yet **/
754 #if defined(__I386__) || defined(__ALPHA__)
757 printf("LSRA not available for this architecture\n");
764 printf("Unknown option: %s\n", argv[opt_ind]);
773 /* transform dots into slashes in the class name */
775 mainstring = argv[opt_ind++];
777 /* do not mangle jar filename */
778 for (i = strlen(mainstring) - 1; i >= 0; i--) {
779 if (mainstring[i] == '.') mainstring[i] = '/';
783 /* put jarfile in classpath */
785 classpath = MNEW(char, strlen(mainstring) + 1 + strlen(classpath) + 1);
786 strcpy(classpath, mainstring);
787 strcat(classpath, ":");
788 strcat(classpath, cp);
790 MFREE(cp, char, strlen(cp));
793 /**************************** Program start *****************************/
795 log_init(logfilename);
798 log_text("CACAO started -------------------------------------------------------");
800 /* initialize JavaVM */
802 vm_args.version = 0x00010001; /* New in 1.1.2: VM version */
804 /* Get the default initialization arguments and set the class path */
806 JNI_GetDefaultJavaVMInitArgs(&vm_args);
807 vm_args.classpath = classpath;
809 /* load and initialize a Java VM, return a JNI interface pointer in env */
811 JNI_CreateJavaVM(&jvm, &env, &vm_args);
814 /* initialize the garbage collector */
816 gc_init(heapmaxsize, heapstartsize);
820 /* initialize the loader with bootclasspath and append classpath entries */
822 suck_init(bootclasspath);
823 suck_init(classpath);
825 cacao_initializing = true;
827 #if defined(USE_THREADS)
828 #if defined(NATIVE_THREADS)
834 /* install architecture dependent signal handler used for exceptions */
837 /* initializes jit compiler and codegen stuff */
840 /* initialize some cacao subsystems */
844 loader_init((u1 *) &dummy);
847 throw_main_exception_exit();
849 if (!exceptions_init())
850 throw_main_exception_exit();
852 #if defined(USE_THREADS)
853 initThreads((u1 *) &dummy);
856 *threadrootmethod = NULL;
858 /*That's important, otherwise we get into trouble, if the Runtime static
859 initializer is called before (circular dependency. This is with
860 classpath 0.09. Another important thing is, that this has to happen
861 after initThreads!!! */
863 if (!class_init(class_java_lang_System))
864 throw_main_exception_exit();
866 cacao_initializing = false;
869 /* start worker routines **************************************************/
872 classinfo *cl; /* java/lang/ClassLoader */
873 classinfo *mainclass; /* java/lang/Class */
878 /* set return value to OK */
883 /* open jar file with java.util.jar.JarFile */
884 mainstring = getmainclassnamefromjar((JNIEnv *) &env, mainstring);
887 /* get system classloader */
889 m = class_resolveclassmethod(class_java_lang_ClassLoader,
890 utf_new_char("getSystemClassLoader"),
891 utf_new_char("()Ljava/lang/ClassLoader;"),
892 class_java_lang_Object,
895 cl = (classinfo *) asm_calljavafunction(m, NULL, NULL, NULL, NULL);
897 /* get `loadClass' method */
899 m = class_resolveclassmethod(cl->header.vftbl->class,
900 utf_new_char("loadClass"),
901 utf_new_char("(Ljava/lang/String;)Ljava/lang/Class;"),
902 class_java_lang_Object,
905 /* load the main class */
908 (classinfo *) asm_calljavafunction(m,
910 javastring_new_char(mainstring),
914 /* error loading class, clear exceptionptr for new exception */
916 if (*exceptionptr || !mainclass) {
917 /* *exceptionptr = NULL; */
919 /* *exceptionptr = */
920 /* new_exception_message(string_java_lang_NoClassDefFoundError, */
922 throw_main_exception_exit();
925 /* find the `main' method of the main class */
927 m = class_resolveclassmethod(mainclass,
928 utf_new_char("main"),
929 utf_new_char("([Ljava/lang/String;)V"),
930 class_java_lang_Object,
933 /* there is no main method or it isn't static */
935 if (*exceptionptr || !m || !(m->flags & ACC_STATIC)) {
936 *exceptionptr = NULL;
939 new_exception_message(string_java_lang_NoSuchMethodError,
941 throw_main_exception_exit();
944 /* build argument array */
946 a = builtin_anewarray(argc - opt_ind, class_java_lang_String);
947 for (i = opt_ind; i < argc; i++) {
948 a->data[i - opt_ind] =
949 (java_objectheader *) javastring_new(utf_new_char(argv[i]));
952 #ifdef TYPEINFO_DEBUG_TEST
953 /* test the typeinfo system */
956 /*class_showmethods(currentThread->group->header.vftbl->class); */
958 *threadrootmethod = m;
962 asm_calljavafunction(m, a, NULL, NULL, NULL);
964 /* exception occurred? */
966 throw_main_exception();
970 #if defined(USE_THREADS)
971 #if defined(NATIVE_THREADS)
974 killThread(currentThread);
978 /* now exit the JavaVM */
980 /* (*jvm)->DestroyJavaVM(jvm); */
985 /************* If requested, compile all methods ********************/
993 /* create all classes found in the classpath */
994 /* XXX currently only works with zip/jar's */
995 create_all_classes();
997 /* load and link all classes */
998 for (slot = 0; slot < class_hash.size; slot++) {
999 c = class_hash.ptr[slot];
1004 throw_main_exception_exit();
1008 throw_main_exception_exit();
1010 /* compile all class methods */
1011 for (i = 0; i < c->methodscount; i++) {
1012 m = &(c->methods[i]);
1014 (void) jit_compile(m);
1024 /******** If requested, compile a specific method ***************/
1026 if (specificmethodname) {
1029 /* create, load and link the main class */
1030 mainclass = class_new(utf_new_char(mainstring));
1032 if (!class_load(mainclass))
1033 throw_main_exception_exit();
1035 if (!class_link(mainclass))
1036 throw_main_exception_exit();
1038 if (specificsignature) {
1039 m = class_resolveclassmethod(mainclass,
1040 utf_new_char(specificmethodname),
1041 utf_new_char(specificsignature),
1045 m = class_resolveclassmethod(mainclass,
1046 utf_new_char(specificmethodname),
1053 char message[MAXLOGTEXT];
1054 sprintf(message, "%s%s", specificmethodname,
1055 specificsignature ? specificsignature : "");
1058 new_exception_message(string_java_lang_NoSuchMethodException,
1061 throw_main_exception_exit();
1069 /* keep compiler happy */
1075 /* cacao_exit ******************************************************************
1077 Calls java.lang.Runtime.exit(I)V to exit the JavaVM correctly.
1079 *******************************************************************************/
1081 void cacao_exit(s4 status)
1086 /* class should already be loaded, but who knows... */
1088 c = class_new(utf_new_char("java/lang/System"));
1091 throw_main_exception_exit();
1094 throw_main_exception_exit();
1096 /* call System.exit(I)V */
1098 m = class_resolveclassmethod(c,
1099 utf_new_char("exit"),
1100 utf_new_char("(I)V"),
1101 class_java_lang_Object,
1105 throw_main_exception_exit();
1107 /* call the exit function with passed exit status */
1109 /* both inlinevirtual and outsiders not allowed on exit */
1110 /* not sure if permanant or temp restriction */
1111 if (inlinevirtuals) inlineoutsiders = false;
1113 asm_calljavafunction(m, (void *) (ptrint) status, NULL, NULL, NULL);
1115 /* this should never happen */
1118 throw_exception_exit();
1120 throw_cacao_exception_exit(string_java_lang_InternalError,
1121 "System.exit(I)V returned without exception");
1125 /*************************** Shutdown function *********************************
1127 Terminates the system immediately without freeing memory explicitly (to be
1128 used only for abnormal termination)
1130 *******************************************************************************/
1132 void cacao_shutdown(s4 status)
1134 if (opt_verbose || getcompilingtime || opt_stat) {
1135 log_text("CACAO terminated by shutdown");
1136 dolog("Exit status: %d\n", (s4) status);
1144 * These are local overrides for various environment variables in Emacs.
1145 * Please do not remove this and leave it at the end of the file, where
1146 * Emacs will automagically detect them.
1147 * ---------------------------------------------------------------------
1150 * indent-tabs-mode: t