- Calling the class loader
- Running the main method
- $Id: main.c 1473 2004-11-10 10:33:59Z carolyn $
+ $Id: main.c 1505 2004-11-14 14:15:58Z jowenn $
*/
for (j = 0; j < strlen(opt_arg); j++) {
switch (opt_arg[j]) {
case 'n':
+ /* define in options.h; Used in main.c, jit.c & inline.c */
+ #ifdef INAFTERMAIN
+ useinliningm = true;
+ useinlining = false;
+ #else
useinlining = true;
+ #endif
break;
case 'v':
inlinevirtuals = true;
jit_init();
/* initialize exceptions used in the system */
- init_system_exceptions();
+ if (!init_system_exceptions())
+ throw_main_exception_exit();
native_loadclasses();
if (startit) {
methodinfo *mainmethod;
- java_objectarray *a;
+ java_objectarray *a;
+ s4 result=0;
/* create, load and link the main class */
mainclass = class_new(utf_new_char(mainstring));
asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
/* exception occurred? */
- if (*exceptionptr)
+ if (*exceptionptr) {
+ result=1;
throw_main_exception();
+ }
#if defined(USE_THREADS)
#if defined(NATIVE_THREADS)
/* now exit the JavaVM */
- cacao_exit(0);
+ cacao_exit(result);
}
/************* If requested, compile all methods ********************/
if (!m)
throw_main_exception_exit();
- asm_calljavafunction(m, rt, (void *) 0, NULL, NULL);
+ asm_calljavafunction(m, rt, (void *) status, NULL, NULL);
/* this should never happen */