change objects
authorbdemsky <bdemsky>
Sat, 18 Jun 2011 01:17:53 +0000 (01:17 +0000)
committerbdemsky <bdemsky>
Sat, 18 Jun 2011 01:17:53 +0000 (01:17 +0000)
Robust/src/Runtime/bamboo/gcqueue.h
Robust/src/Runtime/bamboo/markbit.h
Robust/src/Runtime/bamboo/multicorecache.h
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregarbage.h
Robust/src/Runtime/bamboo/multicoregccompact.c
Robust/src/Runtime/bamboo/multicoregccompact.h
Robust/src/Runtime/bamboo/multicoregcflush.c
Robust/src/Runtime/bamboo/multicoregcmark.c
Robust/src/Runtime/bamboo/multicoremsg.c

index 5aa15f47695bc76c0f1f39182a7878edc4e6dd4b..0f38d445d80b59eadbf023da7e7c864b2bc62574 100644 (file)
@@ -38,7 +38,7 @@ extern struct lobjpointerblock *gclobjspare;
 static void gc_queueinit() {
   // initialize queue
   if (gchead==NULL) {
-    gcheadindex=gctailindex=gctailindex2 = 0;
+    gcheadindex=gctailindex=0;
     gchead=gctail=RUNMALLOC(sizeof(struct pointerblock));
   } else {
     gctailindex=gcheadindex=0;
index a597cc8d6ebdaa64976ff3742966bf2dfb740268..871ac8bab944562f9bc5b0d237b1bccc6b3a3202 100644 (file)
@@ -5,11 +5,21 @@ extern unsigned int markmappingarray[];
 extern unsigned int bitmarkmappingarray[];
 extern unsigned int revmarkmappingarray[];
 
+#define ALIGNMENTSIZE 32
+//Bytes to shift to get minimum alignment units
+#define ALIGNMENTSHIFT 5
+
 #define NOTMARKED 0
-#define ALIGNOBJSIZE(x) (x)>>5
-#define ALIGNSIZETOBYTES(x) (x)<<5
-#define ALIGNTOTABLEINDEX(x) (x)>>(5+4)
-#define CONVERTTABLEINDEXTOPTR(x) (((unsigned INTPTR)((x)<<(5+4)))+gcbase)
+#define BITSPERALIGNMENT 2
+#define ALIGNOBJSIZE(x) (x)>>ALIGNMENTSHIFT
+#define ALIGNSIZETOBYTES(x) (x)<<ALIGNMENTSHIFT
+#define ALIGNTOTABLEINDEX(x) (x)>>(ALIGNMENTSHIFT+4)
+#define CONVERTTABLEINDEXTOPTR(x) (((unsigned INTPTR)((x)<<(ALIGNMENTSHIFT+4)))+gcbaseva)
+//Minimum alignment unit
+
+
+
+
 
 
 #define OBJMASK 0x40000000  //set towhatever smallest object mark is
@@ -32,7 +42,7 @@ extern unsigned int revmarkmappingarray[];
 /* Return length in units of ALIGNSIZE */
 
 static inline unsigned int getMarkedLength(void *ptr) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
   unsigned INTPTR val;
@@ -53,7 +63,7 @@ static inline unsigned int getMarkedLength(void *ptr) {
 /* Return non-zero value if the object is marked */
 
 static inline unsigned int checkMark(void *ptr) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
 
@@ -63,7 +73,7 @@ static inline unsigned int checkMark(void *ptr) {
 /* Set length in units of ALIGNSIZE */
 
 static inline void setLength(void *ptr, unsigned int length) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
   unsigned int ormask=(length>=16)?0xc4000000+(length-16):revmarkmappingarray[length];
@@ -78,7 +88,7 @@ static inline void setLength(void *ptr, unsigned int length) {
 /* Set length for premarked object */
 
 static inline void setLengthMarked(void *ptr, unsigned int length) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
   unsigned int ormask=(length>=16)?0xc4000000+(length-16):revmarkmappingarray[length];
@@ -92,14 +102,14 @@ static inline void setLengthMarked(void *ptr, unsigned int length) {
 /* Set length in units of ALIGNSIZE */
 
 static inline void setMark(void *ptr) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
   gcmarktbl[hibits]|=OBJMASK>>lobits;
 }
 
 static inline void clearMark(void *ptr) {
-  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbase));
+  unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
   unsigned INTPTR hibits=alignsize>>4;
   unsigned INTPTR lobits=(alignsize&15)<<1;
 
index ad86f5e99299bbab36f6916662bc91d7c36f17be..65d1ef7b82ae19417c8be89f9f54bba60d55f4a3 100644 (file)
@@ -55,7 +55,7 @@ INLINE static void samplingDataReviseInit(struct moveHelper * orig,struct moveHe
   gc_cache_revise_information.to_page_index=toindex;
   gc_cache_revise_information.orig_page_start_va=orig->ptr;
   gc_cache_revise_information.orig_page_end_va=gcbaseva+BAMBOO_PAGE_SIZE*(((unsigned INTPTR)(orig->ptr-gcbaseva))/BAMBOO_PAGE_SIZE+1);
-  gc_cache_revise_information.orig_page_index=((unsigned INTPTR)(orig->blockbase-gcbaseva))/BAMBOO_PAGE_SIZE;
+  gc_cache_revise_information.orig_page_index=((unsigned INTPTR)(orig->base-gcbaseva))/BAMBOO_PAGE_SIZE;
 }
 
 INLINE static void samplingDataConvert(void * current_ptr) {
index 2468a98bdcda880662da1e52c5c55651064f3e9b..95caaa3085bdd39ea46a1e9bb473912f3db74028 100644 (file)
@@ -306,94 +306,6 @@ int loadbalance(void ** heaptop, unsigned int * topblock, unsigned int * topcore
   return numbpc;
 }
 
-// compute total mem size required and sort the lobjs in ascending order
-unsigned int sortLObjs() {
-  unsigned int tmp_lobj = 0;
-  unsigned int tmp_len = 0;
-  unsigned int tmp_host = 0;
-  unsigned int sumsize = 0;
-
-  gclobjtail2 = gclobjtail;
-  gclobjtailindex2 = gclobjtailindex;
-  // TODO USE QUICK SORT INSTEAD?
-  while(gc_lobjmoreItems2_I()) {
-    gc_lobjdequeue2_I();
-    tmp_lobj = gclobjtail2->lobjs[gclobjtailindex2-1];
-    tmp_host = gclobjtail2->hosts[gclobjtailindex2-1];
-    tmp_len = gclobjtail2->lengths[gclobjtailindex2 - 1];
-    sumsize += tmp_len;
-    GCPROFILE_RECORD_LOBJ();
-    unsigned int i = gclobjtailindex2-1;
-    struct lobjpointerblock * tmp_block = gclobjtail2;
-    // find the place to insert
-    while(true) {
-      if(i == 0) {
-        if(tmp_block->prev == NULL) {
-          break;
-        }
-        if(tmp_block->prev->lobjs[NUMLOBJPTRS-1] > tmp_lobj) {
-          tmp_block->lobjs[i] = tmp_block->prev->lobjs[NUMLOBJPTRS-1];
-          tmp_block->lengths[i] = tmp_block->prev->lengths[NUMLOBJPTRS-1];
-          tmp_block->hosts[i] = tmp_block->prev->hosts[NUMLOBJPTRS-1];
-          tmp_block = tmp_block->prev;
-          i = NUMLOBJPTRS-1;
-        } else {
-          break;
-        }  // if(tmp_block->prev->lobjs[NUMLOBJPTRS-1] < tmp_lobj)
-      } else {
-        if(tmp_block->lobjs[i-1] > tmp_lobj) {
-          tmp_block->lobjs[i] = tmp_block->lobjs[i-1];
-          tmp_block->lengths[i] = tmp_block->lengths[i-1];
-          tmp_block->hosts[i] = tmp_block->hosts[i-1];
-          i--;
-        } else {
-          break;
-        }  
-      } 
-    }  
-    // insert it
-    if(i != gclobjtailindex2 - 1) {
-      tmp_block->lobjs[i] = tmp_lobj;
-      tmp_block->lengths[i] = tmp_len;
-      tmp_block->hosts[i] = tmp_host;
-    }
-  }
-  return sumsize;
-}
-
-bool cacheLObjs() {
-  // check the total mem size need for large objs
-  unsigned long long sumsize = 0;
-  unsigned int size = 0;
-  
-  sumsize = sortLObjs();
-
-  GCPROFILE_RECORD_LOBJSPACE();
-
-  // check if there are enough space to cache these large objs
-  unsigned int dst = gcbaseva + (BAMBOO_SHARED_MEM_SIZE) -sumsize;
-  if((unsigned long long)gcheaptop > (unsigned long long)dst) {
-    // do not have enough room to cache large objs
-    return false;
-  }
-
-  gcheaptop = dst; // Note: record the start of cached lobjs with gcheaptop
-  // cache the largeObjs to the top of the shared heap
-  dst = gcbaseva + (BAMBOO_SHARED_MEM_SIZE);
-  while(gc_lobjmoreItems3_I()) {
-    gc_lobjdequeue3_I();
-    size = gclobjtail2->lengths[gclobjtailindex2];
-    // set the mark field to , indicating that this obj has been moved
-    // and need to be flushed
-    dst -= size;
-    if((unsigned int)dst<(unsigned int)(gclobjtail2->lobjs[gclobjtailindex2]+size)) {
-      memmove(dst, gclobjtail2->lobjs[gclobjtailindex2], size);
-    } else {
-      memcpy(dst, gclobjtail2->lobjs[gclobjtailindex2], size);
-    }
-  }
-  return true;
-} 
 
 // update the bmmboo_smemtbl to record current shared mem usage
 void updateSmemTbl(unsigned int coren, void * localtop) {
@@ -451,7 +363,7 @@ void gc_collect(struct garbagelist * stackptr) {
   compact();
   GC_PRINTF("Finish compact phase\n");
 
-  WAITFORGCPHASE(FLUSHPHASE);
+  WAITFORGCPHASE(UPDATEPHASE);
 
   GC_PRINTF("Start flush phase\n");
   GCPROFILE_INFO_2_MASTER();
@@ -492,7 +404,7 @@ void gc_nocollect(struct garbagelist * stackptr) {
   GC_PRINTF("Finish mark phase, wait for flush\n");
 
   // non-gc core collector routine
-  WAITFORGCPHASE(FLUSHPHASE);
+  WAITFORGCPHASE(UPDATEPHASE);
 
   GC_PRINTF("Start flush phase\n");
   GCPROFILE_INFO_2_MASTER();
@@ -546,19 +458,17 @@ void master_getlargeobjs() {
   GCPROFILE_ITEM();
   GC_PRINTF("prepare to cache large objs \n");
 
-  // cache all large objs
-  BAMBOO_ASSERTMSG(cacheLObjs(), "Not enough space to cache large objects\n");
 }
 
 
 void master_updaterefs(struct garbagelist * stackptr) {
-  gc_status_info.gcphase = FLUSHPHASE;
-  GC_SEND_MSG_1_TO_CLIENT(GCSTARTFLUSH);
+  gc_status_info.gcphase = UPDATEPHASE;
+  GC_SEND_MSG_1_TO_CLIENT(GCSTARTUPDATE);
   GCPROFILE_ITEM();
   GC_PRINTF("Start flush phase \n");
   // flush phase
   flush(stackptr);
-  GC_CHECK_ALL_CORE_STATUS(FLUSHPHASE==gc_status_info.gcphase);
+  GC_CHECK_ALL_CORE_STATUS(UPDATEPHASE==gc_status_info.gcphase);
   GC_PRINTF("Finish flush phase \n");
 }
 
index 7b83212d0f6537864142471a1e81784350b5b224..8ba9bebb49170702c591d5bd87e4b803fb23fefd 100644 (file)
@@ -127,11 +127,6 @@ unsigned int size_cachepolicytbl;
   ((((unsigned int)p)>=gcbaseva)&&(((unsigned int)p)<(gcbaseva+(BAMBOO_SHARED_MEM_SIZE))))
 
 
-//Minimum alignment unit
-#define ALIGNMENTBYTES 32
-
-//Bytes to shift to get minimum alignment units
-#define ALIGNMENTSHIFT 5
 #define MAXBLOCK 0x4fffffff //local block number that can never be reached...
 
 
@@ -265,7 +260,7 @@ void gc_master(struct garbagelist * stackptr);
 
 
 void transferMarkResults_I();
-bool gcfindSpareMem_I(unsigned int * startaddr,unsigned int * tomove,unsigned int * dstcore,unsigned int requiredmem,unsigned int requiredcore);
+void * gcfindSpareMem_I(unsigned int requiredmem,unsigned int requiredcore);
 
 #define INITMULTICOREGCDATA() initmulticoregcdata()
 #define DISMULTICOREGCDATA() dismulticoregcdata()
index 3a6b9b04345fcea249011eb3ae46be0a65fc6c70..7589129a8c1e753135304f97f117a1fb099d58b6 100644 (file)
@@ -3,6 +3,7 @@
 #include "runtime_arch.h"
 #include "multicoreruntime.h"
 #include "multicoregarbage.h"
+#include "markbit.h"
 
 bool gc_checkCoreStatus() {
   for(int i = 0; i < NUMCORES4GC; ++i) {
@@ -21,15 +22,15 @@ void gc_resetCoreStatus() {
 
 void initOrig_Dst(struct moveHelper * orig,struct moveHelper * to) {
   // init the dst ptr
-  to->blocknum = 0;
-  BASEPTR(to->base, BAMBOO_NUM_OF_CORE, to->blocknum);
+  to->localblocknum = 0;
+  BASEPTR(to->base, BAMBOO_NUM_OF_CORE, to->localblocknum);
   to->ptr = to->base;
-  to->bound=to->base+BLOCKSIZE(to->blocknum);
+  to->bound=to->base+BLOCKSIZE(to->localblocknum);
   
   // init the orig ptr
-  orig->blocknum = 0;
+  orig->localblocknum = 0;
   orig->ptr=orig->base = to->base;
-  orig->bound = orig->base + BLOCKSIZE(orig->blocknum);
+  orig->bound = orig->base + BLOCKSIZE(orig->localblocknum);
 }
 
 void getSpaceLocally(struct moveHelper *to) {
@@ -107,7 +108,7 @@ unsigned int assignSpareMem_I(unsigned int sourcecore, unsigned int requiredmem,
     // next available block
     gcfilledblocks[sourcecore]++;
     void * newbase = NULL;
-    BASEPTR(sourcecore, gcfilledblocks[sourcecore], &newbase);
+    BASEPTR(newbase, sourcecore, gcfilledblocks[sourcecore]);
     topptrs[sourcecore] = newbase;
     return requiredmem-remain;
   }
@@ -137,9 +138,9 @@ void * gcfindSpareMem_I(unsigned int requiredmem,unsigned int requiredcore) {
   return NULL;
 } 
 
-bool gcfindSpareMem(unsigned int * startaddr,unsigned int * tomove,unsigned int * dstcore,unsigned int requiredmem,unsigned int requiredcore) {
+bool gcfindSpareMem(unsigned int requiredmem,unsigned int requiredcore) {
   BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-  bool retval=gcfindSpareMem_I(startaddr, tomove, dstcore, requiredmem, requiredcore);
+  bool retval=gcfindSpareMem_I(requiredmem, requiredcore);
   BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
   return retval;
 }
@@ -151,12 +152,12 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
   void *tobound=to->bound;
   void *origptr=orig->ptr;
   void *origbound=orig->bound;
-  unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbase));
+  unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbaseva));
   unsigned int objlength;
 
   while(origptr<origbound) {
     //Try to skip over stuff fast first
-    unsigned INTPTR offset=(unsigned INTPTR) (origptr-gcbase);
+    unsigned INTPTR offset=(unsigned INTPTR) (origptr-gcbaseva);
     unsigned INTPTR arrayoffset=ALIGNTOTABLEINDEX(offset);
     if (!gcmarktbl[arrayoffset]) {
       do {
@@ -189,7 +190,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
       origptr+=length;
       toptr=endtoptr;
     } else
-      origptr+=ALIGNSIZE;
+      origptr+=ALIGNMENTSIZE;
   }
 }
 
index 8af36d1508cce7f8192d2e50d07625269879bc45..0d56cfc832bc49d272c8bc855392b08f73064da8 100644 (file)
@@ -13,7 +13,7 @@ struct moveHelper {
 
 void initOrig_Dst(struct moveHelper * orig,struct moveHelper * to);
 void compacthelper(struct moveHelper * orig,struct moveHelper * to);
-void compactblocks(struct moveHelper * orig,struct moveHelper * to);
+unsigned int compactblocks(struct moveHelper * orig,struct moveHelper * to);
 void compact();
 void compact_master(struct moveHelper * orig, struct moveHelper * to);
 #endif // MULTICORE_GC
index 26ed50205a9b4da34df8fbc96d1a0cbe75d952b7..7b72e258efe42578e265032cf91beba581a93608 100644 (file)
@@ -4,6 +4,7 @@
 #include "ObjectHash.h"
 #include "GenericHashtable.h"
 #include "gcqueue.h"
+#include "markbit.h"
 
 /* Task specific includes */
 
@@ -175,17 +176,17 @@ INLINE void updatePtrsInObj(void * ptr) {
 
 /* This function is performance critical...  spend more time optimizing it */
 
-unsigned int updateblocks(struct moveHelper * orig, struct moveHelper * to) {
+void * updateblocks(struct moveHelper * orig, struct moveHelper * to) {
   void *tobase=to->base;
   void *tobound=to->bound;
   void *origptr=orig->ptr;
   void *origbound=orig->bound;
-  unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbase));
+  unsigned INTPTR origendoffset=ALIGNTOTABLEINDEX((unsigned INTPTR)(origbound-gcbaseva));
   unsigned int objlength;
 
   while(origptr<origbound) {
     //Try to skip over stuff fast first
-    unsigned INTPTR offset=(unsigned INTPTR) (origptr-gcbase);
+    unsigned INTPTR offset=(unsigned INTPTR) (origptr-gcbaseva);
     unsigned INTPTR arrayoffset=ALIGNTOTABLEINDEX(offset);
     if (!gcmarktbl[arrayoffset]) {
       do {
@@ -193,7 +194,6 @@ unsigned int updateblocks(struct moveHelper * orig, struct moveHelper * to) {
        if (arrayoffset<origendoffset) {
          //finished with block...
          origptr=origbound;
-         to->ptr=toptr;
          orig->ptr=origptr;
          return 0;
        }
@@ -210,17 +210,17 @@ unsigned int updateblocks(struct moveHelper * orig, struct moveHelper * to) {
       void *endtoptr=dstptr+length;
 
       if (endtoptr>tobound||endtoptr<tobase) {
-       toptr=tobound;
-       to->ptr=toptr;
+       //get use the next block of memory
+       to->ptr=tobound;
        orig->ptr=origptr;
-       return length;
+       return dstptr;
       }
       
       /* Move the object */
-      if(origptr <= dstptr+size) {
-        memmove(dstptr, origptr, size);
+      if(origptr <= endtoptr) {
+        memmove(dstptr, origptr, length);
       } else {
-        memcpy(dstptr, origptr, size);
+        memcpy(dstptr, origptr, length);
       }
       
       /* Update the pointers in the object */
@@ -232,7 +232,7 @@ unsigned int updateblocks(struct moveHelper * orig, struct moveHelper * to) {
       //good to move objects and update pointers
       origptr+=length;
     } else
-      origptr+=ALIGNSIZE;
+      origptr+=ALIGNMENTSIZE;
   }
 }
 
index ae8a49433199e153e145d2ed3f3bb91cc5075fae..847789c05a729b674611b406fb38702a9a5cbae2 100644 (file)
@@ -1,9 +1,10 @@
 #ifdef MULTICORE_GC
-#include "multicoregcmark.h"
 #include "runtime.h"
 #include "multicoreruntime.h"
 #include "GenericHashtable.h"
 #include "gcqueue.h"
+#include "multicoregcmark.h"
+#include "markbit.h"
 
 #ifdef TASK
 extern struct parameterwrapper ** objectqueues[][NUMCLASSES];
@@ -94,7 +95,7 @@ void markObj(void * objptr) {
   }
 }
 
-INLINE void markgarbagelist(struct garbagelist * listptr) {
+void markgarbagelist(struct garbagelist * listptr) {
   for(;listptr!=NULL;listptr=listptr->next) {
     int size=listptr->size;
     for(int i=0; i<size; i++) {
@@ -104,11 +105,10 @@ INLINE void markgarbagelist(struct garbagelist * listptr) {
 }
 
 // enqueue root objs
-INLINE void tomark(struct garbagelist * stackptr) {
+void tomark(struct garbagelist * stackptr) {
   BAMBOO_ASSERT(MARKPHASE == gc_status_info.gcphase);
   
   gc_status_info.gcbusystatus = true;
-  gcnumlobjs = 0;
   
   // enqueue current stack
   markgarbagelist(stackptr);
index 0d586b9d72dbb738ff59b3628f01450a0ed30913..e975e8a0ce150faa11784b6b48055a1304306bd8 100644 (file)
@@ -518,9 +518,9 @@ INLINE void processmsg_gcfinishcompact_I() {
     if(startaddr) {
       // cache the msg first
       if(BAMBOO_CHECK_SEND_MODE()) {
-       cache_msg_4_I(cnum,GCMOVESTART,startaddr);
+       cache_msg_2_I(cnum,GCMOVESTART,startaddr);
       } else {
-       send_msg_4_I(cnum,GCMOVESTART,startaddr);
+       send_msg_2_I(cnum,GCMOVESTART,startaddr);
       }
     }
   } else {
@@ -582,16 +582,15 @@ INLINE void processmsg_gcmarkreport_I() {
 }
 
 INLINE void processmsg_gcmarkedobj_I() {
-  void * data1 = (void *) msgdata[msgdataindex];
+  void * objptr = (void *) msgdata[msgdataindex];
   MSG_INDEXINC_I();
-  BAMBOO_ASSERT(ISSHAREDOBJ(data1));
   
   // received a markedObj msg
   if(!checkMark(objptr)) {
     // this is the first time that this object is discovered,
     // set the flag as DISCOVERED
-    setMark(data1);
-    gc_enqueue_I(data1);
+    setMark(objptr);
+    gc_enqueue_I(objptr);
   }
   gcself_numreceiveobjs++;
   gc_status_info.gcbusystatus = true;
@@ -625,7 +624,6 @@ INLINE void processmsg_gclobjinfo_I(unsigned int data1) {
     int length = msgdata[msgdataindex];
     MSG_INDEXINC_I();   
     gc_lobjenqueue_I(lobj, length, cnum);
-    gcnumlobjs++;
   }
 }