Changes:
- $Id: helper.c 2458 2005-05-12 23:02:07Z twisti $
+ $Id: helper.c 3007 2005-07-12 20:58:01Z 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"
/* resolve and load the class */
- if (!resolve_classref(NULL, cr, resolveEager, true, &c)) {
- java_objectheader *xptr;
- java_objectheader *cause;
-
- /* get the cause */
-
- cause = *exceptionptr;
-
- /* convert ClassNotFoundException's to NoClassDefFoundError's */
-
- if (builtin_instanceof(cause, class_java_lang_ClassNotFoundException)) {
- /* clear exception, because we are calling jit code again */
-
- *exceptionptr = NULL;
-
- /* create new error */
-
- xptr =
- new_exception_javastring(string_java_lang_NoClassDefFoundError,
- ((java_lang_Throwable *) cause)->detailMessage);
-
- /* we had an exception while creating the error */
-
- if (*exceptionptr)
- return NULL;
-
- /* set new exception */
-
- *exceptionptr = xptr;
- }
-
+ if (!resolve_classref(NULL, cr, resolveEager, true, true, &c))
return NULL;
- }
/* return the classinfo pointer */
}
-/* helper_fillin_stacktrace ****************************************************
-
- This function returns the exception given as parameter with a filled in stacktrace
-
-*******************************************************************************/
-
-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");
- if ( ((java_lang_Throwable *) exc)->vmState!=0) return exc;
- if (exc->vftbl==0) panic ("Exception vftbl must not be null in helper_fillin_stacktrace");
- /*get classinfo from object instance*/
- c=exc->vftbl->class;
- if (c==0) panic("Exception class must not be null in helper_fillin_stacktrace");
- /*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");
-
- /*log_text("helper_fillin_stacktrace doing it's work now");*/
- asm_calljavafunction(m,exc,0,0,0);
-
- /*return exception back to asmpart*/
- 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;
- 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