1 /* main.c - contains main() and variables for the global options
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 Institut f. Computersprachen, TU Wien
5 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, M. Probst,
6 S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich,
9 This file is part of CACAO.
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2, or (at
14 your option) any later version.
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 Contact: cacao@complang.tuwien.ac.at
28 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: main.c 862 2004-01-06 23:42:01Z stefan $
56 #include "threads/thread.h"
57 #include "toolbox/loging.h"
58 #include "toolbox/memory.h"
59 #include "parseRTstats.h"
60 #include "typeinfo.h" /* XXX remove debug */
61 #include "nat/java_lang_Throwable.h"
64 /* command line option */
67 bool compileall = false;
68 bool runverbose = false; /* trace all method invocation */
69 bool collectverbose = false;
71 bool loadverbose = false;
72 bool linkverbose = false;
73 bool initverbose = false;
75 bool opt_rt = false; /* true if RTA parse should be used RT-CO */
76 bool opt_xta = false; /* true if XTA parse should be used XTA-CO */
77 bool opt_vta = false; /* true if VTA parse should be used VTA-CO */
79 bool showmethods = false;
80 bool showconstantpool = false;
83 bool compileverbose = false; /* trace compiler actions */
84 bool showstack = false;
85 bool showdisassemble = false; /* generate disassembler listing */
86 bool showddatasegment = false; /* generate data segment listing */
87 bool showintermediate = false; /* generate intermediate code listing */
89 bool useinlining = false; /* use method inlining */
90 bool inlinevirtuals = false; /* inline unique virtual methods */
91 bool inlineexceptions = false; /* inline methods, that contain excptions */
92 bool inlineparamopt = false; /* optimize parameter passing to inlined methods */
93 bool inlineoutsiders = false; /* inline methods, that are not member of the invoker's class */
95 bool checkbounds = true; /* check array bounds */
96 bool checknull = true; /* check null pointers */
97 bool opt_noieee = false; /* don't implement ieee compliant floats */
98 bool checksync = true; /* do synchronization */
99 bool opt_loops = false; /* optimize array accesses in loops */
101 bool makeinitializations = true;
103 bool getloadingtime = false; /* to measure the runtime */
106 bool getcompilingtime = false; /* compute compile time */
107 s8 compilingtime = 0; /* accumulated compile time */
109 int has_ext_instr_set = 0; /* has instruction set extensions */
111 bool statistics = false;
113 bool opt_verify = true; /* true if classfiles should be verified */
116 static classinfo *topclass;
119 void **stackbottom = 0;
123 /* internal function: get_opt *************************************************
125 decodes the next command line option
127 ******************************************************************************/
133 #define OPT_CLASSPATH 2
137 #define OPT_VERBOSE1 6
138 #define OPT_VERBOSE 7
139 #define OPT_VERBOSEGC 8
140 #define OPT_VERBOSECALL 9
141 #define OPT_NOIEEE 10
142 #define OPT_SOFTNULL 11
148 #define OPT_METHOD 17
149 #define OPT_SIGNATURE 18
153 #define OPT_INLINING 25
157 #define OPT_VERBOSETC 29
158 #define OPT_NOVERIFY 30
161 struct {char *name; bool arg; int value;} opts[] = {
162 {"classpath", true, OPT_CLASSPATH},
164 {"ms", true, OPT_MS},
165 {"mx", true, OPT_MX},
166 {"noasyncgc", false, OPT_IGNORE},
167 {"noverify", false, OPT_NOVERIFY},
168 {"oss", true, OPT_IGNORE},
169 {"ss", true, OPT_IGNORE},
170 {"v", false, OPT_VERBOSE1},
171 {"verbose", false, OPT_VERBOSE},
172 {"verbosegc", false, OPT_VERBOSEGC},
173 {"verbosecall", false, OPT_VERBOSECALL},
174 #ifdef TYPECHECK_VERBOSE
175 {"verbosetc", false, OPT_VERBOSETC},
177 #if defined(__ALPHA__)
178 {"noieee", false, OPT_NOIEEE},
180 {"softnull", false, OPT_SOFTNULL},
181 {"time", false, OPT_TIME},
182 {"stat", false, OPT_STAT},
183 {"log", true, OPT_LOG},
184 {"c", true, OPT_CHECK},
185 {"l", false, OPT_LOAD},
186 {"m", true, OPT_METHOD},
187 {"sig", true, OPT_SIGNATURE},
188 {"s", true, OPT_SHOW},
189 {"all", false, OPT_ALL},
190 {"oloop", false, OPT_OLOOP},
191 {"i", true, OPT_INLINING},
192 {"rt", false, OPT_RT},
193 {"xta", false, OPT_XTA},
194 {"vta", false, OPT_VTA},
198 static int opt_ind = 1;
199 static char *opt_arg;
202 static int get_opt(int argc, char **argv)
207 if (opt_ind >= argc) return OPT_DONE;
210 if (a[0] != '-') return OPT_DONE;
212 for (i = 0; opts[i].name; i++) {
214 if (strcmp(a + 1, opts[i].name) == 0) { /* boolean option found */
216 return opts[i].value;
220 if (strcmp(a + 1, opts[i].name) == 0) { /* parameter option found */
222 if (opt_ind < argc) {
223 opt_arg = argv[opt_ind];
225 return opts[i].value;
230 size_t l = strlen(opts[i].name);
231 if (strlen(a + 1) > l) {
232 if (memcmp(a + 1, opts[i].name, l) == 0) {
235 return opts[i].value;
248 /******************** interne Function: print_usage ************************
250 Prints the correct usage syntax to stdout.
252 ***************************************************************************/
254 static void print_usage()
256 printf("USAGE: cacao [options] classname [program arguments]\n");
257 printf("Options:\n");
258 printf(" -classpath path ...... specify a path to look for classes\n");
259 printf(" -Dpropertyname=value . add an entry to the property list\n");
260 printf(" -mx maxmem[k|m] ...... specify the size for the heap\n");
261 printf(" -ms initmem[k|m] ..... specify the initial size for the heap\n");
262 printf(" -v ................... write state-information\n");
263 printf(" -verbose ............. write more information\n");
264 printf(" -verbosegc ........... write message for each GC\n");
265 printf(" -verbosecall ......... write message for each call\n");
266 #ifdef TYPECHECK_VERBOSE
267 printf(" -verbosetc ........... write debug messages while typechecking\n");
269 #if defined(__ALPHA__)
270 printf(" -noieee .............. don't use ieee compliant arithmetic\n");
272 printf(" -noverify ............ don't verify classfiles\n");
273 printf(" -softnull ............ use software nullpointer check\n");
274 printf(" -time ................ measure the runtime\n");
275 printf(" -stat ................ detailed compiler statistics\n");
276 printf(" -log logfile ......... specify a name for the logfile\n");
277 printf(" -c(heck)b(ounds) ..... don't check array bounds\n");
278 printf(" s(ync) ....... don't check for synchronization\n");
279 printf(" -oloop ............... optimize array accesses in loops\n");
280 printf(" -l ................... don't start the class after loading\n");
281 printf(" -all ................. compile all methods, no execution\n");
282 printf(" -m ................... compile only a specific method\n");
283 printf(" -sig ................. specify signature for a specific method\n");
284 printf(" -s(how)a(ssembler) ... show disassembled listing\n");
285 printf(" c(onstants) ... show the constant pool\n");
286 printf(" d(atasegment).. show data segment listing\n");
287 printf(" i(ntermediate). show intermediate representation\n");
288 printf(" m(ethods)...... show class fields and methods\n");
289 printf(" u(tf) ......... show the utf - hash\n");
290 printf(" -i n ............. activate inlining\n");
291 printf(" v ............. inline virtual methods\n");
292 printf(" e ............. inline methods with exceptions\n");
293 printf(" p ............. optimize argument renaming\n");
294 printf(" o ............. inline methods of foreign classes\n");
295 printf(" -rt .................. use rapid type analysis\n");
296 printf(" -xta ................. use x type analysis\n");
297 printf(" -vta ................. use variable type analysis\n");
302 /***************************** Function: print_times *********************
304 Prints a summary of CPU time usage.
306 **************************************************************************/
308 static void print_times()
310 s8 totaltime = getcputime();
311 s8 runtime = totaltime - loadingtime - compilingtime;
312 char logtext[MAXLOGTEXT];
314 #if defined(__I386__)
315 sprintf(logtext, "Time for loading classes: %lld secs, %lld millis",
317 sprintf(logtext, "Time for loading classes: %ld secs, %ld millis",
319 loadingtime / 1000000, (loadingtime % 1000000) / 1000);
322 #if defined(__I386__)
323 sprintf(logtext, "Time for compiling code: %lld secs, %lld millis",
325 sprintf(logtext, "Time for compiling code: %ld secs, %ld millis",
327 compilingtime / 1000000, (compilingtime % 1000000) / 1000);
330 #if defined(__I386__)
331 sprintf(logtext, "Time for running program: %lld secs, %lld millis",
333 sprintf(logtext, "Time for running program: %ld secs, %ld millis",
335 runtime / 1000000, (runtime % 1000000) / 1000);
338 #if defined(__I386__)
339 sprintf(logtext, "Total time: %lld secs, %lld millis",
341 sprintf(logtext, "Total time: %ld secs, %ld millis",
343 totaltime / 1000000, (totaltime % 1000000) / 1000);
352 /***************************** Function: print_stats *********************
354 outputs detailed compiler statistics
356 **************************************************************************/
358 static void print_stats()
360 char logtext[MAXLOGTEXT];
362 sprintf(logtext, "Number of JitCompiler Calls: %d", count_jit_calls);
364 sprintf(logtext, "Number of compiled Methods: %d", count_methods);
366 sprintf(logtext, "Number of max basic blocks per method: %d", count_max_basic_blocks);
368 sprintf(logtext, "Number of compiled basic blocks: %d", count_basic_blocks);
370 sprintf(logtext, "Number of max JavaVM-Instructions per method: %d", count_max_javainstr);
372 sprintf(logtext, "Number of compiled JavaVM-Instructions: %d", count_javainstr);
374 sprintf(logtext, "Size of compiled JavaVM-Instructions: %d(%d)", count_javacodesize,
375 count_javacodesize - count_methods * 18);
377 sprintf(logtext, "Size of compiled Exception Tables: %d", count_javaexcsize);
379 sprintf(logtext, "Value of extended instruction set var: %d", has_ext_instr_set);
381 sprintf(logtext, "Number of Machine-Instructions: %d", count_code_len >> 2);
383 sprintf(logtext, "Number of Spills: %d", count_spills);
385 sprintf(logtext, "Number of Activ Pseudocommands: %5d", count_pcmd_activ);
387 sprintf(logtext, "Number of Drop Pseudocommands: %5d", count_pcmd_drop);
389 sprintf(logtext, "Number of Const Pseudocommands: %5d (zero:%5d)", count_pcmd_load, count_pcmd_zero);
391 sprintf(logtext, "Number of ConstAlu Pseudocommands: %5d (cmp: %5d, store:%5d)", count_pcmd_const_alu, count_pcmd_const_bra, count_pcmd_const_store);
393 sprintf(logtext, "Number of Move Pseudocommands: %5d", count_pcmd_move);
395 sprintf(logtext, "Number of Load Pseudocommands: %5d", count_load_instruction);
397 sprintf(logtext, "Number of Store Pseudocommands: %5d (combined: %5d)", count_pcmd_store, count_pcmd_store - count_pcmd_store_comb);
399 sprintf(logtext, "Number of OP Pseudocommands: %5d", count_pcmd_op);
401 sprintf(logtext, "Number of DUP Pseudocommands: %5d", count_dup_instruction);
403 sprintf(logtext, "Number of Mem Pseudocommands: %5d", count_pcmd_mem);
405 sprintf(logtext, "Number of Method Pseudocommands: %5d", count_pcmd_met);
407 sprintf(logtext, "Number of Branch Pseudocommands: %5d (rets:%5d, Xrets: %5d)",
408 count_pcmd_bra, count_pcmd_return, count_pcmd_returnx);
410 sprintf(logtext, "Number of Table Pseudocommands: %5d", count_pcmd_table);
412 sprintf(logtext, "Number of Useful Pseudocommands: %5d", count_pcmd_table +
413 count_pcmd_bra + count_pcmd_load + count_pcmd_mem + count_pcmd_op);
415 sprintf(logtext, "Number of Null Pointer Checks: %5d", count_check_null);
417 sprintf(logtext, "Number of Array Bound Checks: %5d", count_check_bound);
419 sprintf(logtext, "Number of Try-Blocks: %d", count_tryblocks);
421 sprintf(logtext, "Maximal count of stack elements: %d", count_max_new_stack);
423 sprintf(logtext, "Upper bound of max stack elements: %d", count_upper_bound_new_stack);
425 sprintf(logtext, "Distribution of stack sizes at block boundary");
427 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 >=10");
429 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_block_stack[0],
430 count_block_stack[1], count_block_stack[2], count_block_stack[3], count_block_stack[4],
431 count_block_stack[5], count_block_stack[6], count_block_stack[7], count_block_stack[8],
432 count_block_stack[9], count_block_stack[10]);
434 sprintf(logtext, "Distribution of store stack depth");
436 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 >=10");
438 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_depth[0],
439 count_store_depth[1], count_store_depth[2], count_store_depth[3], count_store_depth[4],
440 count_store_depth[5], count_store_depth[6], count_store_depth[7], count_store_depth[8],
441 count_store_depth[9], count_store_depth[10]);
443 sprintf(logtext, "Distribution of store creator chains first part");
445 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 ");
447 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_length[0],
448 count_store_length[1], count_store_length[2], count_store_length[3], count_store_length[4],
449 count_store_length[5], count_store_length[6], count_store_length[7], count_store_length[8],
450 count_store_length[9]);
452 sprintf(logtext, "Distribution of store creator chains second part");
454 sprintf(logtext, " 10 11 12 13 14 15 16 17 18 19 >=20");
456 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_length[10],
457 count_store_length[11], count_store_length[12], count_store_length[13], count_store_length[14],
458 count_store_length[15], count_store_length[16], count_store_length[17], count_store_length[18],
459 count_store_length[19], count_store_length[20]);
461 sprintf(logtext, "Distribution of analysis iterations");
463 sprintf(logtext, " 1 2 3 4 >=5");
465 sprintf(logtext, "%5d%5d%5d%5d%5d", count_analyse_iterations[0], count_analyse_iterations[1],
466 count_analyse_iterations[2], count_analyse_iterations[3], count_analyse_iterations[4]);
468 sprintf(logtext, "Distribution of basic blocks per method");
470 sprintf(logtext, " <= 5 <=10 <=15 <=20 <=30 <=40 <=50 <=75 >75");
472 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_method_bb_distribution[0],
473 count_method_bb_distribution[1], count_method_bb_distribution[2], count_method_bb_distribution[3],
474 count_method_bb_distribution[4], count_method_bb_distribution[5], count_method_bb_distribution[6],
475 count_method_bb_distribution[7], count_method_bb_distribution[8]);
477 sprintf(logtext, "Distribution of basic block sizes");
480 " 0 1 2 3 4 5 6 7 8 9 <13 <15 <17 <19 <21 <26 <31 >30");
482 sprintf(logtext, "%3d%5d%5d%5d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d",
483 count_block_size_distribution[0], count_block_size_distribution[1], count_block_size_distribution[2],
484 count_block_size_distribution[3], count_block_size_distribution[4], count_block_size_distribution[5],
485 count_block_size_distribution[6], count_block_size_distribution[7], count_block_size_distribution[8],
486 count_block_size_distribution[9], count_block_size_distribution[10], count_block_size_distribution[11],
487 count_block_size_distribution[12], count_block_size_distribution[13], count_block_size_distribution[14],
488 count_block_size_distribution[15], count_block_size_distribution[16], count_block_size_distribution[17]);
490 sprintf(logtext, "Size of Code Area (Kb): %10.3f", (float) count_code_len / 1024);
492 sprintf(logtext, "Size of data Area (Kb): %10.3f", (float) count_data_len / 1024);
494 sprintf(logtext, "Size of Class Infos (Kb):%10.3f", (float) (count_class_infos) / 1024);
496 sprintf(logtext, "Size of Const Pool (Kb): %10.3f", (float) (count_const_pool_len + count_utf_len) / 1024);
498 sprintf(logtext, "Size of Vftbl (Kb): %10.3f", (float) count_vftbl_len / 1024);
500 sprintf(logtext, "Size of comp stub (Kb): %10.3f", (float) count_cstub_len / 1024);
502 sprintf(logtext, "Size of native stub (Kb):%10.3f", (float) count_nstub_len / 1024);
504 sprintf(logtext, "Size of Utf (Kb): %10.3f", (float) count_utf_len / 1024);
506 sprintf(logtext, "Size of VMCode (Kb): %10.3f(%d)", (float) count_vmcode_len / 1024,
507 count_vmcode_len - 18 * count_all_methods);
509 sprintf(logtext, "Size of ExTable (Kb): %10.3f", (float) count_extable_len / 1024);
511 sprintf(logtext, "Number of class loads: %d", count_class_loads);
513 sprintf(logtext, "Number of class inits: %d", count_class_inits);
515 sprintf(logtext, "Number of loaded Methods: %d\n\n", count_all_methods);
518 sprintf(logtext, "Calls of utf_new: %22d", count_utf_new);
520 sprintf(logtext, "Calls of utf_new (element found): %6d\n\n", count_utf_new_found);
525 /********** Function: class_compile_methods (debugging only) ********/
527 void class_compile_methods()
533 c = list_first(&linkedclasses);
535 for (i = 0; i < c -> methodscount; i++) {
536 m = &(c->methods[i]);
538 (void) jit_compile(m);
541 c = list_next(&linkedclasses, c);
547 * void exit_handler(void)
548 * -----------------------
549 * The exit_handler function is called upon program termination to shutdown
550 * the various subsystems and release the resources allocated to the VM.
552 void exit_handler(void)
554 /********************* Print debug tables ************************/
556 if (showmethods) class_showmethods(topclass);
557 if (showconstantpool) class_showconstantpool(topclass);
558 if (showutf) utf_show();
561 clear_thread_flags(); /* restores standard file descriptor
565 /************************ Free all resources *******************/
567 heap_close(); /* must be called before compiler_close and
568 loader_close because finalization occurs
572 tables_close(literalstring_free);
574 if (verbose || getcompilingtime || statistics) {
575 log_text("CACAO terminated");
578 if (getcompilingtime)
585 /************************** Function: main *******************************
589 **************************************************************************/
591 int main(int argc, char **argv)
597 /********** interne (nur fuer main relevante Optionen) **************/
599 char logfilename[200] = "";
600 u4 heapsize = 64000000;
601 u4 heapstartsize = 200000;
602 char classpath[500] = ".";
604 char *specificmethodname = NULL;
605 char *specificsignature = NULL;
608 stackbottom = &dummy;
611 if (0 != atexit(exit_handler))
612 panic("unable to register exit_handler");
614 /************ Collect info from the environment ************************/
616 cp = getenv("CLASSPATH");
618 strcpy(classpath, cp);
621 /***************** Interpret the command line *****************/
626 while ((i = get_opt(argc, argv)) != OPT_DONE) {
628 case OPT_IGNORE: break;
631 strcpy(classpath + strlen(classpath), ":");
632 strcpy(classpath + strlen(classpath), opt_arg);
638 int l = strlen(opt_arg);
639 for (n = 0; n < l; n++) {
640 if (opt_arg[n] == '=') {
642 attach_property(opt_arg, opt_arg + n + 1);
655 if (opt_arg[strlen(opt_arg) - 1] == 'k') {
656 j = 1024 * atoi(opt_arg);
658 else if (opt_arg[strlen(opt_arg) - 1] == 'm') {
659 j = 1024 * 1024 * atoi(opt_arg);
661 else j = atoi(opt_arg);
663 if (i == OPT_MX) heapsize = j;
664 else heapstartsize = j;
675 compileverbose = true;
679 collectverbose = true;
682 #ifdef TYPECHECK_VERBOSE
684 typecheckverbose = true;
688 case OPT_VERBOSECALL:
705 getcompilingtime = true;
706 getloadingtime = true;
714 strcpy(logfilename, opt_arg);
718 for (j = 0; j < strlen(opt_arg); j++) {
719 switch (opt_arg[j]) {
735 makeinitializations = false;
740 specificmethodname = opt_arg;
741 makeinitializations = false;
745 specificsignature = opt_arg;
751 makeinitializations = false;
754 case OPT_SHOW: /* Display options */
755 for (j = 0; j < strlen(opt_arg); j++) {
756 switch (opt_arg[j]) {
758 showdisassemble = true;
762 showconstantpool = true;
765 showddatasegment = true;
768 showintermediate = true;
769 compileverbose = true;
789 for (j = 0; j < strlen(opt_arg); j++) {
790 switch (opt_arg[j]) {
795 inlinevirtuals = true;
798 inlineexceptions = true;
801 inlineparamopt = true;
804 inlineoutsiders = true;
818 opt_xta = false; /**not yet **/
822 /***opt_vta = true; not yet **/
832 if (opt_ind >= argc) {
838 /**************************** Program start *****************************/
840 log_init(logfilename);
842 log_text("CACAO started -------------------------------------------------------");
845 native_setclasspath(classpath);
848 suck_init(classpath);
850 heap_init(heapsize, heapstartsize, &dummy);
854 loader_init((u1 *) &dummy);
856 native_loadclasses();
859 /*********************** Load JAVA classes ***************************/
861 cp = argv[opt_ind++];
862 for (i = strlen(cp) - 1; i >= 0; i--) { /* Transform dots into slashes */
863 if (cp[i] == '.') cp[i] = '/'; /* in the class name */
866 /*printf("-------------------->%s\n",cp);*/
867 topclass = loader_load(utf_new_char(cp));
868 /*class_showmethods(topclass); */
870 if (*exceptionptr != 0) {
871 printf("Exception in thread \"main\" ");
872 utf_display((*exceptionptr)->vftbl->class->name);
874 utf_display(javastring_toutf(((java_lang_Throwable *) *exceptionptr)->detailMessage, false));
881 /* should we print out something? we already have the exception */
885 /* initialize the garbage collector */
889 initThreads((u1*) &dummy);
893 /************************* Start worker routines ********************/
896 methodinfo *mainmethod;
899 /* heap_addreference((void**) &a); */
901 mainmethod = class_findmethod(topclass,
902 utf_new_char("main"),
903 utf_new_char("([Ljava/lang/String;)V")
906 /* there is no main method or it isn't static */
907 if (!mainmethod || !(mainmethod->flags & ACC_STATIC)) {
908 printf("Exception in thread \"main\" java.lang.NoSuchMethodError: main\n");
912 a = builtin_anewarray(argc - opt_ind, class_java_lang_String);
913 for (i = opt_ind; i < argc; i++) {
914 a->data[i - opt_ind] =
915 (java_objectheader *) javastring_new(utf_new_char(argv[i]));
918 #ifdef TYPEINFO_DEBUG_TEST
919 /* test the typeinfo system */
922 /*class_showmethods(currentThread->group->header.vftbl->class); */
925 asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
928 printf("Exception in thread \"main\" ");
929 utf_display((*exceptionptr)->vftbl->class->name);
931 /* do we have a detail message? */
932 if (((java_lang_Throwable *) *exceptionptr)->detailMessage) {
934 utf_display(javastring_toutf(((java_lang_Throwable *) *exceptionptr)->detailMessage, false));
940 killThread(currentThread);
942 fprintf(stderr, "still here\n");
945 /************* If requested, compile all methods ********************/
948 class_compile_methods();
952 /******** If requested, compile a specific method ***************/
954 if (specificmethodname) {
956 if (specificsignature) {
957 m = class_findmethod(topclass,
958 utf_new_char(specificmethodname),
959 utf_new_char(specificsignature));
961 m = class_findmethod(topclass,
962 utf_new_char(specificmethodname),
967 panic("Specific method not found");
977 /************************************ Shutdown function *********************************
979 Terminates the system immediately without freeing memory explicitly (to be
980 used only for abnormal termination)
982 *****************************************************************************************/
984 void cacao_shutdown(s4 status)
988 if (verbose || getcompilingtime || statistics) {
989 log_text ("CACAO terminated by shutdown");
992 if (getcompilingtime)
995 dolog("Exit status: %d\n", (int) status);
1003 * These are local overrides for various environment variables in Emacs.
1004 * Please do not remove this and leave it at the end of the file, where
1005 * Emacs will automagically detect them.
1006 * ---------------------------------------------------------------------
1009 * indent-tabs-mode: t