Edwin Steiner
Christian Thalinger
- $Id: method.c 4879 2006-05-05 17:34:49Z edwin $
+ $Id: method.c 5785 2006-10-15 22:25:54Z edwin $
*/
#include "vm/linker.h"
#include "vm/loader.h"
#include "vm/method.h"
+#include "vm/options.h"
#include "vm/jit/methodheader.h"
if (m->jcode)
MFREE(m->jcode, u1, m->jcodelength);
- if (m->exceptiontable)
- MFREE(m->exceptiontable, exceptiontable, m->exceptiontablelength);
+ if (m->rawexceptiontable)
+ MFREE(m->rawexceptiontable, raw_exception_entry, m->rawexceptiontablelength);
code_free_code_of_method(m);
methodptr mptr;
methodptr *pmptr;
methodinfo *resm; /* pointer to new resolved method */
+ codeinfo *code;
/* If the method is not an instance method, just return it. */
if (m->class->flags & ACC_INTERFACE) {
pmptr = vftbl->interfacetable[-(m->class->index)];
mptr = pmptr[(m - m->class->methods)];
-
- } else {
+ }
+ else {
mptr = vftbl->table[m->vftblindex];
}
- /* and now get the methodinfo* from the first data segment slot */
+ /* and now get the codeinfo pointer from the first data segment slot */
+
+ code = *((codeinfo **) (mptr + CodeinfoPointer));
- resm = *((methodinfo **) (mptr + MethodPointer));
+ resm = code->m;
return resm;
}
#if !defined(NDEBUG)
void method_println(methodinfo *m)
{
+ if (opt_debugcolor) printf("\033[31m"); /* red */
method_print(m);
+ if (opt_debugcolor) printf("\033[m");
printf("\n");
}
#endif /* !defined(NDEBUG) */