Edwin Steiner
Christian Thalinger
- $Id: loader.c 1409 2004-08-17 12:48:52Z twisti $
+ $Id: loader.c 1508 2004-11-15 08:34:10Z carolyn $
*/
#include "builtin.h"
#include "jit/jit.h"
#include "asmpart.h"
-#include "options.h"
#include "statistics.h"
#include "toolbox/memory.h"
#include "toolbox/logging.h"
m->stackcount = 0;
m->stack = NULL;
m->exceptiontable = NULL;
- m->registerdata = NULL;
m->stubroutine = NULL;
m->mcode = NULL;
m->entrypoint = NULL;
m->stubroutine = createcompilerstub(m);
} else {
+ /*if (useinlining) {
+ log_text("creating native stub:");
+ method_display(m);
+ }*/
functionptr f = native_findfunction(c->name, m->name, m->descriptor,
- (m->flags & ACC_STATIC) != 0);
- if (f) {
+ (m->flags & ACC_STATIC) != 0);
+#ifdef STATIC_CLASSPATH
+ if (f)
+#endif
+ {
m->stubroutine = createnativestub(f, m);
}
}
return false;
m->exceptiontablelength = suck_u2(cb);
-
if (!check_classbuffer_size(cb, (2 + 2 + 2 + 2) * m->exceptiontablelength))
return false;
}
/* everything was ok */
+ /* utf_display(m->name);
+ printf("\nexceptiontablelength:%ld\n",m->exceptiontablelength);*/
return true;
}
return false;
if (opt_verify &&
- !is_valid_utf(cb->pos + 1, cb->pos + 1 + length)) {
+ !is_valid_utf((char *) (cb->pos + 1),
+ (char *) (cb->pos + 1 + length))) {
dolog("Invalid UTF-8 string (constant pool index %d)",idx);
panic("Invalid UTF-8 string");
}
/* insert utf-string into the utf-symboltable */
- cpinfos[idx] = utf_new_intern(cb->pos + 1, length);
+ cpinfos[idx] = utf_new_intern((char *) (cb->pos + 1), length);
/* skip bytes of the string (buffer size check above) */
skip_nbytes(cb, length);
}
/* Check methods */
- memset(hashtab, 0, sizeof(u2) * (hashlen + len));
+ memset(hashtab, 0, sizeof(u2) * (hashlen + hashlen/5));
for (i = 0; i < c->methodscount; ++i) {
methodinfo *mi = c->methods + i;
index = ((((size_t) mi->name) +
((size_t) mi->descriptor)) >> shift) % hashlen;
+ /*{ JOWENN
+ int dbg;
+ for (dbg=0;dbg<hashlen+hashlen/5;++dbg){
+ printf("Hash[%d]:%d\n",dbg,hashtab[dbg]);
+ }
+ }*/
+
if ((old = hashtab[index])) {
old--;
next[i] = old;
return NULL;
if (super->flags & ACC_INTERFACE) {
- // java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class
+ /* java.lang.IncompatibleClassChangeError: class a has interface java.lang.Cloneable as super class */
panic("Interface specified as super class");
}
goto notfoundvftblindex;
if (tc->methods[j].flags & ACC_FINAL) {
- // class a overrides final method .
+ /* class a overrides final method . */
*exceptionptr =
new_exception(string_java_lang_VerifyError);
return NULL;