From: jzhou Date: Tue, 29 Mar 2011 16:44:14 +0000 (+0000) Subject: Remove the local mapping tbl and shared mapping tbl in gc, instead, use a big shared... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dcbc68c258754987862b6ee4818ed2d25ef422a8;p=IRC.git Remove the local mapping tbl and shared mapping tbl in gc, instead, use a big shared array to hold the mapping information of moved objs --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index fdb51b7a..f1fc156d 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -528,12 +528,14 @@ inline void initGC() { gcheaptop = 0; gctopcore = 0; gctopblock = 0; +#ifdef MAPPINGTBL_DEBUG + // initialize the gcmappingtbl + BAMBOO_MEMSET_WH(gcmappingtbl, 0, bamboo_rmsp_size); +#endif } // if(STARTUPCORE == BAMBOO_NUM_OF_CORE) gcself_numsendobjs = 0; gcself_numreceiveobjs = 0; gcmarkedptrbound = 0; - gcobj2map = 0; - gcmappedobj = 0; gcnumlobjs = 0; gcmovestartaddr = 0; gctomove = false; @@ -564,21 +566,9 @@ inline void initGC() { } gclobjhead->next = gclobjhead->prev = NULL; -#ifdef LOCALHASHTBL_TEST - freeRuntimeHash(gcpointertbl); - gcpointertbl = allocateRuntimeHash(20); -#else - mgchashreset(gcpointertbl); -#endif - freeMGCHash(gcforwardobjtbl); gcforwardobjtbl = allocateMGCHash(20, 3); - // initialize the mapping info related structures - if((BAMBOO_NUM_OF_CORE < NUMCORES4GC) && (gcsharedptbl != NULL)) { - // Never free the shared hash table, just reset it - mgcsharedhashReset(gcsharedptbl); - } #ifdef GC_PROFILE gc_num_livespace = 0; gc_num_freespace = 0; @@ -892,24 +882,11 @@ inline void moveLObjs() { GC_BAMBOO_DEBUGPRINT_REG(isize); GC_BAMBOO_DEBUGPRINT_REG(base); gcheaptop += size; - // cache the mapping info anyway - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop); -#else - mgchashInsert_I(gcpointertbl, ptr, tmpheaptop); -#endif - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); + // cache the mapping info + gcmappingtbl[OBJMAPPINGINDEX((int)ptr)] = (INTPTR)tmpheaptop; GC_BAMBOO_DEBUGPRINT(0xcdca); GC_BAMBOO_DEBUGPRINT_REG(ptr); GC_BAMBOO_DEBUGPRINT_REG(tmpheaptop); - if(host != BAMBOO_NUM_OF_CORE) { - // send the original host core with the mapping info - send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false); - GC_BAMBOO_DEBUGPRINT(0xcdcb); - GC_BAMBOO_DEBUGPRINT_REG(ptr); - GC_BAMBOO_DEBUGPRINT_REG(tmpheaptop); - } // if(host != BAMBOO_NUM_OF_CORE) tmpheaptop += isize; // set the gcsbstarttbl and bamboo_smemtbl @@ -967,25 +944,12 @@ inline void moveLObjs() { gcheaptop += size; cpysize += isize; - // cache the mapping info anyway - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, ptr, tmpheaptop); -#else - mgchashInsert_I(gcpointertbl, ptr, tmpheaptop); -#endif - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); + // cache the mapping info + gcmappingtbl[OBJMAPPINGINDEX((int)ptr)] = (INTPTR)tmpheaptop; GC_BAMBOO_DEBUGPRINT(0xcdcc); GC_BAMBOO_DEBUGPRINT_REG(ptr); GC_BAMBOO_DEBUGPRINT_REG(tmpheaptop); GC_BAMBOO_DEBUGPRINT_REG(*((int*)tmpheaptop)); - if(host != BAMBOO_NUM_OF_CORE) { - // send the original host core with the mapping info - send_msg_3(host, GCLOBJMAPPING, ptr, tmpheaptop, false); - GC_BAMBOO_DEBUGPRINT(0xcdcd); - GC_BAMBOO_DEBUGPRINT_REG(ptr); - GC_BAMBOO_DEBUGPRINT_REG(tmpheaptop); - } // if(host != BAMBOO_NUM_OF_CORE) tmpheaptop += isize; // update bamboo_smemtbl @@ -1281,7 +1245,7 @@ inline void mark(bool isfirst, // ptr is not an active obj or has been marked checkfield = false; } // if(isLarge(ptr, &type, &size)) else ... - } /* can never reach here + } /* can never reach here else { // check if this obj has been forwarded if(!MGCHashcontains(gcforwardobjtbl, (int)ptr)) { @@ -1855,19 +1819,7 @@ innermoveobj: BAMBOO_MEMSET_WH(toptr+size, -2, isize-size); } // store mapping info - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, origptr, toptr); -#else - mgchashInsert_I(gcpointertbl, origptr, toptr); -#endif - if(isremote) { - // add to the sharedptbl - if(gcsharedptbl != NULL) { - mgcsharedhashInsert_I(gcsharedptbl, origptr, toptr); - } - } - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); + gcmappingtbl[OBJMAPPINGINDEX((int)origptr)] = (INTPTR)toptr; GC_BAMBOO_DEBUGPRINT(0xcdce); GC_BAMBOO_DEBUGPRINT_REG(origptr); GC_BAMBOO_DEBUGPRINT_REG(toptr); @@ -1890,6 +1842,7 @@ innermoveobj: #endif // GC_CACHE_ADAPT } // if(mark == 1) GC_BAMBOO_DEBUGPRINT(0xe205); + // move to next obj orig->ptr += size; @@ -2140,13 +2093,7 @@ inline void * flushObj(void * objptr) { GC_BAMBOO_DEBUGPRINT(0xe402); GC_BAMBOO_DEBUGPRINT_REG(objptr); // a shared obj ptr, change to new address - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashget(gcpointertbl, objptr, &dstptr); -#else - dstptr = mgchashSearch(gcpointertbl, objptr); -#endif - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); + dstptr = gcmappingtbl[OBJMAPPINGINDEX((int)objptr)]; GC_BAMBOO_DEBUGPRINT_REG(dstptr); if(NULL == dstptr) { @@ -2154,52 +2101,9 @@ inline void * flushObj(void * objptr) { GC_BAMBOO_DEBUGPRINT(0xe403); GC_BAMBOO_DEBUGPRINT_REG(objptr); GC_BAMBOO_DEBUGPRINT_REG(hostcore(objptr)); - if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) { - // error! the obj is right on this core, but cannot find it - GC_BAMBOO_DEBUGPRINT_REG(objptr); - BAMBOO_EXIT(0xb003); - } else { - int hostc = hostcore(objptr); - // check the corresponsing sharedptbl - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); - mgcsharedhashtbl_t * sptbl = gcrpointertbls[hostc]; - if(sptbl != NULL) { - dstptr = mgcsharedhashSearch(sptbl, (int)objptr); - if(dstptr != NULL) { -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, (int)objptr, (int)dstptr); -#else - mgchashInsert_I(gcpointertbl, (int)objptr, (int)dstptr); -#endif - } - } - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - - if(dstptr == NULL) { - // still can not get the mapping info, - // send msg to host core for the mapping info - gcobj2map = (int)objptr; - gcismapped = false; - gcmappedobj = NULL; - // the first time require the mapping, send msg to the hostcore - // for the mapping info - send_msg_3(hostc, GCMAPREQUEST, (int)objptr, - BAMBOO_NUM_OF_CORE, false); - while(true) { - if(gcismapped) { - break; - } - } - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashget(gcpointertbl, objptr, &dstptr); -#else - dstptr = mgchashSearch(gcpointertbl, objptr); -#endif - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - } // if(dstptr == NULL) - } // if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) else ... - GC_BAMBOO_DEBUGPRINT_REG(dstptr); + // error! the obj is right on this core, but cannot find it + GC_BAMBOO_DEBUGPRINT_REG(objptr); + BAMBOO_EXIT(0xb003); } // if(NULL == dstptr) } // if(ISSHAREDOBJ(objptr)) // if not a shared obj, return NULL to indicate no need to flush @@ -2346,19 +2250,6 @@ inline void flushRuntimeObj(struct garbagelist * stackptr) { #endif } // void flushRuntimeObj(struct garbagelist * stackptr) -inline void transmappinginfo() { - // broadcast the sharedptbl pointer - for(int i = 0; i < NUMCORESACTIVE; i++) { - if(i != BAMBOO_NUM_OF_CORE) { - send_msg_3(i, GCMAPTBL, gcsharedptbl, BAMBOO_NUM_OF_CORE, false); - } - } - - if(STARTUPCORE != BAMBOO_NUM_OF_CORE) { - send_msg_2(STARTUPCORE, GCFINISHMAPINFO, BAMBOO_NUM_OF_CORE, false); - } -} - inline void flush(struct garbagelist * stackptr) { flushRuntimeObj(stackptr); @@ -2435,7 +2326,7 @@ inline void flush(struct garbagelist * stackptr) { if(ISSHAREDOBJ(ptr)) { ((int *)(ptr))[BAMBOOMARKBIT] = INIT; } - } // if((!ISSHAREDOBJ(ptr)) || (((int *)(ptr))[BAMBOOMARKBIT] == COMPACTED)) + } //if((!ISSHAREDOBJ(ptr))||(((int *)(ptr))[BAMBOOMARKBIT] == COMPACTED)) } // while(gc_moreItems()) GC_BAMBOO_DEBUGPRINT(0xe308); @@ -3080,21 +2971,6 @@ inline void gc_collect(struct garbagelist * stackptr) { udn_tile_coord_y()); #endif - while(true) { - if(MAPPHASE == gcphase) { - break; - } - } -#ifdef RAWPATH // TODO GC_DEBUG - printf("(%x,%x) Start map phase\n", udn_tile_coord_x(), - udn_tile_coord_y()); -#endif - transmappinginfo(); -#ifdef RAWPATH // TODO GC_DEBUG - printf("(%x,%x) Finish map phase\n", udn_tile_coord_x(), - udn_tile_coord_y()); -#endif - while(true) { if(FLUSHPHASE == gcphase) { break; @@ -3516,40 +3392,6 @@ inline void gc_master(struct garbagelist * stackptr) { RUNFREE(to); orig = to = NULL; - gcphase = MAPPHASE; - gccorestatus[BAMBOO_NUM_OF_CORE] = 1; - // Note: all cores should flush their runtime data including non-gc - // cores - for(i = 1; i < NUMCORES4GC; ++i) { - // send start flush messages to all cores - gccorestatus[i] = 1; - send_msg_1(i, GCSTARTMAPINFO, false); - } -#ifdef GC_PROFILE - gc_profileItem(); -#endif -#ifdef RAWPATH // TODO GC_DEBUG - printf("(%x,%x) Start map phase \n", udn_tile_coord_x(), - udn_tile_coord_y()); -#endif - // mapinto phase - transmappinginfo(); -#ifdef RAWPATH // TODO GC_DEBUG - printf("(%x,%x) Finish map phase \n", udn_tile_coord_x(), - udn_tile_coord_y()); -#endif - gccorestatus[BAMBOO_NUM_OF_CORE] = 0; - while(MAPPHASE == gcphase) { - // check the status of all cores - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); - if(gc_checkCoreStatus_I()) { - // all cores have finished sending mapping info - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - break; - } - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - } // while(MAPPHASE == gcphase) - gcphase = FLUSHPHASE; gccorestatus[BAMBOO_NUM_OF_CORE] = 1; // Note: all cores should flush their runtime data including non-gc @@ -3677,7 +3519,7 @@ inline bool gc(struct garbagelist * stackptr) { // disable the timer interrupt bamboo_mask_timer_intr(); #endif -#endif +#endif // core coordinator routine if(0 == BAMBOO_NUM_OF_CORE) { #ifdef GC_DEBUG diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index 92528b2f..d278939f 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -129,32 +129,15 @@ volatile bool gctomove; int gcrequiredmems[NUMCORES4GC]; //record pending mem requests volatile int gcmovepending; -// shared memory pointer for shared pointer mapping tbls +// shared memory pointer for pointer mapping tbls // In GC version, this block of memory is located at the bottom of the // shared memory, right on the top of the smem tbl. -// The bottom of the shared memory = sbstart tbl + smemtbl -// + NUMCORES4GC bamboo_rmsp +// The bottom of the shared memory = sbstart tbl + smemtbl + bamboo_rmsp // These three types of table are always reside at the bottom of the shared // memory and will never be moved or garbage collected -#ifdef GC_SMALLPAGESIZE -#define BAMBOO_RMSP_SIZE (1024 * 1024) -#else -#define BAMBOO_RMSP_SIZE (BAMBOO_SMEM_SIZE) // (45 * 16 * 1024) -#endif -//extern mspace bamboo_rmsp; -// shared pointer mapping tbl -mgcsharedhashtbl_t * gcsharedptbl; -// remote shared pointer tbls -mgcsharedhashtbl_t * gcrpointertbls[NUMCORES4GC]; - -#ifdef LOCALHASHTBL_TEST -struct RuntimeHash * gcpointertbl; -#else -mgchashtable_t * gcpointertbl; -#endif -int gcobj2map; -int gcmappedobj; -volatile bool gcismapped; +INTPTR * gcmappingtbl; +int bamboo_rmsp_size; +unsigned int bamboo_baseobjsize; // table recording the starting address of each small block // (size is BAMBOO_SMEM_SIZE) @@ -179,6 +162,8 @@ int * gccachepolicytbl; unsigned int size_cachepolicytbl; #endif // GC_CACHE_ADAPT +#define OBJMAPPINGINDEX(p) (((int)p-gcbaseva)/bamboo_baseobjsize) + #define ISSHAREDOBJ(p) \ ((((int)p)>gcbaseva)&&(((int)p)<(gcbaseva+(BAMBOO_SHARED_MEM_SIZE)))) diff --git a/Robust/src/Runtime/bamboo/multicoremem.h b/Robust/src/Runtime/bamboo/multicoremem.h index 44b19805..b681d8e1 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.h +++ b/Robust/src/Runtime/bamboo/multicoremem.h @@ -70,7 +70,7 @@ #elif defined GC_LARGESHAREDHEAP2 #define BAMBOO_NUM_BLOCKS ((GC_BAMBOO_NUMCORES)*(2+2)) #else -#define BAMBOO_NUM_BLOCKS ((GC_BAMBOO_NUMCORES)*(2+3)) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5) 3G +#define BAMBOO_NUM_BLOCKS ((GC_BAMBOO_NUMCORES)*(2+30/*3*/)) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5) 3G #endif #ifdef GC_LARGEPAGESIZE #define BAMBOO_PAGE_SIZE (4 * 1024 * 1024) // (4096) diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index 89a2dbe2..4467e88d 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -500,14 +500,14 @@ INLINE void initruntimedata() { gcself_numsendobjs = 0; gcself_numreceiveobjs = 0; gcmarkedptrbound = 0; -#ifdef LOCALHASHTBL_TEST +/*#ifdef LOCALHASHTBL_TEST gcpointertbl = allocateRuntimeHash_I(20); #else gcpointertbl = mgchashCreate_I(2000, 0.75); -#endif +#endif*/ gcforwardobjtbl = allocateMGCHash_I(20, 3); - gcobj2map = 0; - gcmappedobj = 0; + /*gcobj2map = 0; + gcmappedobj = 0;*/ gcnumlobjs = 0; gcheaptop = 0; gctopcore = 0; @@ -516,22 +516,6 @@ INLINE void initruntimedata() { gctomove = false; gcmovepending = 0; gcblock2fill = 0; - 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 kk = 0; - unsigned int tmp_k = 1 << (sizeof(int)*8 -1); - while(((t_size & tmp_k) == 0) && (kk < sizeof(int)*8)) { - t_size = t_size << 1; - kk++; - } - t_size = tmp_k >> kk; - gcsharedptbl = mgcsharedhashCreate_I(t_size,0.30); - } else { - gcsharedptbl = NULL; - } - BAMBOO_MEMSET_WH(gcrpointertbls, 0, - sizeof(mgcsharedhashtbl_t *)*NUMCORES4GC); #ifdef SMEMM gcmem_mixed_threshold = (unsigned int)((BAMBOO_SHARED_MEM_SIZE -bamboo_reserved_smem*BAMBOO_SMEM_SIZE)*0.8); @@ -567,11 +551,6 @@ INLINE void initruntimedata() { INLINE void disruntimedata() { #ifdef MULTICORE_GC -#ifdef LOCALHASHTBL_TEST - freeRuntimeHash(gcpointertbl); -#else - mgchashDelete(gcpointertbl); -#endif freeMGCHash(gcforwardobjtbl); #endif // MULTICORE_GC #ifdef TASK @@ -879,7 +858,6 @@ INLINE int checkMsgLength_I(int size) { case GCSTARTPRE: case GCSTARTINIT: case GCSTART: - case GCSTARTMAPINFO: case GCSTARTFLUSH: case GCFINISH: case GCMARKCONFIRM: @@ -901,7 +879,6 @@ INLINE int checkMsgLength_I(int size) { case GCSTARTCOMPACT: case GCMARKEDOBJ: case GCFINISHINIT: - case GCFINISHMAPINFO: case GCFINISHFLUSH: #ifdef GC_CACHE_ADAPT case GCFINISHPREF: @@ -914,12 +891,6 @@ INLINE int checkMsgLength_I(int size) { case MEMREQUEST: case MEMRESPONSE: -#ifdef MULTICORE_GC - case GCMAPREQUEST: - case GCMAPINFO: - case GCMAPTBL: - case GCLOBJMAPPING: -#endif { msglength = 3; break; @@ -1225,10 +1196,6 @@ INLINE void processmsg_gcstartcompact_I() { gcphase = COMPACTPHASE; } -INLINE void processmsg_gcstartmapinfo_I() { - gcphase = MAPPHASE; -} - INLINE void processmsg_gcstartflush_I() { gcphase = FLUSHPHASE; } @@ -1351,24 +1318,6 @@ INLINE void processmsg_gcfinishcompact_I() { } // if(cnum < NUMCORES4GC) } -INLINE void processmsg_gcfinishmapinfo_I() { - int data1 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - // received a map phase finish msg - if(BAMBOO_NUM_OF_CORE != STARTUPCORE) { - // non startup core can not receive this msg -#ifndef CLOSE_PRINT - BAMBOO_DEBUGPRINT_REG(data1); -#endif - BAMBOO_EXIT(0xe018); - } - // all cores should do flush - if(data1 < NUMCORES4GC) { - gccorestatus[data1] = 0; - } -} - - INLINE void processmsg_gcfinishflush_I() { int data1 = msgdata[msgdataindex]; MSG_INDEXINC_I(); @@ -1464,57 +1413,6 @@ INLINE void processmsg_gcmovestart_I() { MSG_INDEXINC_I(); //msgdata[3]; } -INLINE void processmsg_gcmaprequest_I() { - void * dstptr = NULL; - int data1 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - int data2 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashget(gcpointertbl, data1, &dstptr); -#else - dstptr = mgchashSearch(gcpointertbl, data1); -#endif - if(NULL == dstptr) { - // no such pointer in this core, something is wrong -#ifndef CLOSE_PRINT - BAMBOO_DEBUGPRINT_REG(data1); - BAMBOO_DEBUGPRINT_REG(data2); -#endif - BAMBOO_EXIT(0xe01c); - } else { - // send back the mapping info, cache the msg first - if(BAMBOO_CHECK_SEND_MODE()) { - cache_msg_3(data2, GCMAPINFO, data1, (int)dstptr); - } else { - send_msg_3(data2, GCMAPINFO, data1, (int)dstptr, true); - } - } -} - -INLINE void processmsg_gcmapinfo_I() { - int data1 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - gcmappedobj = msgdata[msgdataindex]; // [2] - MSG_INDEXINC_I(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, data1, gcmappedobj); -#else - mgchashInsert_I(gcpointertbl, data1, gcmappedobj); -#endif - if(data1 == gcobj2map) { - gcismapped = true; - } -} - -INLINE void processmsg_gcmaptbl_I() { - int data1 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - int data2 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - gcrpointertbls[data2] = (mgcsharedhashtbl_t *)data1; -} - INLINE void processmsg_gclobjinfo_I() { numconfirm--; @@ -1548,19 +1446,6 @@ INLINE void processmsg_gclobjinfo_I() { } // for(int k = 5; k < msgdata[1];) } -INLINE void processmsg_gclobjmapping_I() { - int data1 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); - int data2 = msgdata[msgdataindex]; - MSG_INDEXINC_I(); -#ifdef LOCALHASHTBL_TEST - RuntimeHashadd_I(gcpointertbl, data1, data2); -#else - mgchashInsert_I(gcpointertbl, data1, data2); -#endif - mgcsharedhashInsert_I(gcsharedptbl, data1, data2); -} - #ifdef GC_PROFILE INLINE void processmsg_gcprofiles_I() { int data1 = msgdata[msgdataindex]; @@ -1785,12 +1670,6 @@ processmsg: break; } // case GCSTARTCOMPACT - case GCSTARTMAPINFO: { - // received a flush phase start msg - processmsg_gcstartmapinfo_I(); - break; - } // case GCSTARTFLUSH - case GCSTARTFLUSH: { // received a flush phase start msg processmsg_gcstartflush_I(); @@ -1818,11 +1697,6 @@ processmsg: break; } // case GCFINISHCOMPACT - case GCFINISHMAPINFO: { - processmsg_gcfinishmapinfo_I(); - break; - } // case GCFINISHMAPINFO - case GCFINISHFLUSH: { processmsg_gcfinishflush_I(); break; @@ -1857,24 +1731,6 @@ processmsg: break; } // case GCMOVESTART - case GCMAPREQUEST: { - // received a mapping info request msg - processmsg_gcmaprequest_I(); - break; - } // case GCMAPREQUEST - - case GCMAPINFO: { - // received a mapping info response msg - processmsg_gcmapinfo_I(); - break; - } // case GCMAPINFO - - case GCMAPTBL: { - // received a mapping tbl response msg - processmsg_gcmaptbl_I(); - break; - } // case GCMAPTBL - case GCLOBJREQUEST: { // received a large objs info request msg transferMarkResults_I(); @@ -1887,12 +1743,6 @@ processmsg: break; } // case GCLOBJINFO - case GCLOBJMAPPING: { - // received a large obj mapping info msg - processmsg_gclobjmapping_I(); - break; - } // case GCLOBJMAPPING - #ifdef GC_PROFILE case GCPROFILES: { // received a gcprofiles msg diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.h b/Robust/src/Runtime/bamboo/multicoreruntime.h index 9be910f7..4a44092c 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.h +++ b/Robust/src/Runtime/bamboo/multicoreruntime.h @@ -238,33 +238,27 @@ typedef enum { GCSTARTINIT, // 0xE3 GCSTART, // 0xE4 GCSTARTCOMPACT, // 0xE5 - GCSTARTMAPINFO, // 0xE6 - GCSTARTFLUSH, // 0xE7 - GCFINISHPRE, // 0xE8 - GCFINISHINIT, // 0xE9 - GCFINISHMARK, // 0xEa - GCFINISHCOMPACT, // 0xEb - GCFINISHMAPINFO, // 0xEc - GCFINISHFLUSH, // 0xEd - GCFINISH, // 0xEe - GCMARKCONFIRM, // 0xEf - GCMARKREPORT, // 0xF0 - GCMARKEDOBJ, // 0xF1 - GCMOVESTART, // 0xF2 - GCMAPREQUEST, // 0xF3 - GCMAPINFO, // 0xF4 - GCMAPTBL, // 0xF5 - GCLOBJREQUEST, // 0xF6 - GCLOBJINFO, // 0xF7 - GCLOBJMAPPING, // 0xF8 + GCSTARTFLUSH, // 0xE6 + GCFINISHPRE, // 0xE7 + GCFINISHINIT, // 0xE8 + GCFINISHMARK, // 0xE9 + GCFINISHCOMPACT, // 0xEa + GCFINISHFLUSH, // 0xEb + GCFINISH, // 0xEc + GCMARKCONFIRM, // 0xEd + GCMARKREPORT, // 0xEe + GCMARKEDOBJ, // 0xEf + GCMOVESTART, // 0xF0 + GCLOBJREQUEST, // 0xF1 + GCLOBJINFO, // 0xF2 #ifdef GC_PROFILE - GCPROFILES, // 0xF9 + GCPROFILES, // 0xF3 #endif // GC_PROFILE #ifdef GC_CACHE_ADAPT - GCSTARTPOSTINIT, // 0xFa - GCSTARTPREF, // 0xFb - GCFINISHPOSTINIT, // 0xFc - GCFINISHPREF, // 0xFd + GCSTARTPOSTINIT, // 0xF4 + GCSTARTPREF, // 0xF5 + GCFINISHPOSTINIT, // 0xF6 + GCFINISHPREF, // 0xF7 #endif // GC_CACHE_ADAPT #endif // MULTICORE_GC MSGEND diff --git a/Robust/src/Runtime/mem.c b/Robust/src/Runtime/mem.c index 1849ea03..8844c358 100644 --- a/Robust/src/Runtime/mem.c +++ b/Robust/src/Runtime/mem.c @@ -4,32 +4,6 @@ #include "runtime.h" #include "runtime_arch.h" -void * mycalloc(int m, - int size) { - void * p = NULL; - int isize = size; - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); -#ifdef MULTICORE_GC - extern bool gc_localheap_s; -inermycalloc_i: - p = gc_localheap_s ? BAMBOO_LOCAL_MEM_CALLOC_S(m, isize) : - BAMBOO_LOCAL_MEM_CALLOC(m, isize); -#else - p = BAMBOO_LOCAL_MEM_CALLOC(m, isize); // calloc(m, isize); -#endif - if(p == NULL) { -#ifdef MULTICORE_GC - if(!gc_localheap_s) { - gc_localheap_s = true; - goto inermycalloc_i; - } -#endif - BAMBOO_EXIT(0xc001); - } - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - return p; -} - #ifdef MULTICORE_GC void * mycalloc_share(struct garbagelist * stackptr, int m, @@ -64,32 +38,6 @@ memalloc: BAMBOO_MEMSET_WH(alignedp + size, -2, p + isize - alignedp - size); return alignedp; } - -void * mycalloc_share_ngc(int m, - int size) { - void * p = NULL; - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); - p = BAMBOO_SHARED_MEM_CALLOC_NGC_I(m, size); // calloc(m, isize); - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); - return p; -} - -void * mycalloc_share_ngc_I(int m, - int size) { - void * p = NULL; - p = BAMBOO_SHARED_MEM_CALLOC_NGC_I(m, size); // calloc(m, isize); - return p; -} - -void mycalloc_free_ngc(void * ptr) { - BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); - BAMBOO_SHARED_MEM_FREE_NGC_I(ptr); - BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); -} - -void mycalloc_free_ngc_I(void * ptr) { - BAMBOO_SHARED_MEM_FREE_NGC_I(ptr); -} #else void * mycalloc_share(int m, int size) { @@ -108,6 +56,33 @@ void * mycalloc_share(int m, } #endif +void * mycalloc(int m, + int size) { + void * p = NULL; + int isize = size; + BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT(); +#ifdef MULTICORE_GC + extern bool gc_localheap_s; +inermycalloc_i: + p = gc_localheap_s ? BAMBOO_LOCAL_MEM_CALLOC_S(m, isize) : + BAMBOO_LOCAL_MEM_CALLOC(m, isize); +#else + p = BAMBOO_LOCAL_MEM_CALLOC(m, isize); // calloc(m, isize); +#endif + if(p == NULL) { +#ifdef MULTICORE_GC + if(!gc_localheap_s) { + gc_localheap_s = true; + goto inermycalloc_i; + } +#endif + BAMBOO_EXIT(0xc001); + } + BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); + return p; +} + + void * mycalloc_i(int m, int size) { void * p = NULL; diff --git a/Robust/src/Runtime/mem.h b/Robust/src/Runtime/mem.h index 5aca44b5..6f8bee97 100644 --- a/Robust/src/Runtime/mem.h +++ b/Robust/src/Runtime/mem.h @@ -37,10 +37,6 @@ void * mycalloc_share_ngc_I(int m, int size); void mycalloc_free_ngc(void * ptr); void mycalloc_free_ngc_I(void * ptr); #define FREEMALLOC(s, x) mycalloc_share((s),1,(x)) -#define FREEMALLOC_NGC(x) mycalloc_share_ngc(1, (x)) -#define FREEMALLOC_NGC_I(x) mycalloc_share_ngc_I(1, (x)) -#define FREE_NGC(x) mycalloc_free_ngc(x) -#define FREE_NGC_I(x) mycalloc_free_ngc_I(x) #else void * mycalloc_share(int m, int size); #define FREEMALLOC(x) mycalloc_share(1,x) diff --git a/Robust/src/buildscript b/Robust/src/buildscript index a6890d86..2dd0f853 100755 --- a/Robust/src/buildscript +++ b/Robust/src/buildscript @@ -937,6 +937,7 @@ rm ./* if $MGCFLAG then export TILERACFLAGS="-DMULTICORE -DCLOSE_PRINT -DTILERA" +#-DMAPPINGTBL_DEBUG" else export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA" fi