changes
[IRC.git] / Robust / src / Runtime / bamboo / multicoremsg.c
index b2f1e869d7607956cd7605b5f085745cffa05a72..e620a8ddd4ba952de38de39924438072d735185d 100644 (file)
@@ -4,12 +4,19 @@
 #include "multicoreruntime.h"
 #include "multicoregarbage.h"
 #include "multicoretaskprofile.h"
-#include "gcqueue.h"
 #include "runtime_arch.h"
+#ifdef MULTICORE_GC
+#include "gcqueue.h"
 #include "markbit.h"
+#endif
+#ifdef PERFCOUNT
+#include "bme_perf_counter.h"
+#endif
 
 int msgsizearray[] = {
   0, //MSGSTART,
+  1, //REQNOTIFYSTART
+  1, //NOTIFYSTART
  -1, //TRANSOBJ,              // 0xD1
   4, //TRANSTALL,             // 0xD2
   5, //LOCKREQUEST,           // 0xD3
@@ -27,8 +34,15 @@ int msgsizearray[] = {
   1, //TERMINATE,             // 0xDf
   3, //MEMREQUEST,            // 0xE0
   3, //MEMRESPONSE,           // 0xE1
-#ifdef MULTICORE_GC
+#ifdef PERFCOUNT
+  1,
+  1,
+#endif
+#if defined(MULTICORE_GC)||defined(PMC_GC)
+  1, //GCINVOKE
   1, //GCSTARTPRE,            // 0xE2
+#endif
+#ifdef MULTICORE_GC
   1, //GCSTARTINIT,           // 0xE3
   1, //GCSTART,               // 0xE4
   2, //GCSTARTCOMPACT,        // 0xE5
@@ -49,7 +63,7 @@ int msgsizearray[] = {
   1, //GCGRANTBLOCK,  
   -1, //GCLOBJINFO,            // 0xF2
 #ifdef GC_PROFILE
-  4, //GCPROFILES,            // 0xF3
+  3, //GCPROFILES,            // 0xF3
 #endif // GC_PROFILE
 #ifdef GC_CACHE_ADAPT
   1, //GCSTARTCACHEPOLICY     // 0xF4
@@ -61,7 +75,7 @@ int msgsizearray[] = {
   -1 //MSGEND
 };
 
-INLINE unsigned int checkMsgLength_I(unsigned int realtype) {
+unsigned int checkMsgLength_I(unsigned int realtype) {
 #if (defined(TASK)||defined(MULTICORE_GC))
   unsigned int type = realtype & 0xff;
 #else
@@ -69,12 +83,12 @@ INLINE unsigned int checkMsgLength_I(unsigned int realtype) {
 #endif
   BAMBOO_ASSERT(type<=MSGEND);
 #ifdef TASK
-#ifdef MULTICORE_GC
+#if defined(MULTICORE_GC)
   if(type==TRANSOBJ||type==GCLOBJINFO) {
 #else
   if(type==TRANSOBJ) {
 #endif
-#elif MULTICORE_GC
+#elif defined(MULTICORE_GC)
   if (type==GCLOBJINFO) {
 #endif
 #if (defined(TASK)||defined(MULTICORE_GC))
@@ -85,7 +99,7 @@ INLINE unsigned int checkMsgLength_I(unsigned int realtype) {
 }
 
 #ifdef TASK
-INLINE void processmsg_transobj_I(int msglength) {
+void processmsg_transobj_I(int msglength) {
   struct transObjInfo * transObj=RUNMALLOC_I(sizeof(struct transObjInfo));
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE <= NUMCORESACTIVE - 1);
 
@@ -135,7 +149,7 @@ INLINE void processmsg_transobj_I(int msglength) {
 }
 #endif
 
-INLINE void processmsg_transtall_I() {
+void processmsg_transtall_I() {
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
   
   int num_core = msgdata[msgdataindex];
@@ -151,8 +165,8 @@ INLINE void processmsg_transtall_I() {
   }
 }
 
-#ifndef MULTICORE_GC
-INLINE void processmsg_lockrequest_I() {
+#if !defined(MULTICORE_GC)&&!defined(PMC_GC)
+void processmsg_lockrequest_I() {
   // check to see if there is a lock exist for the required obj
   // msgdata[1] -> lock type
   int locktype = msgdata[msgdataindex]; 
@@ -177,7 +191,7 @@ INLINE void processmsg_lockrequest_I() {
   }
 }
 
-INLINE void processmsg_lockgrount_I() {
+void processmsg_lockgrount_I() {
   MSG_INDEXINC_I();
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE <= NUMCORESACTIVE - 1);
   int data2 = msgdata[msgdataindex];
@@ -192,7 +206,7 @@ INLINE void processmsg_lockgrount_I() {
 #endif
 }
 
-INLINE void processmsg_lockdeny_I() {
+void processmsg_lockdeny_I() {
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -207,7 +221,7 @@ INLINE void processmsg_lockdeny_I() {
 #endif
 }
 
-INLINE void processmsg_lockrelease_I() {
+void processmsg_lockrelease_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -218,7 +232,7 @@ INLINE void processmsg_lockrelease_I() {
   processlockrelease(data1, data2, 0, false);
 }
 
-INLINE void processmsg_redirectlock_I() {
+void processmsg_redirectlock_I() {
   // check to see if there is a lock exist for the required obj
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();    // lock type
@@ -242,7 +256,7 @@ INLINE void processmsg_redirectlock_I() {
   }
 }
 
-INLINE void processmsg_redirectgrount_I() {
+void processmsg_redirectgrount_I() {
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -258,7 +272,7 @@ INLINE void processmsg_redirectgrount_I() {
 #endif
 }
 
-INLINE void processmsg_redirectdeny_I() {
+void processmsg_redirectdeny_I() {
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -273,7 +287,7 @@ INLINE void processmsg_redirectdeny_I() {
 #endif
 }
 
-INLINE void processmsg_redirectrelease_I() {
+void processmsg_redirectrelease_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -285,13 +299,12 @@ INLINE void processmsg_redirectrelease_I() {
 #endif // #ifndef MULTICORE_GC
 
 #ifdef PROFILE
-INLINE void processmsg_profileoutput_I() {
+void processmsg_profileoutput_I() {
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE != STARTUPCORE);
   stall = true;
   totalexetime = msgdata[msgdataindex];
   MSG_INDEXINC_I();
-#ifdef RT_TEST
-#else
+#if !defined(RT_TEST)
   outputProfileData();
 #endif
   // cache the msg first
@@ -302,13 +315,13 @@ INLINE void processmsg_profileoutput_I() {
   }
 }
 
-INLINE void processmsg_profilefinish_I() {
+void processmsg_profilefinish_I() {
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
   numconfirm--;
 }
 #endif // PROFILE
 
-INLINE void processmsg_statusconfirm_I() {
+void processmsg_statusconfirm_I() {
   BAMBOO_ASSERT(((BAMBOO_NUM_OF_CORE != STARTUPCORE) && (BAMBOO_NUM_OF_CORE <= NUMCORESACTIVE - 1)));
   // send response msg
   // cache the msg first
@@ -319,7 +332,7 @@ INLINE void processmsg_statusconfirm_I() {
   }
 }
 
-INLINE void processmsg_statusreport_I() {
+void processmsg_statusreport_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -338,17 +351,16 @@ INLINE void processmsg_statusreport_I() {
   numreceiveobjs[data2] = data4;
 }
 
-INLINE void processmsg_terminate_I() {
+void processmsg_terminate_I() {
   disruntimedata();
-#ifdef MULTICORE_GC
-#ifdef GC_CACHE_ADAPT
+#if defined(MULTICORE_GC)&&defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&(defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
   bamboo_mask_timer_intr(); // disable the TILE_TIMER interrupt
-#endif
 #endif
   BAMBOO_EXIT_APP(0);
 }
 
-INLINE void processmsg_memrequest_I() {
+#ifndef PMC_GC
+void processmsg_memrequest_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -360,14 +372,14 @@ INLINE void processmsg_memrequest_I() {
     // either not doing GC or the master core has decided to stop GC but 
     // // still sending msgs to other cores to inform them to stop the GC
 #endif
-    int allocsize = 0;
+    unsigned INTPTR allocsize = 0;
     void * mem = smemalloc_I(data2, data1, &allocsize);
     if(mem != NULL) {
       // send the start_va to request core, cache the msg first
       if(BAMBOO_CHECK_SEND_MODE()) {
-        cache_msg_3_I(data2,MEMRESPONSE,mem,allocsize);
+        cache_msg_3_I(data2,MEMRESPONSE,(unsigned INTPTR) mem,allocsize);
       } else {
-        send_msg_3_I(data2,MEMRESPONSE,mem,allocsize);
+        send_msg_3_I(data2,MEMRESPONSE,(unsigned INTPTR) mem,allocsize);
       }
     } //else if mem == NULL, the gcflag of the startup core has been set
     // and all the other cores have been informed to start gc
@@ -376,8 +388,8 @@ INLINE void processmsg_memrequest_I() {
 #endif
 }
 
-INLINE void processmsg_memresponse_I() {
-  void * memptr = msgdata[msgdataindex];
+void processmsg_memresponse_I() {
+  void * memptr =(void *) msgdata[msgdataindex];
   MSG_INDEXINC_I();
   unsigned int numbytes = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -396,7 +408,6 @@ INLINE void processmsg_memresponse_I() {
 #ifdef MULTICORE_GC
     bamboo_smem_size = numbytes;
     bamboo_cur_msp = memptr;
-    bamboo_smem_zero_top = bamboo_cur_msp;
 #else
     bamboo_smem_size = numbytes;
     bamboo_cur_msp =memptr;
@@ -407,43 +418,65 @@ INLINE void processmsg_memresponse_I() {
   }
 #endif
 }
+#endif //ifndef PMCGC
 
+
+#if defined(MULTICORE_GC)||defined(PMC_GC)
+void processmsg_gcinvoke_I() {
+  BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE==STARTUPCORE);
 #ifdef MULTICORE_GC
-INLINE void processmsg_gcstartpre_I() {
-  // the first time to be informed to start gc
-  gcflag = true;
-  if(!smemflag) {
-    // Zero out the remaining memory here because for the GC_CACHE_ADAPT 
-    // version, we need to make sure during the gcinit phase the shared heap 
-    // is not touched. Otherwise, there would be problem when adapt the cache 
-    // strategy.
-    bamboo_smem_size = 0;
-    bamboo_cur_msp = NULL;
-    smemflag = true;
-    bamboo_smem_zero_top = NULL;
+  if(!gc_status_info.gcprocessing && !gcflag) {
+    gcflag = true;
+    gcprecheck = true;
+    for(int i = 0; i < NUMCORESACTIVE; i++) {
+      // reuse the gcnumsendobjs & gcnumreceiveobjs
+      gcnumsendobjs[0][i] = 0;
+      gcnumreceiveobjs[0][i] = 0;
+    }
+#endif
+#ifdef PMC_GC
+  if(!gcflag) {
+    gcflag = true;
+#endif
+    for(int i = 0; i < NUMCORES4GC; i++) {
+      if(i != STARTUPCORE) {
+        if(BAMBOO_CHECK_SEND_MODE()) {
+          cache_msg_1_I(i,GCSTARTPRE);
+        } else {
+          send_msg_1_I(i,GCSTARTPRE);
+        }
+      }
+    }
   }
 }
 
-INLINE void processmsg_gcstartinit_I() {
+void processmsg_gcstartpre_I() {
+  // the first time to be informed to start gc
+  gcflag = true;
+}
+#endif
+#ifdef MULTICORE_GC
+void processmsg_gcstartinit_I() {
   gc_status_info.gcphase = INITPHASE;
 }
 
-INLINE void processmsg_gcstart_I() {
+void processmsg_gcstart_I() {
   // set the GC flag
   gc_status_info.gcphase = MARKPHASE;
 }
 
-INLINE void processmsg_gcstartcompact_I() {
+void processmsg_gcstartcompact_I() {
   gcblock2fill = msgdata[msgdataindex];
   MSG_INDEXINC_I();  
+  BAMBOO_ASSERT(!gc_status_info.gcbusystatus);
   gc_status_info.gcphase = COMPACTPHASE;
 }
 
-INLINE void processmsg_gcstartupdate_I() {
+void processmsg_gcstartupdate_I() {
   gc_status_info.gcphase = UPDATEPHASE;
 }
 
-INLINE void processmsg_gcfinishpre_I() {
+void processmsg_gcfinishpre_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -460,7 +493,7 @@ INLINE void processmsg_gcfinishpre_I() {
   gcnumreceiveobjs[0][data1] = data3;
 }
 
-INLINE void processmsg_gcfinishinit_I() {
+void processmsg_gcfinishinit_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   // received a init phase finish msg
@@ -472,10 +505,10 @@ INLINE void processmsg_gcfinishinit_I() {
   }
 }
 
-INLINE void processmsg_reqblock_I() {
+void processmsg_reqblock_I() {
   int cnum=msgdata[msgdataindex];
   MSG_INDEXINC_I();
-  void * topptr=msgdata[msgdataindex];
+  void * topptr= (void *)msgdata[msgdataindex];
   MSG_INDEXINC_I();
   if (topptr<=update_origblockptr) {
     //send message
@@ -491,24 +524,25 @@ INLINE void processmsg_reqblock_I() {
   }
 }
 
-INLINE void processmsg_grantblock_I() {
+void processmsg_grantblock_I() {
   blockgranted=true;
 }
 
 
-INLINE void processmsg_gcfinishmark_I() {
-  int data1 = msgdata[msgdataindex];
+void processmsg_gcfinishmark_I() {
+  int cnum = msgdata[msgdataindex];
   MSG_INDEXINC_I();
-  int data2 = msgdata[msgdataindex];
+  int nsend = msgdata[msgdataindex];
   MSG_INDEXINC_I();
-  int data3 = msgdata[msgdataindex];
+  int nrecv = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   // received a mark phase finish msg
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
+  BAMBOO_ASSERT(gc_status_info.gcphase == MARKPHASE);
 
   // all cores should do mark
-  if(data1 < NUMCORESACTIVE) {
-    gccorestatus[data1] = 0;
+  if(cnum < NUMCORESACTIVE) {
+    gccorestatus[cnum] = 0;
     int entry_index = 0;
     if(waitconfirm)  {
       // phase 2
@@ -517,8 +551,8 @@ INLINE void processmsg_gcfinishmark_I() {
       // phase 1
       entry_index = gcnumsrobjs_index;
     }
-    gcnumsendobjs[entry_index][data1] = data2;
-    gcnumreceiveobjs[entry_index][data1] = data3;
+    gcnumsendobjs[entry_index][cnum] = nsend;
+    gcnumreceiveobjs[entry_index][cnum] = nrecv;
   }
 }
  
@@ -534,19 +568,12 @@ void processmsg_returnmem_I() {
 void * handlegcfinishcompact_I(int cnum, unsigned int bytesneeded, unsigned int maxbytesneeded) {
   if(bytesneeded > 0) {
     // ask for more mem
-    void * startaddr = gcfindSpareMem_I(bytesneeded, maxbytesneeded, cnum);
-    if(startaddr) {
-      // cache the msg first
-      return startaddr;
-    } else {
-      maxusefulmems[cnum]=maxbytesneeded;
-      gcrequiredmems[cnum]=bytesneeded;
-    }
+    return gcfindSpareMem_I(bytesneeded, maxbytesneeded, cnum);
   } else {
     //done with compacting
     gccorestatus[cnum] = 0;
+    return NULL;
   }
-  return NULL;
 }
 
 void processmsg_gcfinishcompact_I() {
@@ -560,14 +587,14 @@ void processmsg_gcfinishcompact_I() {
   void * startaddr=handlegcfinishcompact_I(cnum, bytesneeded, maxbytesneeded);
   if (startaddr) {
     if(BAMBOO_CHECK_SEND_MODE()) {
-      cache_msg_2_I(cnum,GCMOVESTART,startaddr);
+      cache_msg_2_I(cnum,GCMOVESTART,(unsigned INTPTR)startaddr);
     } else {
-      send_msg_2_I(cnum,GCMOVESTART,startaddr);
+      send_msg_2_I(cnum,GCMOVESTART,(unsigned INTPTR)startaddr);
     }
   }
 }
 
-INLINE void processmsg_gcfinishupdate_I() {
+void processmsg_gcfinishupdate_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   // received a update phase finish msg
@@ -579,15 +606,14 @@ INLINE void processmsg_gcfinishupdate_I() {
   }
 }
 
-INLINE void processmsg_gcfinish_I() {
+void processmsg_gcfinish_I() {
   // received a GC finish msg
   gc_status_info.gcphase = FINISHPHASE;
   gc_status_info.gcprocessing = false;
 }
 
-INLINE void processmsg_gcmarkconfirm_I() {
+void processmsg_gcmarkconfirm_I() {
   BAMBOO_ASSERT(((BAMBOO_NUM_OF_CORE!=STARTUPCORE)&&(BAMBOO_NUM_OF_CORE<=NUMCORESACTIVE-1)));
-  gc_status_info.gcbusystatus = gc_moreItems_I();
   // send response msg, cahce the msg first
   if(BAMBOO_CHECK_SEND_MODE()) {
     cache_msg_5_I(STARTUPCORE,GCMARKREPORT,BAMBOO_NUM_OF_CORE,gc_status_info.gcbusystatus,gcself_numsendobjs,gcself_numreceiveobjs);
@@ -596,7 +622,7 @@ INLINE void processmsg_gcmarkconfirm_I() {
   }
 }
 
-INLINE void processmsg_gcmarkreport_I() {
+void processmsg_gcmarkreport_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
@@ -619,7 +645,7 @@ INLINE void processmsg_gcmarkreport_I() {
 
 }
 
-INLINE void processmsg_gcmarkedobj_I() {
+void processmsg_gcmarkedobj_I() {
   void * objptr = (void *) msgdata[msgdataindex];
   MSG_INDEXINC_I();
   
@@ -627,20 +653,21 @@ INLINE void processmsg_gcmarkedobj_I() {
   if(!checkMark(objptr)) {
     // this is the first time that this object is discovered,
     // set the flag as DISCOVERED
-    setMark(objptr);
+
+    setMark_I(objptr);
     gc_enqueue_I(objptr);
   }
   gcself_numreceiveobjs++;
   gc_status_info.gcbusystatus = true;
 }
 
-INLINE void processmsg_gcmovestart_I() {
+void processmsg_gcmovestart_I() {
   gctomove = true;
   gcmovestartaddr = msgdata[msgdataindex];
   MSG_INDEXINC_I();     
 }
 
-INLINE void processmsg_gclobjinfo_I(unsigned int msglength) {
+void processmsg_gclobjinfo_I(unsigned int msglength) {
   numconfirm--;
   int cnum = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -652,7 +679,7 @@ INLINE void processmsg_gclobjinfo_I(unsigned int msglength) {
 
   // large obj info here
   for(int k = 3; k < msglength; k+=2) {
-    int lobj = msgdata[msgdataindex];
+    void * lobj = (void *) msgdata[msgdataindex];
     MSG_INDEXINC_I();  
     int length = msgdata[msgdataindex];
     MSG_INDEXINC_I();   
@@ -661,19 +688,16 @@ INLINE void processmsg_gclobjinfo_I(unsigned int msglength) {
 }
 
 #ifdef GC_PROFILE
-INLINE void processmsg_gcprofiles_I() {
+void processmsg_gcprofiles_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   int data2 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
-  int data3 = msgdata[msgdataindex];
-  MSG_INDEXINC_I();
 #ifdef MGC_SPEC
   if(gc_profile_flag) {
 #endif
-    gc_num_obj += data1;
-    gc_num_liveobj += data2;
-    gc_num_forwardobj += data3;
+    gc_num_liveobj += data1;
+    gc_num_forwardobj += data2;
 #ifdef MGC_SPEC
   }
 #endif
@@ -682,11 +706,11 @@ INLINE void processmsg_gcprofiles_I() {
 #endif // GC_PROFILE
 
 #ifdef GC_CACHE_ADAPT
-INLINE void processmsg_gcstartcachepolicy_I() {
+void processmsg_gcstartcachepolicy_I() {
   gc_status_info.gcphase = CACHEPOLICYPHASE;
 }
 
-INLINE void processmsg_gcfinishcachepolicy_I() {
+void processmsg_gcfinishcachepolicy_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
@@ -697,11 +721,11 @@ INLINE void processmsg_gcfinishcachepolicy_I() {
   }
 }
 
-INLINE void processmsg_gcstartpref_I() {
+void processmsg_gcstartpref_I() {
   gc_status_info.gcphase = PREFINISHPHASE;
 }
 
-INLINE void processmsg_gcfinishpref_I() {
+void processmsg_gcfinishpref_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
   // received a update phase finish msg
@@ -715,6 +739,19 @@ INLINE void processmsg_gcfinishpref_I() {
 #endif // GC_CACHE_ADAPT
 #endif // #ifdef MULTICORE_GC
 
+void processmsg_req_notify_start() {
+  startflag=true;
+  if(BAMBOO_CHECK_SEND_MODE()) {
+    cache_msg_1_I(STARTUPCORE,NOTIFYSTART);
+  } else {
+    send_msg_1_I(STARTUPCORE,NOTIFYSTART);
+  }  
+}
+
+void processmsg_notify_start() {
+  numconfirm--;
+}
+
 // receive object transferred from other cores
 // or the terminate message from other cores
 // Should be invoked in critical sections!!
@@ -769,7 +806,18 @@ processmsg:
     // have some whole msg
     MSG_INDEXINC_I();
     msgdatafull = false;
+
     switch(type) {
+    case REQNOTIFYSTART: {
+      processmsg_req_notify_start();
+      break;
+    }
+
+    case NOTIFYSTART: {
+      processmsg_notify_start();
+      break;
+    }
+
 #ifdef TASK
     case TRANSOBJ: {
       // receive a object transfer msg
@@ -864,7 +912,7 @@ processmsg:
       processmsg_terminate_I();
       break;
     } 
-
+#ifndef PMC_GC
     case MEMREQUEST: {
       processmsg_memrequest_I();
       break;
@@ -874,14 +922,35 @@ processmsg:
       processmsg_memresponse_I();
       break;
     }
-
-#ifdef MULTICORE_GC
+#endif
+#ifdef PERFCOUNT
+    case MSGPERFCOUNT: {
+      profile_stop();
+      if(BAMBOO_CHECK_SEND_MODE()) {
+       cache_msg_1_I(STARTUPCORE, MSGPERFRESPONSE);
+      } else {
+       send_msg_1_I(STARTUPCORE, MSGPERFRESPONSE);
+      }
+      break;
+    }
+    case MSGPERFRESPONSE: {
+      coreperfcount--;
+      break;
+    }
+#endif
+#if defined(MULTICORE_GC)||defined(PMC_GC)
     // GC msgs
+    case GCINVOKE: {
+      processmsg_gcinvoke_I();
+      break;
+    }
+
     case GCSTARTPRE: {
       processmsg_gcstartpre_I();
       break;
     }
-       
+#endif
+#ifdef MULTICORE_GC
     case GCSTARTINIT: {
       processmsg_gcstartinit_I();
       break;