calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 1082 2004-05-26 15:04:54Z jowenn $
+ $Id: builtin.c 1113 2004-06-02 10:31:09Z twisti $
*/
java_objectheader *o;
/* is the class loaded */
- if (!c->loaded) {
- class_load(c);
- }
+ if (!c->loaded)
+ if (!class_load(c))
+ return NULL;
/* is the class linked */
- if (!c->linked) {
- class_link(c);
- }
+ if (!c->linked)
+ if (!class_link(c))
+ return NULL;
if (!c->initialized) {
- if (initverbose) {
- char logtext[MAXLOGTEXT];
- sprintf(logtext, "Initialize class ");
- utf_sprint_classname(logtext + strlen(logtext), c->name);
- sprintf(logtext + strlen(logtext), " (from builtin_new)");
- log_text(logtext);
- }
- (void) class_init(c);
+ if (initverbose)
+ log_message_class("Initialize class (from builtin_new): ", c);
- /* we had an ExceptionInInitializerError */
- if (*exceptionptr) {
+ if (!class_init(c))
return NULL;
- }
}
#ifdef SIZE_FROM_CLASSINFO
#else
o = heap_allocate(c->instancesize, true, c->finalizer);
#endif
+
if (!o)
return NULL;
return o;
}
+
/********************** Function: builtin_newarray **************************
Creates an array with the given vftbl on the heap.
{
/* is class loaded */
if (!component->loaded)
- class_load(component);
+ if (!class_load(component))
+ return NULL;
/* is class linked */
if (!component->linked)
- class_link(component);
+ if (!class_link(component))
+ return NULL;
return (java_objectarray *) builtin_newarray(size, class_array_of(component)->vftbl);
}
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
return &THREADINFO->_stackframeinfo;
#else
+#if defined(__GNUC__)
#warning FIXME FOR OLD THREAD IMPL (jowenn)
+#endif
return &_thread_nativestackframeinfo; /* no threading, at least no native*/
#endif
}
size_t s;
s=(end-begin);
/*printf ("begin: %p, end: %p, diff: %ld, size :%ld\n",begin,end,s,s*sizeof(stacktraceelement));*/
- *el=GCNEW(stacktraceelement,s+1);
+ *el=MNEW(stacktraceelement,s+1); /*GC*/
memcpy(*el,begin,(end-begin)*sizeof(stacktraceelement));
(*el)[s].method=0;
+#if defined(__GNUC__)
#warning change this if line numbers bigger than u2 are allowed, the currently supported class file format does no allow that
+#endif
(*el)[s].linenumber=-1; /* -1 can never be reched otherwise, since line numbers are only u2, so it is save to use that as flag */
return *el;
}