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 889 2004-01-19 12:18:14Z edwin $
56 #include "threads/thread.h"
57 #include "toolbox/loging.h"
58 #include "toolbox/memory.h"
59 #include "parseRTstats.h"
60 #include "nat/java_lang_Throwable.h"
62 #ifdef TYPEINFO_DEBUG_TEST
66 /* command line option */
69 bool compileall = false;
70 bool runverbose = false; /* trace all method invocation */
71 bool collectverbose = false;
73 bool loadverbose = false;
74 bool linkverbose = false;
75 bool initverbose = false;
77 bool opt_rt = false; /* true if RTA parse should be used RT-CO */
78 bool opt_xta = false; /* true if XTA parse should be used XTA-CO */
79 bool opt_vta = false; /* true if VTA parse should be used VTA-CO */
81 bool showmethods = false;
82 bool showconstantpool = false;
85 bool compileverbose = false; /* trace compiler actions */
86 bool showstack = false;
87 bool showdisassemble = false; /* generate disassembler listing */
88 bool showddatasegment = false; /* generate data segment listing */
89 bool showintermediate = false; /* generate intermediate code listing */
91 bool useinlining = false; /* use method inlining */
92 bool inlinevirtuals = false; /* inline unique virtual methods */
93 bool inlineexceptions = false; /* inline methods, that contain excptions */
94 bool inlineparamopt = false; /* optimize parameter passing to inlined methods */
95 bool inlineoutsiders = false; /* inline methods, that are not member of the invoker's class */
97 bool checkbounds = true; /* check array bounds */
98 bool checknull = true; /* check null pointers */
99 bool opt_noieee = false; /* don't implement ieee compliant floats */
100 bool checksync = true; /* do synchronization */
101 bool opt_loops = false; /* optimize array accesses in loops */
103 bool makeinitializations = true;
105 bool getloadingtime = false; /* to measure the runtime */
108 bool getcompilingtime = false; /* compute compile time */
109 s8 compilingtime = 0; /* accumulated compile time */
111 int has_ext_instr_set = 0; /* has instruction set extensions */
113 bool statistics = false;
115 bool opt_verify = true; /* true if classfiles should be verified */
118 static classinfo *topclass;
121 void **stackbottom = 0;
125 /* internal function: get_opt *************************************************
127 decodes the next command line option
129 ******************************************************************************/
135 #define OPT_CLASSPATH 2
139 #define OPT_VERBOSE1 6
140 #define OPT_VERBOSE 7
141 #define OPT_VERBOSEGC 8
142 #define OPT_VERBOSECALL 9
143 #define OPT_NOIEEE 10
144 #define OPT_SOFTNULL 11
150 #define OPT_METHOD 17
151 #define OPT_SIGNATURE 18
155 #define OPT_INLINING 25
159 #define OPT_VERBOSETC 29
160 #define OPT_NOVERIFY 30
163 struct {char *name; bool arg; int value;} opts[] = {
164 {"classpath", true, OPT_CLASSPATH},
166 {"ms", true, OPT_MS},
167 {"mx", true, OPT_MX},
168 {"noasyncgc", false, OPT_IGNORE},
169 {"noverify", false, OPT_NOVERIFY},
170 {"oss", true, OPT_IGNORE},
171 {"ss", true, OPT_IGNORE},
172 {"v", false, OPT_VERBOSE1},
173 {"verbose", false, OPT_VERBOSE},
174 {"verbosegc", false, OPT_VERBOSEGC},
175 {"verbosecall", false, OPT_VERBOSECALL},
176 #ifdef TYPECHECK_VERBOSE
177 {"verbosetc", false, OPT_VERBOSETC},
179 #if defined(__ALPHA__)
180 {"noieee", false, OPT_NOIEEE},
182 {"softnull", false, OPT_SOFTNULL},
183 {"time", false, OPT_TIME},
184 {"stat", false, OPT_STAT},
185 {"log", true, OPT_LOG},
186 {"c", true, OPT_CHECK},
187 {"l", false, OPT_LOAD},
188 {"m", true, OPT_METHOD},
189 {"sig", true, OPT_SIGNATURE},
190 {"s", true, OPT_SHOW},
191 {"all", false, OPT_ALL},
192 {"oloop", false, OPT_OLOOP},
193 {"i", true, OPT_INLINING},
194 {"rt", false, OPT_RT},
195 {"xta", false, OPT_XTA},
196 {"vta", false, OPT_VTA},
200 static int opt_ind = 1;
201 static char *opt_arg;
204 static int get_opt(int argc, char **argv)
209 if (opt_ind >= argc) return OPT_DONE;
212 if (a[0] != '-') return OPT_DONE;
214 for (i = 0; opts[i].name; i++) {
216 if (strcmp(a + 1, opts[i].name) == 0) { /* boolean option found */
218 return opts[i].value;
222 if (strcmp(a + 1, opts[i].name) == 0) { /* parameter option found */
224 if (opt_ind < argc) {
225 opt_arg = argv[opt_ind];
227 return opts[i].value;
232 size_t l = strlen(opts[i].name);
233 if (strlen(a + 1) > l) {
234 if (memcmp(a + 1, opts[i].name, l) == 0) {
237 return opts[i].value;
250 /******************** interne Function: print_usage ************************
252 Prints the correct usage syntax to stdout.
254 ***************************************************************************/
256 static void print_usage()
258 printf("USAGE: cacao [options] classname [program arguments]\n");
259 printf("Options:\n");
260 printf(" -classpath path ...... specify a path to look for classes\n");
261 printf(" -Dpropertyname=value . add an entry to the property list\n");
262 printf(" -mx maxmem[k|m] ...... specify the size for the heap\n");
263 printf(" -ms initmem[k|m] ..... specify the initial size for the heap\n");
264 printf(" -v ................... write state-information\n");
265 printf(" -verbose ............. write more information\n");
266 printf(" -verbosegc ........... write message for each GC\n");
267 printf(" -verbosecall ......... write message for each call\n");
268 #ifdef TYPECHECK_VERBOSE
269 printf(" -verbosetc ........... write debug messages while typechecking\n");
271 #if defined(__ALPHA__)
272 printf(" -noieee .............. don't use ieee compliant arithmetic\n");
274 printf(" -noverify ............ don't verify classfiles\n");
275 printf(" -softnull ............ use software nullpointer check\n");
276 printf(" -time ................ measure the runtime\n");
277 printf(" -stat ................ detailed compiler statistics\n");
278 printf(" -log logfile ......... specify a name for the logfile\n");
279 printf(" -c(heck)b(ounds) ..... don't check array bounds\n");
280 printf(" s(ync) ....... don't check for synchronization\n");
281 printf(" -oloop ............... optimize array accesses in loops\n");
282 printf(" -l ................... don't start the class after loading\n");
283 printf(" -all ................. compile all methods, no execution\n");
284 printf(" -m ................... compile only a specific method\n");
285 printf(" -sig ................. specify signature for a specific method\n");
286 printf(" -s(how)a(ssembler) ... show disassembled listing\n");
287 printf(" c(onstants) ... show the constant pool\n");
288 printf(" d(atasegment).. show data segment listing\n");
289 printf(" i(ntermediate). show intermediate representation\n");
290 printf(" m(ethods)...... show class fields and methods\n");
291 printf(" u(tf) ......... show the utf - hash\n");
292 printf(" -i n ............. activate inlining\n");
293 printf(" v ............. inline virtual methods\n");
294 printf(" e ............. inline methods with exceptions\n");
295 printf(" p ............. optimize argument renaming\n");
296 printf(" o ............. inline methods of foreign classes\n");
297 printf(" -rt .................. use rapid type analysis\n");
298 printf(" -xta ................. use x type analysis\n");
299 printf(" -vta ................. use variable type analysis\n");
304 /***************************** Function: print_times *********************
306 Prints a summary of CPU time usage.
308 **************************************************************************/
310 static void print_times()
312 s8 totaltime = getcputime();
313 s8 runtime = totaltime - loadingtime - compilingtime;
314 char logtext[MAXLOGTEXT];
316 #if defined(__I386__)
317 sprintf(logtext, "Time for loading classes: %lld secs, %lld millis",
319 sprintf(logtext, "Time for loading classes: %ld secs, %ld millis",
321 loadingtime / 1000000, (loadingtime % 1000000) / 1000);
324 #if defined(__I386__)
325 sprintf(logtext, "Time for compiling code: %lld secs, %lld millis",
327 sprintf(logtext, "Time for compiling code: %ld secs, %ld millis",
329 compilingtime / 1000000, (compilingtime % 1000000) / 1000);
332 #if defined(__I386__)
333 sprintf(logtext, "Time for running program: %lld secs, %lld millis",
335 sprintf(logtext, "Time for running program: %ld secs, %ld millis",
337 runtime / 1000000, (runtime % 1000000) / 1000);
340 #if defined(__I386__)
341 sprintf(logtext, "Total time: %lld secs, %lld millis",
343 sprintf(logtext, "Total time: %ld secs, %ld millis",
345 totaltime / 1000000, (totaltime % 1000000) / 1000);
354 /***************************** Function: print_stats *********************
356 outputs detailed compiler statistics
358 **************************************************************************/
360 static void print_stats()
362 char logtext[MAXLOGTEXT];
364 sprintf(logtext, "Number of JitCompiler Calls: %d", count_jit_calls);
366 sprintf(logtext, "Number of compiled Methods: %d", count_methods);
368 sprintf(logtext, "Number of max basic blocks per method: %d", count_max_basic_blocks);
370 sprintf(logtext, "Number of compiled basic blocks: %d", count_basic_blocks);
372 sprintf(logtext, "Number of max JavaVM-Instructions per method: %d", count_max_javainstr);
374 sprintf(logtext, "Number of compiled JavaVM-Instructions: %d", count_javainstr);
376 sprintf(logtext, "Size of compiled JavaVM-Instructions: %d(%d)", count_javacodesize,
377 count_javacodesize - count_methods * 18);
379 sprintf(logtext, "Size of compiled Exception Tables: %d", count_javaexcsize);
381 sprintf(logtext, "Value of extended instruction set var: %d", has_ext_instr_set);
383 sprintf(logtext, "Number of Machine-Instructions: %d", count_code_len >> 2);
385 sprintf(logtext, "Number of Spills: %d", count_spills);
387 sprintf(logtext, "Number of Activ Pseudocommands: %5d", count_pcmd_activ);
389 sprintf(logtext, "Number of Drop Pseudocommands: %5d", count_pcmd_drop);
391 sprintf(logtext, "Number of Const Pseudocommands: %5d (zero:%5d)", count_pcmd_load, count_pcmd_zero);
393 sprintf(logtext, "Number of ConstAlu Pseudocommands: %5d (cmp: %5d, store:%5d)", count_pcmd_const_alu, count_pcmd_const_bra, count_pcmd_const_store);
395 sprintf(logtext, "Number of Move Pseudocommands: %5d", count_pcmd_move);
397 sprintf(logtext, "Number of Load Pseudocommands: %5d", count_load_instruction);
399 sprintf(logtext, "Number of Store Pseudocommands: %5d (combined: %5d)", count_pcmd_store, count_pcmd_store - count_pcmd_store_comb);
401 sprintf(logtext, "Number of OP Pseudocommands: %5d", count_pcmd_op);
403 sprintf(logtext, "Number of DUP Pseudocommands: %5d", count_dup_instruction);
405 sprintf(logtext, "Number of Mem Pseudocommands: %5d", count_pcmd_mem);
407 sprintf(logtext, "Number of Method Pseudocommands: %5d", count_pcmd_met);
409 sprintf(logtext, "Number of Branch Pseudocommands: %5d (rets:%5d, Xrets: %5d)",
410 count_pcmd_bra, count_pcmd_return, count_pcmd_returnx);
412 sprintf(logtext, "Number of Table Pseudocommands: %5d", count_pcmd_table);
414 sprintf(logtext, "Number of Useful Pseudocommands: %5d", count_pcmd_table +
415 count_pcmd_bra + count_pcmd_load + count_pcmd_mem + count_pcmd_op);
417 sprintf(logtext, "Number of Null Pointer Checks: %5d", count_check_null);
419 sprintf(logtext, "Number of Array Bound Checks: %5d", count_check_bound);
421 sprintf(logtext, "Number of Try-Blocks: %d", count_tryblocks);
423 sprintf(logtext, "Maximal count of stack elements: %d", count_max_new_stack);
425 sprintf(logtext, "Upper bound of max stack elements: %d", count_upper_bound_new_stack);
427 sprintf(logtext, "Distribution of stack sizes at block boundary");
429 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 >=10");
431 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_block_stack[0],
432 count_block_stack[1], count_block_stack[2], count_block_stack[3], count_block_stack[4],
433 count_block_stack[5], count_block_stack[6], count_block_stack[7], count_block_stack[8],
434 count_block_stack[9], count_block_stack[10]);
436 sprintf(logtext, "Distribution of store stack depth");
438 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 >=10");
440 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_depth[0],
441 count_store_depth[1], count_store_depth[2], count_store_depth[3], count_store_depth[4],
442 count_store_depth[5], count_store_depth[6], count_store_depth[7], count_store_depth[8],
443 count_store_depth[9], count_store_depth[10]);
445 sprintf(logtext, "Distribution of store creator chains first part");
447 sprintf(logtext, " 0 1 2 3 4 5 6 7 8 9 ");
449 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_length[0],
450 count_store_length[1], count_store_length[2], count_store_length[3], count_store_length[4],
451 count_store_length[5], count_store_length[6], count_store_length[7], count_store_length[8],
452 count_store_length[9]);
454 sprintf(logtext, "Distribution of store creator chains second part");
456 sprintf(logtext, " 10 11 12 13 14 15 16 17 18 19 >=20");
458 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_store_length[10],
459 count_store_length[11], count_store_length[12], count_store_length[13], count_store_length[14],
460 count_store_length[15], count_store_length[16], count_store_length[17], count_store_length[18],
461 count_store_length[19], count_store_length[20]);
463 sprintf(logtext, "Distribution of analysis iterations");
465 sprintf(logtext, " 1 2 3 4 >=5");
467 sprintf(logtext, "%5d%5d%5d%5d%5d", count_analyse_iterations[0], count_analyse_iterations[1],
468 count_analyse_iterations[2], count_analyse_iterations[3], count_analyse_iterations[4]);
470 sprintf(logtext, "Distribution of basic blocks per method");
472 sprintf(logtext, " <= 5 <=10 <=15 <=20 <=30 <=40 <=50 <=75 >75");
474 sprintf(logtext, "%5d%5d%5d%5d%5d%5d%5d%5d%5d", count_method_bb_distribution[0],
475 count_method_bb_distribution[1], count_method_bb_distribution[2], count_method_bb_distribution[3],
476 count_method_bb_distribution[4], count_method_bb_distribution[5], count_method_bb_distribution[6],
477 count_method_bb_distribution[7], count_method_bb_distribution[8]);
479 sprintf(logtext, "Distribution of basic block sizes");
482 " 0 1 2 3 4 5 6 7 8 9 <13 <15 <17 <19 <21 <26 <31 >30");
484 sprintf(logtext, "%3d%5d%5d%5d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d",
485 count_block_size_distribution[0], count_block_size_distribution[1], count_block_size_distribution[2],
486 count_block_size_distribution[3], count_block_size_distribution[4], count_block_size_distribution[5],
487 count_block_size_distribution[6], count_block_size_distribution[7], count_block_size_distribution[8],
488 count_block_size_distribution[9], count_block_size_distribution[10], count_block_size_distribution[11],
489 count_block_size_distribution[12], count_block_size_distribution[13], count_block_size_distribution[14],
490 count_block_size_distribution[15], count_block_size_distribution[16], count_block_size_distribution[17]);
492 sprintf(logtext, "Size of Code Area (Kb): %10.3f", (float) count_code_len / 1024);
494 sprintf(logtext, "Size of data Area (Kb): %10.3f", (float) count_data_len / 1024);
496 sprintf(logtext, "Size of Class Infos (Kb):%10.3f", (float) (count_class_infos) / 1024);
498 sprintf(logtext, "Size of Const Pool (Kb): %10.3f", (float) (count_const_pool_len + count_utf_len) / 1024);
500 sprintf(logtext, "Size of Vftbl (Kb): %10.3f", (float) count_vftbl_len / 1024);
502 sprintf(logtext, "Size of comp stub (Kb): %10.3f", (float) count_cstub_len / 1024);
504 sprintf(logtext, "Size of native stub (Kb):%10.3f", (float) count_nstub_len / 1024);
506 sprintf(logtext, "Size of Utf (Kb): %10.3f", (float) count_utf_len / 1024);
508 sprintf(logtext, "Size of VMCode (Kb): %10.3f(%d)", (float) count_vmcode_len / 1024,
509 count_vmcode_len - 18 * count_all_methods);
511 sprintf(logtext, "Size of ExTable (Kb): %10.3f", (float) count_extable_len / 1024);
513 sprintf(logtext, "Number of class loads: %d", count_class_loads);
515 sprintf(logtext, "Number of class inits: %d", count_class_inits);
517 sprintf(logtext, "Number of loaded Methods: %d\n\n", count_all_methods);
520 sprintf(logtext, "Calls of utf_new: %22d", count_utf_new);
522 sprintf(logtext, "Calls of utf_new (element found): %6d\n\n", count_utf_new_found);
527 /********** Function: class_compile_methods (debugging only) ********/
529 void class_compile_methods()
535 c = list_first(&linkedclasses);
537 for (i = 0; i < c -> methodscount; i++) {
538 m = &(c->methods[i]);
540 (void) jit_compile(m);
543 c = list_next(&linkedclasses, c);
547 #ifdef TYPECHECK_STATISTICS
548 void typecheck_print_statistics(FILE *file);
552 * void exit_handler(void)
553 * -----------------------
554 * The exit_handler function is called upon program termination to shutdown
555 * the various subsystems and release the resources allocated to the VM.
557 void exit_handler(void)
559 /********************* Print debug tables ************************/
561 if (showmethods) class_showmethods(topclass);
562 if (showconstantpool) class_showconstantpool(topclass);
563 if (showutf) utf_show();
566 clear_thread_flags(); /* restores standard file descriptor
570 /************************ Free all resources *******************/
572 heap_close(); /* must be called before compiler_close and
573 loader_close because finalization occurs
577 tables_close(literalstring_free);
579 if (verbose || getcompilingtime || statistics) {
580 log_text("CACAO terminated");
583 #ifdef TYPECHECK_STATISTICS
584 typecheck_print_statistics(get_logfile());
587 if (getcompilingtime)
594 /************************** Function: main *******************************
598 **************************************************************************/
600 int main(int argc, char **argv)
606 /********** interne (nur fuer main relevante Optionen) **************/
608 char logfilename[200] = "";
609 u4 heapsize = 64000000;
610 u4 heapstartsize = 200000;
611 char classpath[500] = ".";
613 char *specificmethodname = NULL;
614 char *specificsignature = NULL;
617 stackbottom = &dummy;
620 if (0 != atexit(exit_handler))
621 panic("unable to register exit_handler");
623 /************ Collect info from the environment ************************/
625 cp = getenv("CLASSPATH");
627 strcpy(classpath, cp);
630 /***************** Interpret the command line *****************/
635 while ((i = get_opt(argc, argv)) != OPT_DONE) {
637 case OPT_IGNORE: break;
640 strcpy(classpath + strlen(classpath), ":");
641 strcpy(classpath + strlen(classpath), opt_arg);
647 int l = strlen(opt_arg);
648 for (n = 0; n < l; n++) {
649 if (opt_arg[n] == '=') {
651 attach_property(opt_arg, opt_arg + n + 1);
664 if (opt_arg[strlen(opt_arg) - 1] == 'k') {
665 j = 1024 * atoi(opt_arg);
667 else if (opt_arg[strlen(opt_arg) - 1] == 'm') {
668 j = 1024 * 1024 * atoi(opt_arg);
670 else j = atoi(opt_arg);
672 if (i == OPT_MX) heapsize = j;
673 else heapstartsize = j;
684 compileverbose = true;
688 collectverbose = true;
691 #ifdef TYPECHECK_VERBOSE
693 typecheckverbose = true;
697 case OPT_VERBOSECALL:
714 getcompilingtime = true;
715 getloadingtime = true;
723 strcpy(logfilename, opt_arg);
727 for (j = 0; j < strlen(opt_arg); j++) {
728 switch (opt_arg[j]) {
744 makeinitializations = false;
749 specificmethodname = opt_arg;
750 makeinitializations = false;
754 specificsignature = opt_arg;
760 makeinitializations = false;
763 case OPT_SHOW: /* Display options */
764 for (j = 0; j < strlen(opt_arg); j++) {
765 switch (opt_arg[j]) {
767 showdisassemble = true;
771 showconstantpool = true;
774 showddatasegment = true;
777 showintermediate = true;
778 compileverbose = true;
798 for (j = 0; j < strlen(opt_arg); j++) {
799 switch (opt_arg[j]) {
804 inlinevirtuals = true;
807 inlineexceptions = true;
810 inlineparamopt = true;
813 inlineoutsiders = true;
827 opt_xta = false; /**not yet **/
831 /***opt_vta = true; not yet **/
841 if (opt_ind >= argc) {
847 /**************************** Program start *****************************/
849 log_init(logfilename);
851 log_text("CACAO started -------------------------------------------------------");
854 native_setclasspath(classpath);
857 suck_init(classpath);
859 heap_init(heapsize, heapstartsize, &dummy);
863 loader_init((u1 *) &dummy);
865 native_loadclasses();
868 /*********************** Load JAVA classes ***************************/
870 cp = argv[opt_ind++];
871 for (i = strlen(cp) - 1; i >= 0; i--) { /* Transform dots into slashes */
872 if (cp[i] == '.') cp[i] = '/'; /* in the class name */
875 /*printf("-------------------->%s\n",cp);*/
876 topclass = loader_load(utf_new_char(cp));
877 /*class_showmethods(topclass); */
879 if (*exceptionptr != 0) {
880 printf("Exception in thread \"main\" ");
881 utf_display((*exceptionptr)->vftbl->class->name);
883 utf_display(javastring_toutf(((java_lang_Throwable *) *exceptionptr)->detailMessage, false));
890 /* should we print out something? we already have the exception */
894 /* initialize the garbage collector */
898 initThreads((u1*) &dummy);
902 /************************* Start worker routines ********************/
905 methodinfo *mainmethod;
908 /* heap_addreference((void**) &a); */
910 mainmethod = class_findmethod(topclass,
911 utf_new_char("main"),
912 utf_new_char("([Ljava/lang/String;)V")
915 /* there is no main method or it isn't static */
916 if (!mainmethod || !(mainmethod->flags & ACC_STATIC)) {
917 printf("Exception in thread \"main\" java.lang.NoSuchMethodError: main\n");
921 a = builtin_anewarray(argc - opt_ind, class_java_lang_String);
922 for (i = opt_ind; i < argc; i++) {
923 a->data[i - opt_ind] =
924 (java_objectheader *) javastring_new(utf_new_char(argv[i]));
927 #ifdef TYPEINFO_DEBUG_TEST
928 /* test the typeinfo system */
931 /*class_showmethods(currentThread->group->header.vftbl->class); */
934 asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
937 printf("Exception in thread \"main\" ");
938 utf_display((*exceptionptr)->vftbl->class->name);
940 /* do we have a detail message? */
941 if (((java_lang_Throwable *) *exceptionptr)->detailMessage) {
943 utf_display(javastring_toutf(((java_lang_Throwable *) *exceptionptr)->detailMessage, false));
949 killThread(currentThread);
951 fprintf(stderr, "still here\n");
954 /************* If requested, compile all methods ********************/
957 class_compile_methods();
961 /******** If requested, compile a specific method ***************/
963 if (specificmethodname) {
965 if (specificsignature) {
966 m = class_findmethod(topclass,
967 utf_new_char(specificmethodname),
968 utf_new_char(specificsignature));
970 m = class_findmethod(topclass,
971 utf_new_char(specificmethodname),
976 panic("Specific method not found");
986 /************************************ Shutdown function *********************************
988 Terminates the system immediately without freeing memory explicitly (to be
989 used only for abnormal termination)
991 *****************************************************************************************/
993 void cacao_shutdown(s4 status)
997 if (verbose || getcompilingtime || statistics) {
998 log_text ("CACAO terminated by shutdown");
1001 if (getcompilingtime)
1004 dolog("Exit status: %d\n", (int) status);
1012 * These are local overrides for various environment variables in Emacs.
1013 * Please do not remove this and leave it at the end of the file, where
1014 * Emacs will automagically detect them.
1015 * ---------------------------------------------------------------------
1018 * indent-tabs-mode: t