(BASICBLOCK_INIT): Likewise.
* src/vm/jit/reorder.c (reorder_place_next_unplaced_block): Likewise.
(reorder): Likewise.
* src/vm/jit/show.c (new_show_method): Likewise.
(show_method): Likewise.
(new_show_basicblock): Likewise.
(show_basicblock): Likewise.
(SHOW_TARGET): Likewise.
(show_icmd): Likewise.
* src/vm/jit/ifconv/ifconv.c (check): Likewise.
* src/vm/jit/loop/analyze.c (insert_exception): Likewise.
(copy_handler): Likewise.
(create_static_checks): Likewise.
* src/vm/jit/verify/typecheck.c (verify_basic_block): Likewise.
(typecheck_reset_flags): Likewise.
(typecheck): Likewise.
* src/vm/jit/verify/typeinfo.c (typeinfo_print): Likewise.
(typeinfo_print_short): Likewise.
(typeinfo_print_stacktype): Likewise.
#if !defined(NDEBUG)
if (pattern != 0) {
- printf("PATTERN %02d: (BB: %3d) ", pattern, m->basicblockcount - bptr->debug_nr);
+ printf("PATTERN %02d: (BB: %3d) ", pattern, m->basicblockcount - bptr->nr);
method_println(m);
/* if (pattern == 27) { */
(bptr[1].iinstr[1].opc == ICMD_GOTO))
{
- printf("CHECK 1 : (BB: %3d) ", m->basicblockcount - bptr->debug_nr);
+ printf("CHECK 1 : (BB: %3d) ", m->basicblockcount - bptr->nr);
method_println(m);
show_basicblock(jd, &bptr[1]);
show_basicblock(jd, &bptr[2]);
(bptr[1].iinstr[2].opc == ICMD_GOTO))
{
- printf("CHECK 2 : (BB: %3d) ", m->basicblockcount - bptr->debug_nr);
+ printf("CHECK 2 : (BB: %3d) ", m->basicblockcount - bptr->nr);
method_println(m);
show_basicblock(jd, &bptr[1]);
show_basicblock(jd, &bptr[2]);
(bptr[1].iinstr[3].opc == ICMD_GOTO))
{
- printf("CHECK 3 : (BB: %3d) ", m->basicblockcount - bptr->debug_nr);
+ printf("CHECK 3 : (BB: %3d) ", m->basicblockcount - bptr->nr);
method_println(m);
show_basicblock(jd, &bptr[1]);
show_basicblock(jd, &bptr[2]);
(bptr[1].iinstr[2].opc == ICMD_GOTO))
{
- printf("CHECK 4 : (BB: %3d) ", m->basicblockcount - bptr->debug_nr);
+ printf("CHECK 4 : (BB: %3d) ", m->basicblockcount - bptr->nr);
method_println(m);
show_basicblock(jd, &bptr[1]);
show_basicblock(jd, &bptr[2]);
Changes: Christian Thalinger
Edwin Steiner
- $Id: jit.h 5210 2006-08-07 11:10:01Z twisti $
+ $Id: jit.h 5214 2006-08-07 15:30:19Z twisti $
*/
/* the others by using bitfields. */
struct basicblock {
- s4 debug_nr; /* basic block number */
+ s4 nr; /* basic block number */
s4 flags; /* used during stack analysis, init with -1 */
s4 bitflags; /* OR of BBFLAG_... constants, init with 0 */
s4 type; /* basic block type (std, xhandler, subroutine*/
/* Macro for initializing newly allocated basic block's. It does not
need to zero fields, as we zero out the whole basic block array. */
-#define BASICBLOCK_INIT(bptr,m) \
- do { \
- bptr->mpc = -1; \
- bptr->flags = -1; \
- bptr->type = BBTYPE_STD; \
- bptr->method = (m); \
- bptr->debug_nr = (m)->c_debug_nr++; \
+#define BASICBLOCK_INIT(bptr,m) \
+ do { \
+ bptr->mpc = -1; \
+ bptr->flags = -1; \
+ bptr->type = BBTYPE_STD; \
+ bptr->method = (m); \
+ bptr->nr = (m)->c_debug_nr++; \
} while (0)
bounds are never violated. The function to call is
optimize_loops().
- $Id: analyze.c 4699 2006-03-28 14:52:32Z twisti $
+ $Id: analyze.c 5214 2006-08-07 15:30:19Z twisti $
*/
struct LoopElement *le;
#ifdef LOOP_DEBUG
- /* printf("insert_exception called with %d-%d and loop %d\n", ex->start->debug_nr, ex->end->debug_nr, lc->loop_head); */
+ /* printf("insert_exception called with %d-%d and loop %d\n", ex->start->nr, ex->end->nr, lc->loop_head); */
#endif
/* if child node is reached immediately insert exception into the tree */
/* copy node */
new = DMNEW(basicblock, 1);
memcpy(new, bptr, sizeof(basicblock));
- new->debug_nr = m->c_debug_nr++;
+ new->nr = m->c_debug_nr++;
ld->c_last_block_copied = new;
{
bptr = DMNEW(basicblock, 1);
memcpy(bptr, le->block, sizeof(basicblock));
- bptr->debug_nr = m->c_debug_nr++;
+ bptr->nr = m->c_debug_nr++;
/* determine beginning of copied loop to extend exception handler, that */
/* protect this loop */
/* copy current loop header to new basic block */
memcpy(bptr, loop_head, sizeof(basicblock));
- bptr->debug_nr = m->c_debug_nr++;
+ bptr->nr = m->c_debug_nr++;
/* insert the new basic block and move header before first loop node */
le = lc->nodes;
/* place the block */
- blocks[tbptr->debug_nr] = true;
+ blocks[tbptr->nr] = true;
/* change the basic block order */
iptr = bptr->iinstr + bptr->icount - 1;
- printf("L%03d, ", bptr->debug_nr);
+ printf("L%03d, ", bptr->nr);
switch (bptr->type) {
case BBTYPE_STD:
printf(", predecessors: %d, successors: %d, frequency: %d -> ",
bptr->predecessorcount, bptr->successorcount,
- pcode->bbfrequency[bptr->debug_nr]);
+ pcode->bbfrequency[bptr->nr]);
switch (iptr->opc) {
case ICMD_RETURN:
tbptr = (basicblock *) iptr->target;
ntbptr = bptr->next;
- printf("cond. L%03d\n", tbptr->debug_nr);
+ printf("cond. L%03d\n", tbptr->nr);
- tfreq = pcode->bbfrequency[tbptr->debug_nr];
- ntfreq = pcode->bbfrequency[ntbptr->debug_nr];
+ tfreq = pcode->bbfrequency[tbptr->nr];
+ ntfreq = pcode->bbfrequency[ntbptr->nr];
/* check which branch is more frequently */
- if ((blocks[tbptr->debug_nr] == false) && (tfreq > ntfreq)) {
+ if ((blocks[tbptr->nr] == false) && (tfreq > ntfreq)) {
/* If we place the taken block, we need to change the
conditional instruction (opcode and target). */
/* place taken block */
- blocks[tbptr->debug_nr] = true;
+ blocks[tbptr->nr] = true;
placed++;
/* set last placed block */
bptr = tbptr;
}
- else if (blocks[ntbptr->debug_nr] == false) {
+ else if (blocks[ntbptr->nr] == false) {
/* place not-taken block */
- blocks[ntbptr->debug_nr] = true;
+ blocks[ntbptr->nr] = true;
placed++;
/* set last placed block */
case ICMD_GOTO:
tbptr = (basicblock *) iptr->target;
- printf("L%03d\n", tbptr->debug_nr);
+ printf("L%03d\n", tbptr->nr);
/* If next block is already placed, search for another
one. */
- if (blocks[tbptr->debug_nr] == true) {
+ if (blocks[tbptr->nr] == true) {
tbptr = reorder_place_next_unplaced_block(m, blocks, bptr);
placed++;
And if the other predecessors have a higher
frequency, don't place it. */
- freq = pcode->bbfrequency[bptr->debug_nr];
+ freq = pcode->bbfrequency[bptr->nr];
for (i = 0; i < tbptr->predecessorcount; i++) {
pbptr = tbptr->predecessors[i];
/* skip the current basic block */
- if (pbptr->debug_nr != bptr->debug_nr) {
- pfreq = pcode->bbfrequency[pbptr->debug_nr];
+ if (pbptr->nr != bptr->nr) {
+ pfreq = pcode->bbfrequency[pbptr->nr];
/* Other predecessor has a higher frequency?
Search for another block to place. */
goto_continue:
/* place block */
- blocks[tbptr->debug_nr] = true;
+ blocks[tbptr->nr] = true;
placed++;
}
/* If next block is already placed, search for another
one. */
- if (blocks[tbptr->debug_nr] == true) {
+ if (blocks[tbptr->nr] == true) {
tbptr = reorder_place_next_unplaced_block(m, blocks, bptr);
placed++;
else {
/* place block */
- blocks[tbptr->debug_nr] = true;
+ blocks[tbptr->nr] = true;
placed++;
}
puts("");
for (bptr = m->basicblocks; bptr != NULL; bptr = bptr->next) {
- printf("L%03d\n", bptr->debug_nr);
+ printf("L%03d\n", bptr->nr);
}
/* everything's ok */
if (stage >= SHOW_PARSE) {
printf("Exceptions (Number: %d):\n", cd->exceptiontablelength);
for (ex = cd->exceptiontable; ex != NULL; ex = ex->down) {
- printf(" L%03d ... ", ex->start->debug_nr );
- printf("L%03d = ", ex->end->debug_nr);
- printf("L%03d", ex->handler->debug_nr);
+ printf(" L%03d ... ", ex->start->nr );
+ printf("L%03d = ", ex->end->nr);
+ printf("L%03d", ex->handler->nr);
printf(" (catchtype: ");
if (ex->catchtype.any)
if (IS_CLASSREF(ex->catchtype))
printf("Exceptions (Number: %d):\n", cd->exceptiontablelength);
for (ex = cd->exceptiontable; ex != NULL; ex = ex->down) {
- printf(" L%03d ... ", ex->start->debug_nr );
- printf("L%03d = ", ex->end->debug_nr);
- printf("L%03d", ex->handler->debug_nr);
+ printf(" L%03d ... ", ex->start->nr );
+ printf("L%03d = ", ex->end->nr);
+ printf("L%03d", ex->handler->nr);
printf(" (catchtype: ");
if (ex->catchtype.any)
if (IS_CLASSREF(ex->catchtype))
printf("======== %sL%03d ======== (flags: %d, bitflags: %01x, next: %d, type: ",
(bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : "",
- bptr->debug_nr, bptr->flags, bptr->bitflags,
- (bptr->next) ? (bptr->next->debug_nr) : -1);
+ bptr->nr, bptr->flags, bptr->bitflags,
+ (bptr->next) ? (bptr->next->nr) : -1);
switch (bptr->type) {
case BBTYPE_STD:
printf("] %sL%03d(flags: %d, bitflags: %01x, next: %d, type: ",
(bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : "",
- bptr->debug_nr, bptr->flags, bptr->bitflags,
- (bptr->next) ? (bptr->next->debug_nr) : -1);
+ bptr->nr, bptr->flags, bptr->bitflags,
+ (bptr->next) ? (bptr->next->nr) : -1);
switch (bptr->type) {
case BBTYPE_STD:
#define SHOW_TARGET(target) \
if (stage >= SHOW_STACK) { \
- printf("--> L%03d ", (target).block->debug_nr); \
+ printf("--> L%03d ", (target).block->nr); \
} \
else if (stage >= SHOW_PARSE) { \
printf("--> insindex %d (L%03d) ", (target).insindex, \
jd->new_basicblocks[jd->new_basicblockindex[ \
- (target).insindex]].debug_nr); \
+ (target).insindex]].nr); \
} \
else { \
printf("--> insindex %d ", (target).insindex); \
if (deadcode || !iptr->target)
printf(" op1=%d", iptr->op1);
else
- printf(" L%03d (%p)", ((basicblock *) iptr->target)->debug_nr, iptr->target);
+ printf(" L%03d (%p)", ((basicblock *) iptr->target)->nr, iptr->target);
/* } */
break;
if (deadcode || !iptr->target)
printf(" op1=%d", iptr->op1);
else
- printf(" L%03d", ((basicblock *) iptr->target)->debug_nr);
+ printf(" L%03d", ((basicblock *) iptr->target)->nr);
/* } */
break;
if (deadcode || !iptr->target)
printf(" op1=%d", iptr->op1);
else
- printf(" L%03d (%p)", ((basicblock *) iptr->target)->debug_nr,iptr->target);
+ printf(" L%03d (%p)", ((basicblock *) iptr->target)->nr,iptr->target);
break;
case ICMD_IFNULL:
if (deadcode || !iptr->target)
printf(" op1=%d", iptr->op1);
else
- printf(" L%03d (%p)", ((basicblock *) iptr->target)->debug_nr,iptr->target);
+ printf(" L%03d (%p)", ((basicblock *) iptr->target)->nr,iptr->target);
/* } */
break;
}
else {
tptr = (void **) iptr->target;
- printf(" L%03d;", ((basicblock *) *tptr)->debug_nr);
+ printf(" L%03d;", ((basicblock *) *tptr)->nr);
tptr++;
}
if (deadcode || !*tptr)
printf(" %d", *s4ptr++);
else {
- printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
+ printf(" L%03d", ((basicblock *) *tptr)->nr);
tptr++;
}
j--;
}
else {
tptr = (void **) iptr->target;
- printf(" L%03d;", ((basicblock *) *tptr)->debug_nr);
+ printf(" L%03d;", ((basicblock *) *tptr)->nr);
tptr++;
}
s4ptr++; /* default */
printf(" %d",*s4ptr++);
}
else {
- printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
+ printf(" L%03d", ((basicblock *) *tptr)->nr);
tptr++;
}
}
Changes: Christian Thalinger
- $Id: typecheck.c 5173 2006-07-25 15:57:11Z twisti $
+ $Id: typecheck.c 5214 2006-08-07 15:30:19Z twisti $
*/
/* of eclipse 3.0.2 */
if (TYPEINFO_NEWOBJECT_INSTRUCTION(state->localset->td[i].info) != NULL) {
/*show_icmd_method(state->m, state->cd, state->rd);*/
- printf("Uninitialized variable: %d, block: %d\n", i, state->bptr->debug_nr);
+ printf("Uninitialized variable: %d, block: %d\n", i, state->bptr->nr);
TYPECHECK_VERIFYERROR_bool("Uninitialized object in local variable inside try block");
}
}
while (--i >= 0) {
tbptr = *tptr++;
- LOG2("target %d is block %04d",(tptr-(basicblock **)state->iptr->target)-1,tbptr->debug_nr);
+ LOG2("target %d is block %04d",(tptr-(basicblock **)state->iptr->target)-1,tbptr->nr);
if (!typestate_reach(state,tbptr,dst,state->localset))
return false;
}
tbptr++;
#ifdef TYPECHECK_DEBUG
/* this must be checked in parse.c */
- if ((tbptr->debug_nr) >= state->m->basicblockcount)
+ if ((tbptr->nr) >= state->m->basicblockcount)
TYPECHECK_VERIFYERROR_bool("Control flow falls off the last block");
#endif
}
* that's ok. */
{
LOG2("block L%03d has invalid flags after typecheck: %d",
- state->m->basicblocks[i].debug_nr,state->m->basicblocks[i].flags);
+ state->m->basicblocks[i].nr,state->m->basicblocks[i].flags);
TYPECHECK_ASSERT(false);
}
}
state.bptr = state.m->basicblocks;
while (--i >= 0) {
- LOGSTR1("---- BLOCK %04d, ",state.bptr->debug_nr);
+ LOGSTR1("---- BLOCK %04d, ",state.bptr->nr);
LOGSTR1("blockflags: %d\n",state.bptr->flags);
LOGFLUSH;
Authors: Edwin Steiner
- $Id: typeinfo.c 5171 2006-07-25 13:52:38Z twisti $
+ $Id: typeinfo.c 5214 2006-08-07 15:30:19Z twisti $
*/
if (TYPEINFO_IS_PRIMITIVE(*info)) {
bptr = (basicblock*) TYPEINFO_RETURNADDRESS(*info);
if (bptr)
- fprintf(file,"%sreturnAddress (L%03d)\n",ind,bptr->debug_nr);
+ fprintf(file,"%sreturnAddress (L%03d)\n",ind,bptr->nr);
else
fprintf(file,"%sprimitive\n",ind);
return;
if (TYPEINFO_IS_PRIMITIVE(*info)) {
bptr = (basicblock*) TYPEINFO_RETURNADDRESS(*info);
if (bptr)
- fprintf(file,"ret(L%03d)",bptr->debug_nr);
+ fprintf(file,"ret(L%03d)",bptr->nr);
else
fprintf(file,"primitive");
return;
typeinfo_retaddr_set *set = (typeinfo_retaddr_set*)
TYPEINFO_RETURNADDRESS(*info);
if (set) {
- fprintf(file,"ret(L%03d",((basicblock*)(set->addr))->debug_nr);
+ fprintf(file,"ret(L%03d",((basicblock*)(set->addr))->nr);
set = set->alt;
while (set) {
- fprintf(file,"|L%03d",((basicblock*)(set->addr))->debug_nr);
+ fprintf(file,"|L%03d",((basicblock*)(set->addr))->nr);
set = set->alt;
}
}