From: bdemsky Date: Thu, 7 Jul 2011 03:24:31 +0000 (+0000) Subject: it compiles now X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e283d292aa43c6d096c8b3d76c00f0a884d703f8;p=IRC.git it compiles now --- diff --git a/Robust/src/Runtime/bamboo/multicoregcmark.h b/Robust/src/Runtime/bamboo/multicoregcmark.h index 59a3c63a..a3e4d1a0 100644 --- a/Robust/src/Runtime/bamboo/multicoregcmark.h +++ b/Robust/src/Runtime/bamboo/multicoregcmark.h @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicoregcprofile.c b/Robust/src/Runtime/bamboo/multicoregcprofile.c index fa53cab6..bf9da3ed 100644 --- a/Robust/src/Runtime/bamboo/multicoregcprofile.c +++ b/Robust/src/Runtime/bamboo/multicoregcprofile.c @@ -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" diff --git a/Robust/src/Runtime/bamboo/multicoregcprofile.h b/Robust/src/Runtime/bamboo/multicoregcprofile.h index 9e7a79e0..8a49b15c 100644 --- a/Robust/src/Runtime/bamboo/multicoregcprofile.h +++ b/Robust/src/Runtime/bamboo/multicoregcprofile.h @@ -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" diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index 15c1ee8c..dce9f62f 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -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: { diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index c1666d64..29e6b397 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -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 @@ -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); diff --git a/Robust/src/Runtime/bamboo/pmc_garbage.c b/Robust/src/Runtime/bamboo/pmc_garbage.c index c37d610b..b0a39fdb 100644 --- a/Robust/src/Runtime/bamboo/pmc_garbage.c +++ b/Robust/src/Runtime/bamboo/pmc_garbage.c @@ -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; + } +} diff --git a/Robust/src/Runtime/bamboo/pmc_queue.c b/Robust/src/Runtime/bamboo/pmc_queue.c index c2d51b9f..7fd822ae 100644 --- a/Robust/src/Runtime/bamboo/pmc_queue.c +++ b/Robust/src/Runtime/bamboo/pmc_queue.c @@ -1,5 +1,6 @@ #include #include "pmc_queue.h" +#include "mem.h" void pmc_queueinit(struct pmc_queue *queue) { queue->head=queue->tail=RUNMALLOC(sizeof(struct pmc_queue_segment));