it compiles now
authorbdemsky <bdemsky>
Thu, 7 Jul 2011 03:24:31 +0000 (03:24 +0000)
committerbdemsky <bdemsky>
Thu, 7 Jul 2011 03:24:31 +0000 (03:24 +0000)
Robust/src/Runtime/bamboo/multicoregcmark.h
Robust/src/Runtime/bamboo/multicoregcprofile.c
Robust/src/Runtime/bamboo/multicoregcprofile.h
Robust/src/Runtime/bamboo/multicoremsg.c
Robust/src/Runtime/bamboo/multicoreruntime.c
Robust/src/Runtime/bamboo/pmc_garbage.c
Robust/src/Runtime/bamboo/pmc_queue.c

index 59a3c63a958f231ac5a4eee8f18181c7db843ce2..a3e4d1a0c455cd4bb7b0be25e330f4a2d69178cb 100644 (file)
@@ -10,6 +10,7 @@ void tomark(struct garbagelist * stackptr);
 void scanPtrsInObj(void * ptr, int type);
 void markObj(void * objptr);
 void mark(struct garbagelist * stackptr);
+void gettype_size(void * ptr, int * ttype, unsigned int * tsize);
 
 #endif // MULTICORE_GC
 #endif // BAMBOO_MULTICORE_GC_MARK_H
index fa53cab6f1a2a3219f16b6e048de7ad1125683ac..bf9da3edb14ebfdfedbe4a1d6cc6a5c5f80828f7 100644 (file)
@@ -1,4 +1,4 @@
-#if defined(MULTICORE_GC)&&defined(GC_PROFILE)
+#if (defined(MULTICORE_GC)||defined(PMC_GC))&&defined(GC_PROFILE)
 #include "multicoregcprofile.h"
 #include "structdefs.h"
 #include "runtime_arch.h"
index 9e7a79e0e34b9f43e37a5c9c83fd626c67bd071e..8a49b15cd53f25bbf5ff65eb049cdf25fcb0ecc8 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef BAMBOO_MULTICORE_GC_PROFILE_H
 #define BAMBOO_MULTICORE_GC_PROFILE_H
-#ifdef MULTICORE_GC
+#if defined(MULTICORE_GC)||defined(PMC_GC)
 #include "multicore.h"
 #include "runtime_arch.h"
 #include "structdefs.h"
index 15c1ee8cffde0fb27475da0a67d040fe3a514057..dce9f62f781a3e072f9a107f70748e2c0c636c84 100644 (file)
@@ -353,6 +353,7 @@ void processmsg_terminate_I() {
   BAMBOO_EXIT_APP(0);
 }
 
+#ifndef PMC_GC
 void processmsg_memrequest_I() {
   int data1 = msgdata[msgdataindex];
   MSG_INDEXINC_I();
@@ -411,6 +412,8 @@ void processmsg_memresponse_I() {
   }
 #endif
 }
+#endif //ifndef PMCGC
+
 
 #ifdef MULTICORE_GC
 void processmsg_gcinvoke_I() {
@@ -899,7 +902,7 @@ processmsg:
       processmsg_terminate_I();
       break;
     } 
-
+#ifndef PMC_GC
     case MEMREQUEST: {
       processmsg_memrequest_I();
       break;
@@ -909,7 +912,7 @@ processmsg:
       processmsg_memresponse_I();
       break;
     }
-
+#endif
 #ifdef MULTICORE_GC
     // GC msgs
     case GCINVOKE: {
index c1666d64332ddf681449750455143c9b7b4332fd..29e6b397e57ca0335f0892c15323e5100b92e1b3 100644 (file)
@@ -3,6 +3,9 @@
 #include "multicoreruntime.h"
 #include "methodheaders.h"
 #include "multicoregarbage.h"
+#ifdef PMC_GC
+#include "multicoregcprofile.h"
+#endif
 #include "multicore_arch.h"
 #include <stdio.h>
 
@@ -280,7 +283,7 @@ void CALL11(___System______exit____I,
             int ___status___, 
             int ___status___) {
 // gc_profile mode, output gc prfiling data
-#ifdef MULTICORE_GC
+#if defined(MULTICORE_GC)||defined(PMC_GC)
   if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
     BAMBOO_PRINT(BAMBOO_GET_EXE_TIME());
     BAMBOO_PRINT(0xbbbbbbbb);
index c37d610bf75906c95c2d7f5aad6f251f865a688a..b0a39fdb76536fa0528ac08ba114f477de429719 100644 (file)
@@ -1,9 +1,11 @@
 #include "multicoregc.h"
+#include "multicoreruntime.h"
 #include "pmc_garbage.h"
 #include "runtime_arch.h"
 
 struct pmc_heap * pmc_heapptr;
 struct pmc_queue * pmc_localqueue;
+volatile bool gcflag;
 
 void incrementthreads() {
   tmc_spin_mutex_lock(&pmc_heapptr->lock);
@@ -59,3 +61,19 @@ void gc(struct garbagelist *gl) {
   pmc_docompact();
   tmc_spin_barrier_wait(&pmc_heapptr->barrier);
 }
+
+void gettype_size(void * ptr, int * ttype, unsigned int * tsize) {
+  int type = ((int *)ptr)[0];
+  if(type < NUMCLASSES) {
+    // a normal object
+    *tsize = classsize[type];
+    *ttype = type;
+  } else {
+    // an array
+    struct ArrayObject *ao=(struct ArrayObject *)ptr;
+    unsigned int elementsize=classsize[type];
+    unsigned int length=ao->___length___;
+    *tsize = sizeof(struct ArrayObject)+length*elementsize;
+    *ttype = type;
+  } 
+}
index c2d51b9f20b6304a0419922e34d2eef4cfaea146..7fd822aeecc1871bd4666e2d90b95aecb68ddcaf 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include "pmc_queue.h"
+#include "mem.h"
 
 void pmc_queueinit(struct pmc_queue *queue) {
   queue->head=queue->tail=RUNMALLOC(sizeof(struct pmc_queue_segment));