Kaffe's register-slot sanity checking code is a significant CPU-eater. Since I've never seen this sanity-check catch anything, I think for standard builds it ought to be safe to simply disable it, and get relatively significant performance-boost for cery little effort. Debug builds probably ought to have it enabled, so maybe there's room to hook it into some configure script parameters yet.
-Jukka Santala
Index: kaffe/kaffevm/jit3/machine.c =================================================================== RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/jit3/machine.c,v retrieving revision 1.28 diff -u -r1.28 machine.c --- kaffe/kaffevm/jit3/machine.c 20 Jun 2001 22:50:01 -0000 1.28 +++ kaffe/kaffevm/jit3/machine.c 14 Jun 2002 10:20:58 -0000 @@ -12,7 +12,7 @@ * of this file. */ -#define SCHK(s) s +#define SCHK(s) #define SUSE(s) #include "config.h" Index: kaffe/kaffevm/jit3/registers.c =================================================================== RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/jit3/registers.c,v retrieving revision 1.9 diff -u -r1.9 registers.c --- kaffe/kaffevm/jit3/registers.c 20 Jun 2001 22:50:01 -0000 1.9 +++ kaffe/kaffevm/jit3/registers.c 14 Jun 2002 10:20:58 -0000 @@ -8,6 +8,8 @@ * of this file. */ +#define SCHK(s) + #include "config.h" #include "config-std.h" #include "config-mem.h" @@ -264,7 +266,7 @@ int needreload; int oldmod; - sanityCheck(); +SCHK( sanityCheck(); ) reg = slot->regno; regi = ®info[reg]; @@ -319,7 +321,7 @@ reg = allocRegister(idealreg, type); clobberRegister(reg); - sanityCheck(); +SCHK( sanityCheck(); ) /* If we're modifying this slot, clear the modified bits * so when we clobber it, it won't get written back. @@ -373,7 +375,7 @@ } } - sanityCheck(); +SCHK( sanityCheck(); ) /* Setup the new slot/register mapping and delete old one */ regi = ®info[reg]; @@ -401,7 +403,7 @@ slot_invalidate(slot); } - sanityCheck(); +SCHK( sanityCheck(); ) /* Return register */ return (regi->regno); @@ -419,7 +421,7 @@ SlotData* nslot; kregs* regi; - sanityCheck(); +SCHK( sanityCheck(); ) if (reg != NOREG) { regi = ®info[reg]; @@ -441,7 +443,7 @@ regi->used = ++usecnt; } - sanityCheck(); +SCHK( sanityCheck(); ) } /* @@ -453,7 +455,7 @@ { kregs* regi; - sanityCheck(); +SCHK( sanityCheck(); ) if (slot->regno != reg) { assert(!isGlobal(slot)); @@ -487,7 +489,7 @@ /* Finally, we assume the copy is done elsewhere */ - sanityCheck(); +SCHK( sanityCheck(); ) } /* @@ -497,7 +499,7 @@ int slotOffset(SlotData* slot, int type, int use) { - sanityCheck(); +SCHK( sanityCheck(); ) /* If slot is in a register, clobber the register to force it back * into memory. @@ -507,7 +509,7 @@ clobberRegister(slot[1].regno); } - sanityCheck(); +SCHK( sanityCheck(); ) return (slotOffsetNoSpill(slot, type)); } @@ -544,7 +546,7 @@ SlotData** ptr; int reg; - sanityCheck(); +SCHK( sanityCheck(); ) reg = sdata->regno; @@ -571,7 +573,7 @@ } sdata->modified = 0; - sanityCheck(); +SCHK( sanityCheck(); ) } /*