#include "ObjectHash.h"
#include "GCSharedHash.h"
-#ifdef TASK
-#define BAMBOOMARKBIT 6
-#elif defined MGC
-#define BAMBOOMARKBIT 4
-#endif // TASK
-
extern int corenum;
#ifdef TASK
extern struct parameterwrapper ** objectqueues[][NUMCLASSES];
send_msg_4(STARTUPCORE, GCFINISHMARK, BAMBOO_NUM_OF_CORE,
gcself_numsendobjs, gcself_numreceiveobjs, false);
sendStall = true;
- tprintf("Make finished %x \n", (int)BAMBOO_NUM_OF_CORE);
}
} // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) ...
GC_BAMBOO_DEBUGPRINT(0xed0a);
int mark = 0;
int isize = 0;
innermoveobj:
- while((char)(*((int*)(orig->ptr))) == (char)(-2)) {
- orig->ptr = (int*)(orig->ptr) + 1;
+ while((*((char*)(orig->ptr))) == (char)(-2)) {
+ orig->ptr = (void*)(orig->ptr) + 1;
}
#ifdef GC_CACHE_ADAPT
completePageConvert(orig, to, to->ptr, false);
type = ((int *)(origptr))[0];
size = 0;
if(type == 0) {
- // end of this block, go to next one
+ // end of this block, go to next one
if(!nextSBlock(orig)) {
// finished, no more data
return true;
}
}
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- GC_BAMBOO_DEBUGPRINT(0xcdce);
+ GC_BAMBOO_DEBUGPRINT(0xcdce);
GC_BAMBOO_DEBUGPRINT_REG(origptr);
GC_BAMBOO_DEBUGPRINT_REG(toptr);
GC_BAMBOO_DEBUGPRINT_REG(isize);
(struct moveHelper *)RUNMALLOC(sizeof(struct moveHelper));
struct moveHelper * to =
(struct moveHelper *)RUNMALLOC(sizeof(struct moveHelper));
-
if(!initOrig_Dst(orig, to)) {
// no available data to compact
// send compact finish msg to STARTUP core
INTPTR heaptopptr = 0;
bool localcompact = true;
compacthelper(orig, to, &filledblocks, &heaptopptr, &localcompact);
-
RUNFREE(orig);
RUNFREE(to);
} // compact()
bool isfirst = true;
bool allStall = false;
+
#ifdef GC_CACHE_ADAPT
// prepare for cache adaption:
cacheAdapt_gc(true);
return false;
}
- if(BAMBOO_NUM_OF_CORE==0) tprintf("GC starts!\n"); // TODO
-
#ifdef GC_CACHE_ADAPT
#ifdef GC_CACHE_SAMPLING
// disable the timer interrupt
// core coordinator routine
if(0 == BAMBOO_NUM_OF_CORE) {
#ifdef GC_DEBUG
- printf("(%x,%X) Check if can do gc or not\n", udn_tile_coord_x(),
+ printf("(%x,%x) Check if can do gc or not\n", udn_tile_coord_x(),
udn_tile_coord_y());
#endif
bool isallstall = true;
gctomove = false;
gcmovepending = 0;
gcblock2fill = 0;
- gcsbstarttbl = BAMBOO_BASE_VA;
- bamboo_smemtbl = (void *)gcsbstarttbl
- + (BAMBOO_SHARED_MEM_SIZE/BAMBOO_SMEM_SIZE)*sizeof(INTPTR);
if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) {
int t_size = ((BAMBOO_RMSP_SIZE)-sizeof(mgcsharedhashtbl_t)*2
-128*sizeof(size_t))/sizeof(mgcsharedhashlistnode_t)-2;
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
// received a markedObj msg
- if(((int *)data1)[6] == INIT) {
+ if(((int *)data1)[BAMBOOMARKBIT] == INIT) {
// this is the first time that this object is discovered,
// set the flag as DISCOVERED
- ((int *)data1)[6] = DISCOVERED;
+ ((int *)data1)[BAMBOOMARKBIT] = DISCOVERED;
gc_enqueue_I(data1);
}
// set the remote flag
- ((int *)data1)[6] |= REMOTEM;
+ ((int *)data1)[BAMBOOMARKBIT] |= REMOTEM;
gcself_numreceiveobjs++;
gcbusystatus = true;
}