Killed panic's.
authortwisti <none@none>
Mon, 23 May 2005 08:06:06 +0000 (08:06 +0000)
committertwisti <none@none>
Mon, 23 May 2005 08:06:06 +0000 (08:06 +0000)
src/vm/jit/alpha/codegen.c
src/vm/jit/helper.c
src/vm/jit/i386/codegen.h
src/vm/jit/reg.inc
src/vm/jit/stack.c

index 9f9ccde7c5bbeee5ea183ffca9738941d428a8ee..9a6cc0178a9cc1d6ec5831e2d2659a5f66c8ddb7 100644 (file)
@@ -30,7 +30,7 @@
    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 $
 
 */
 
@@ -192,8 +192,9 @@ void catch_NullPointerException(int sig, siginfo_t *siginfo, void *_p)
 
        } 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);
        }
 }
 
index 5785b4d17ff1e0051579b00801327ec77168306c..248da7740968366f669a67e0432f509cfa9f9860 100644 (file)
 
    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"
@@ -41,6 +43,7 @@
 #include "vm/references.h"
 #include "vm/resolve.h"
 #include "vm/stringlocal.h"
+#include "vm/jit/asmpart.h"
 
 /* XXX class_resolveclassmethod */
 #include "vm/loader.h"
@@ -203,9 +206,10 @@ void *helper_resolve_fieldinfo(unresolved_field *uf)
 }
 
 
-/* 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.
 
 *******************************************************************************/
 
@@ -214,16 +218,34 @@ java_objectheader *helper_fillin_stacktrace(java_objectheader* exc)
        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);
@@ -232,14 +254,20 @@ java_objectheader *helper_fillin_stacktrace(java_objectheader* exc)
        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
index 2e9d804df929edb9dff124e54802c77d7b1a4de5..e98472db4250066f83817d8d70004df67e6f6feb 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes:
 
-   $Id: codegen.h 2467 2005-05-13 09:05:00Z twisti $
+   $Id: codegen.h 2496 2005-05-23 08:06:06Z twisti $
 
 */
 
@@ -178,7 +178,12 @@ rd->ifmemuse:     max. number of stackslots used for spilling parameters
     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 { \
index 351c01093df12c4f5a7c28a898bbc1d347b7798a..5287c588d1f1e6ce83fd9571c25bc29e59b3caaf 100644 (file)
@@ -29,7 +29,7 @@
    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 $
 
 */
 
@@ -1613,8 +1613,9 @@ static void allocate_scratch_registers(methodinfo *m, registerdata *rd)
                                        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 */
index 6b9717a13be0a2c643708004aed2e2df582f8070..665cd0318258473b56748af47a6d7d3a6ca1bf69 100644 (file)
    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>
 
@@ -207,27 +208,31 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                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;
@@ -235,6 +240,7 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                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? */