Make SPECjbb compile again
[IRC.git] / Robust / src / Runtime / bamboo / multicoregcflush.c
index ea4b45f8134dd13c52a8a8e3fd7b5f22a7dbd159..d2578ecfa63b85dbe54702b3d748f99e9e11e5fe 100644 (file)
@@ -3,6 +3,12 @@
 #include "multicoreruntime.h"
 #include "ObjectHash.h"
 #include "GenericHashtable.h"
+#include "gcqueue.h"
+#ifdef MGC
+#include "runtime_arch.h"
+
+extern int corenum;
+#endif
 
 /* Task specific includes */
 
@@ -92,7 +98,7 @@ INLINE void flushRuntimeObj(struct garbagelist * stackptr) {
   }
 
   // flush cached objs to be transferred
-  for(struct QueueItem * item = getHead(totransobjqueue);item != NULL;item = getNextQueueItem(item);) {
+  for(struct QueueItem * item = getHead(totransobjqueue);item != NULL;item = getNextQueueItem(item)) {
     struct transObjInfo * totransobj = (struct transObjInfo *)(item->objectptr);
     // the obj can not be NULL
     FLUSHOBJNONNULL(totransobj->objptr, 0);
@@ -177,18 +183,11 @@ void flush(struct garbagelist * stackptr) {
   BAMBOO_CACHE_MF();
 
   flushRuntimeObj(stackptr);
-  while(true) {
-    BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-    if(!gc_moreItems_I()) {
-      BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
-      break;
-    }
-
-    unsigned int ptr = gc_dequeue_I();
-    BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
+  while(gc_moreItems()) {
+    unsigned int ptr = gc_dequeue();
     // should be a local shared obj and should have mapping info
     FLUSHOBJNONNULL(ptr, 0);
-    BAMBOO_ASSERT(ptr != NULL, 0xb02a);
+    BAMBOO_ASSERT(ptr != NULL);
 
     if(((struct ___Object___ *)ptr)->marked == COMPACTED) {
       flushPtrsInObj((void *)ptr);
@@ -203,7 +202,7 @@ void flush(struct garbagelist * stackptr) {
   while(gc_lobjmoreItems_I()) {
     unsigned int ptr = gc_lobjdequeue_I(NULL, NULL);
     FLUSHOBJ(ptr, 0);
-    BAMBOO_ASSERT(ptr!=NULL, 0xb02d);
+    BAMBOO_ASSERT(ptr!=NULL);
 
     if(((struct ___Object___ *)ptr)->marked == COMPACTED) {
       flushPtrsInObj((void *)ptr);
@@ -216,7 +215,7 @@ void flush(struct garbagelist * stackptr) {
   if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
     gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
   } else {
-    send_msg_2(STARTUPCORE, GCFINISHFLUSH, BAMBOO_NUM_OF_CORE, false);
+    send_msg_2(STARTUPCORE,GCFINISHFLUSH,BAMBOO_NUM_OF_CORE);
   }
 }