Changes: Joseph Wenninger
Christian Thalinger
- $Id: codegen.c 2458 2005-05-12 23:02:07Z twisti $
+ $Id: codegen.c 2496 2005-05-23 08:06:06Z twisti $
*/
} else {
faultaddr += (long) ((instr << 16) >> 16);
- fprintf(stderr, "faulting address: 0x%016lx\n", faultaddr);
- panic("Stack overflow");
+
+ throw_cacao_exception_exit(string_java_lang_InternalError,
+ "faulting address: 0x%016lx\n", faultaddr);
}
}
Changes:
- $Id: helper.c 2458 2005-05-12 23:02:07Z twisti $
+ $Id: helper.c 2496 2005-05-23 08:06:06Z twisti $
*/
+#include <assert.h>
+
#include "vm/class.h"
#include "vm/exceptions.h"
#include "vm/initialize.h"
#include "vm/references.h"
#include "vm/resolve.h"
#include "vm/stringlocal.h"
+#include "vm/jit/asmpart.h"
/* XXX class_resolveclassmethod */
#include "vm/loader.h"
}
-/* helper_fillin_stacktrace ****************************************************
+/* helper_fillin_stacktrace ****************************************************
- This function returns the exception given as parameter with a filled in stacktrace
+ This function returns the exception given as parameter with a
+ filled in stacktrace.
*******************************************************************************/
classinfo *c;
methodinfo *m;
/*log_text("helper_fillin_stacktrace has beenentered");*/
- /* these are panics, since this are sever problems, which must never happen*/
- if (exc==0) panic("Exception must not be null in helper_fillin_stacktrace");
+ /* these are asserts, since this are sever problems, which must never happen*/
+ if (exc == 0) {
+ log_text("Exception must not be null in helper_fillin_stacktrace");
+ assert(0);
+ }
+
if ( ((java_lang_Throwable *) exc)->vmState!=0) return exc;
- if (exc->vftbl==0) panic ("Exception vftbl must not be null in helper_fillin_stacktrace");
+
+ if (exc->vftbl == 0) {
+ log_text("Exception vftbl must not be null in helper_fillin_stacktrace");
+ assert(0);
+ }
+
/*get classinfo from object instance*/
- c=exc->vftbl->class;
- if (c==0) panic("Exception class must not be null in helper_fillin_stacktrace");
+ c = exc->vftbl->class;
+
+ if (c == 0) {
+ log_text("Exception class must not be null in helper_fillin_stacktrace");
+ assert(0);
+ }
+
/*find the fillInStackTrace method*/
m=class_resolvemethod(c,utf_fillInStackTrace,utf_void__java_lang_Throwable);
- if (m==0) panic ("Exception does not have a fillInStackTrace method");
+
+ if (m == 0) {
+ log_text("Exception does not have a fillInStackTrace method");
+ assert(0);
+ }
/*log_text("helper_fillin_stacktrace doing it's work now");*/
asm_calljavafunction(m,exc,0,0,0);
return exc;
}
-java_objectheader *helper_fillin_stacktrace_always(java_objectheader* exc) {
- if (exc==0) panic("Exception must not be null in helper_fillin_stacktrace");
- ((java_lang_Throwable *) exc)->vmState=0;
+
+java_objectheader *helper_fillin_stacktrace_always(java_objectheader* exc)
+{
+ if (exc == 0) {
+ log_text("Exception must not be null in helper_fillin_stacktrace");
+ assert(0);
+ }
+
+ ((java_lang_Throwable *) exc)->vmState = 0;
+
return helper_fillin_stacktrace(exc);
}
-
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where
Changes:
- $Id: codegen.h 2467 2005-05-13 09:05:00Z twisti $
+ $Id: codegen.h 2496 2005-05-23 08:06:06Z twisti $
*/
if a and b are the same float-register, no code will be generated
*/
-#define M_FLTMOVE(reg,dreg) panic("M_FLTMOVE");
+#define M_FLTMOVE(reg,dreg) \
+ do { \
+ log_text("M_FLTMOVE"); \
+ assert(0); \
+ } while (0)
+
#define M_LNGMEMMOVE(reg,dreg) \
do { \
Changes: Stefan Ring
Christian Thalinger
- $Id: reg.inc 2446 2005-05-11 12:54:04Z twisti $
+ $Id: reg.inc 2496 2005-05-23 08:06:06Z twisti $
*/
break;
default:
- printf("ICMD %d at %d\n", iptr->opc, (s4) (iptr - m->instructions));
- panic("Missing ICMD code during register allocation");
+ throw_cacao_exception_exit(string_java_lang_InternalError,
+ "Unknown ICMD %d during register allocation",
+ iptr->opc);
} /* switch */
iptr++;
} /* while instructions */
Changes: Edwin Steiner
Christian Thalinger
- $Id: stack.c 2474 2005-05-13 14:02:17Z twisti $
+ $Id: stack.c 2496 2005-05-23 08:06:06Z twisti $
*/
+#include <assert.h>
#include <stdio.h>
#include <string.h>
STACKRESET;
deadcode = true;
/*printf("Block count :%d\n",b_count);*/
+
while (--b_count >= 0) {
if (bptr->flags == BBDELETED) {
/* do nothing */
/*log_text("BBDELETED");*/
- }
- else if (superblockend && (bptr->flags < BBREACHED))
+
+ } else if (superblockend && (bptr->flags < BBREACHED)) {
repeat = true;
- else if (bptr->flags <= BBREACHED) {
- if (superblockend)
+
+ } else if (bptr->flags <= BBREACHED) {
+ if (superblockend) {
stackdepth = bptr->indepth;
- else if (bptr->flags < BBREACHED) {
+
+ } else if (bptr->flags < BBREACHED) {
COPYCURSTACK(copy);
bptr->instack = copy;
bptr->indepth = stackdepth;
- }
- else if (bptr->indepth != stackdepth) {
+
+ } else if (bptr->indepth != stackdepth) {
show_icmd_method(m, cd, rd);
printf("Block: %d, required depth: %d, current depth: %d\n", bptr->debug_nr, bptr->indepth, stackdepth);
- panic("Stack depth mismatch");
-
+ log_text("Stack depth mismatch");
+ assert(0);
}
+
curstack = bptr->instack;
deadcode = false;
superblockend = false;
len = bptr->icount;
iptr = bptr->iinstr;
b_index = bptr - m->basicblocks;
+
while (--len >= 0) {
opcode = iptr->opc;
/* XXX TWISTI: why is this set to NULL here? */