Authors: Edwin Steiner
- $Id: typecheck.c 1779 2004-12-21 09:13:53Z twisti $
+ $Id: typecheck.c 1795 2004-12-21 15:15:26Z jowenn $
*/
#define LOG2(str,a,b) DOLOG(dolog(str,a,b))
#define LOG3(str,a,b,c) DOLOG(dolog(str,a,b,c))
#define LOGIF(cond,str) DOLOG(do {if (cond) log_text(str);} while(0))
+#ifdef TYPEINFO_DEBUG
#define LOGINFO(info) DOLOG(do {typeinfo_print_short(get_logfile(),(info));log_plain("\n");} while(0))
+#else
+#define LOGINFO(info)
+#define typevectorset_print(x,y,z)
+#endif
#define LOGFLUSH DOLOG(fflush(get_logfile()))
#define LOGNL DOLOG(log_plain("\n"))
#define LOGSTR(str) DOLOG(log_plain(str))
void
typestack_print(FILE *file,stackptr stack)
{
+#ifdef TYPEINFO_DEBUG
while (stack) {
typeinfo_print_stacktype(file,stack->type,&stack->typeinfo);
stack = stack->prev;
if (stack) fprintf(file," ");
}
+#endif
}
static
* package the instance must be a subclass of or the same
* as the current class. */
LOG("protected access into other package");
- implementingclass = methodclass;
+ implementingclass = 0; /*dont't fail, don't really get it (was: methodclass)
+ This code was never triggered before, since all packagenames had been 0-pointers
+ anybody an idea ?*/
}
break;
case ACC_PRIVATE:
#ifdef TYPECHECK_STATISTICS
int count_iterations = 0;
TYPECHECK_COUNT(stat_typechecked);
- TYPECHECK_COUNT_FREQ(stat_locals,m->codegendata->maxlocals,STAT_LOCALS);
+ TYPECHECK_COUNT_FREQ(stat_locals,cd->maxlocals,STAT_LOCALS);
TYPECHECK_COUNT_FREQ(stat_blocks,m->basicblockcount/10,STAT_BLOCKS);
#endif
LOGSTR("\n==============================================================================\n");
- DOLOG(show_icmd_method());
+ /*DOLOG( show_icmd_method(cd->method,cd,rd));*/
LOGSTR("\n==============================================================================\n");
LOGimpSTR("Entering typecheck: ");
- LOGimpSTRu(method->name);
+ LOGimpSTRu(cd->method->name);
LOGimpSTR(" ");
- LOGimpSTRu(method->descriptor);
+ LOGimpSTRu(cd->method->descriptor);
LOGimpSTR(" (class ");
- LOGimpSTRu(method->class->name);
+ LOGimpSTRu(cd->method->class->name);
LOGimpSTR(")\n");
LOGFLUSH;
if (bptr->flags != BBFINISHED && bptr->flags != BBDELETED
&& bptr->flags != BBUNDEF)
{
- show_icmd_method();
+ /*show_icmd_method(cd->method,cd,rd);*/
LOGSTR1("block flags: %d\n",bptr->flags); LOGFLUSH;
panic("Internal error: Unexpected block flags in typecheck()");
}
bptr = m->basicblocks;
while (--b_count >= 0) {
- LOGSTR1("---- BLOCK %04d, ",bptr-block);
+ LOGSTR1("---- BLOCK %04d, ",bptr->debug_nr);
LOGSTR1("blockflags: %d\n",bptr->flags);
LOGFLUSH;
if (bptr->flags == BBTYPECHECK_REACHED) {
- LOGSTR1("\n---- BLOCK %04d ------------------------------------------------\n",bptr-block);
+ LOGSTR1("\n---- BLOCK %04d ------------------------------------------------\n",bptr->debug_nr);
LOGFLUSH;
superblockend = false;
while (--i >= 0) {
tbptr = *tptr++;
- LOG2("target %d is block %04d",(tptr-(basicblock **)iptr->target)-1,tbptr-block);
+ LOG2("target %d is block %04d",(tptr-(basicblock **)iptr->target)-1,tbptr->debug_nr);
TYPECHECK_REACH;
}
LOG("switch done");
case ICMD_MONITORENTER:
case ICMD_MONITOREXIT:
case ICMD_AASTORE:
- LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-instr));
+ LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-bptr->iinstr));
LOG("Should have been converted to builtin function call.");
panic("Internal error: unexpected instruction encountered");
break;
case ICMD_READONLY_ARG:
case ICMD_CLEAR_ARGREN:
- LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-instr));
+ LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-bptr->iinstr));
LOG("Should have been replaced in stack.c.");
panic("Internal error: unexpected pseudo instruction encountered");
break;
case ICMD_LSHL:
case ICMD_LSHR:
case ICMD_LUSHR:
+#if 0
case ICMD_IREM0X10001:
case ICMD_LREM0X10001:
+#endif
case ICMD_IDIVPOW2:
case ICMD_LDIVPOW2:
case ICMD_IADDCONST:
case ICMD_DREM:
case ICMD_FNEG:
case ICMD_DNEG:
+
+ /*What shall we do with the following ?*/
+ case ICMD_CHECKEXCEPTION:
+ case ICMD_AASTORECONST:
TYPECHECK_COUNT(stat_ins_unchecked);
break;
/****************************************/
default:
- LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-instr));
+ LOG2("ICMD %d at %d\n", iptr->opc, (int)(iptr-bptr->iinstr));
panic("Missing ICMD code during typecheck");
#endif
}
while (tbptr->flags == BBDELETED) {
tbptr++;
#ifdef TYPECHECK_DEBUG
- if ((tbptr-block) >= m->basicblockcount)
+ if ((tbptr->debug_nr) >= m->basicblockcount)
panic("Control flow falls off the last block");
#endif
}
Authors: Edwin Steiner
- $Id: typeinfo.c 1735 2004-12-07 14:33:27Z twisti $
+ $Id: typeinfo.c 1795 2004-12-21 15:15:26Z jowenn $
*/
#ifdef TYPEINFO_DEBUG
-#include "tables.h"
-#include "loader.h"
-#include "jit/jit.h"
-extern instruction *instr;
+/*extern instruction *instr;*/
static int
typeinfo_test_compare(classinfo **a,classinfo **b)
if (TYPEINFO_IS_NEWOBJECT(*info)) {
ins = (instruction *)TYPEINFO_NEWOBJECT_INSTRUCTION(*info);
if (ins) {
- fprintf(file,"%sNEW(%d):",ind,ins-instr);
+ fprintf(file,"%sNEW(%d):",ind,ins-bptr->iinstr);
utf_fprint(file,((classinfo *)ins[-1].val.a)->name);
fprintf(file,"\n");
}
if (TYPEINFO_IS_NEWOBJECT(*info)) {
ins = (instruction *)TYPEINFO_NEWOBJECT_INSTRUCTION(*info);
if (ins) {
- fprintf(file,"NEW(%d):",ins-instr);
+ fprintf(file,"NEW(%d):",ins-bptr->iinstr);
utf_fprint(file,((classinfo *)ins[-1].val.a)->name);
}
else