From 2baef458463efb0ef9b2d65eff9af472ccc99c4d Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 7 Jul 2011 01:24:46 +0000 Subject: [PATCH] code towards PMC compiling --- Robust/src/Runtime/bamboo/multicoregarbage.h | 3 --- Robust/src/Runtime/bamboo/multicoregc.h | 4 ++++ Robust/src/Runtime/bamboo/multicoremem.h | 4 ++-- Robust/src/Runtime/bamboo/multicoremsg.c | 10 ++++++---- Robust/src/Runtime/bamboo/multicoreruntime.c | 12 ++++++------ Robust/src/Runtime/bamboo/multicoreruntime.h | 2 +- Robust/src/Runtime/bamboo/pmc_garbage.c | 1 + Robust/src/Runtime/mem.c | 11 ++++++++--- Robust/src/Runtime/mem.h | 2 +- Robust/src/Runtime/runtime.h | 4 ++-- 10 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index 3e2e218f..717169b0 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -112,8 +112,6 @@ unsigned int bamboo_rmsp_size; //mark table....keep track of mark bits volatile unsigned int * gcmarktbl; -void * gcbaseva; // base va for shared memory without reserved sblocks - bool gc_checkCoreStatus(); void gc_resetCoreStatus(); @@ -146,7 +144,6 @@ struct allocrecord { struct allocrecord allocationinfo; #ifdef GC_CACHE_ADAPT -void * gctopva; // top va for shared memory without reserved sblocks volatile bool gccachestage; // table recording the sampling data collected for cache adaption int * gccachesamplingtbl; diff --git a/Robust/src/Runtime/bamboo/multicoregc.h b/Robust/src/Runtime/bamboo/multicoregc.h index f0f2c02e..be085b37 100644 --- a/Robust/src/Runtime/bamboo/multicoregc.h +++ b/Robust/src/Runtime/bamboo/multicoregc.h @@ -7,4 +7,8 @@ struct garbagelist { void * array[]; }; +void * gctopva; // top va for shared memory without reserved sblocks +void * gcbaseva; // base va for shared memory without reserved sblocks + + #endif // BAMBOO_MULTICORE_GC_H diff --git a/Robust/src/Runtime/bamboo/multicoremem.h b/Robust/src/Runtime/bamboo/multicoremem.h index ed3ffd1e..4dc93afd 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.h +++ b/Robust/src/Runtime/bamboo/multicoremem.h @@ -89,8 +89,8 @@ #define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) * (BAMBOO_NUM_BLOCKS))) //(1024 * 1024 * 240) //((unsigned long long int)(3.0 * 1024 * 1024 * 1024)) // 3G #endif // GC_DEBUG -#ifdef MULTICORE_GC -#ifdef GC_SMALLPAGESIZE +#if defined(MULTICORE_GC)||defined(PMC_GC) +#if defined(GC_SMALLPAGESIZE)||defined(PMC_GC) // memory for globals #define BAMBOO_GLOBAL_DEFS_SIZE (1024 * 1024) #define BAMBOO_GLOBAL_DEFS_PRIM_SIZE (1024 * 512) diff --git a/Robust/src/Runtime/bamboo/multicoremsg.c b/Robust/src/Runtime/bamboo/multicoremsg.c index 0a54e09d..15c1ee8c 100644 --- a/Robust/src/Runtime/bamboo/multicoremsg.c +++ b/Robust/src/Runtime/bamboo/multicoremsg.c @@ -4,9 +4,11 @@ #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 int msgsizearray[] = { 0, //MSGSTART, @@ -72,12 +74,12 @@ 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)) @@ -154,7 +156,7 @@ void processmsg_transtall_I() { } } -#ifndef MULTICORE_GC +#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 diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index 827b23ec..c1666d64 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -389,7 +389,7 @@ void CALL01(___System______printString____L___String___, struct ___String___ * _ /* Object allocation function */ -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) void * allocate_new(void * ptr, int type) { struct ___Object___ * v= @@ -463,7 +463,7 @@ struct ArrayObject * allocate_newarray(int type, #endif /* Converts C character arrays into Java strings */ -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) __attribute__((malloc)) struct ___String___ * NewStringShort(void * ptr, const short *str, int length) { @@ -472,7 +472,7 @@ __attribute__((malloc)) struct ___String___ * NewStringShort(const short *str, int length) { #endif int i; -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) struct ArrayObject * chararray= allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length); INTPTR ptrarray[]={1, (INTPTR) ptr, (INTPTR) chararray}; @@ -494,7 +494,7 @@ __attribute__((malloc)) struct ___String___ * NewStringShort(const short *str, } /* Converts C character arrays into Java strings */ -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) struct ___String___ * NewString(void * ptr, const char *str, int length) { @@ -503,7 +503,7 @@ struct ___String___ * NewString(const char *str, int length) { #endif int i; -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) struct ArrayObject * chararray= allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length); int ptrarray[]={1, (int) ptr, (int) chararray}; @@ -549,7 +549,7 @@ h %u\n", num, index, ao, ao->___length___); /* Generated code calls this if we fail null ptr chk */ void failednullptr(void * ptr) { -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) #ifndef RAW //print out current stack int i,j; diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.h b/Robust/src/Runtime/bamboo/multicoreruntime.h index d543c32f..7b107b6f 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.h +++ b/Robust/src/Runtime/bamboo/multicoreruntime.h @@ -12,7 +12,7 @@ //Define the following line if the base object type has pointers //#define OBJECTHASPOINTERS -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) extern volatile bool gcflag; #define GCCHECK(p) \ if(gcflag) gc(p) diff --git a/Robust/src/Runtime/bamboo/pmc_garbage.c b/Robust/src/Runtime/bamboo/pmc_garbage.c index 65264f27..c37d610b 100644 --- a/Robust/src/Runtime/bamboo/pmc_garbage.c +++ b/Robust/src/Runtime/bamboo/pmc_garbage.c @@ -2,6 +2,7 @@ #include "pmc_garbage.h" #include "runtime_arch.h" +struct pmc_heap * pmc_heapptr; struct pmc_queue * pmc_localqueue; void incrementthreads() { diff --git a/Robust/src/Runtime/mem.c b/Robust/src/Runtime/mem.c index ef3a0a6c..d33a6752 100644 --- a/Robust/src/Runtime/mem.c +++ b/Robust/src/Runtime/mem.c @@ -4,14 +4,19 @@ #include "runtime.h" #include -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) #include "multicoreruntime.h" #include "bambooalign.h" -#include "multicoremem.h" -#include "multicoregarbage.h" #include "runtime_arch.h" #include "methodheaders.h" +#endif + +#ifdef MULTICORE_GC +#include "multicoremem.h" +#include "multicoregarbage.h" +#endif +#if defined(MULTICORE_GC)||defined(PMC_GC) extern volatile bool gcflag; void * mycalloc_share(struct garbagelist * stackptr, int size) { void * p = NULL; diff --git a/Robust/src/Runtime/mem.h b/Robust/src/Runtime/mem.h index 08f0da54..a2ae634c 100644 --- a/Robust/src/Runtime/mem.h +++ b/Robust/src/Runtime/mem.h @@ -35,7 +35,7 @@ void myfree_i(void * ptr); #define RUNFREE(x) myfree(x) #define RUNFREE_I(x) myfree_i(x) -#ifdef MULTICORE_GC +#if defined(MULTICORE_GC)||defined(PMC_GC) #include "multicoregc.h" void * mycalloc_share(struct garbagelist * stackptr, int size); void * mycalloc_share_ngc(int size); diff --git a/Robust/src/Runtime/runtime.h b/Robust/src/Runtime/runtime.h index 0b0ed937..de90cadd 100644 --- a/Robust/src/Runtime/runtime.h +++ b/Robust/src/Runtime/runtime.h @@ -83,7 +83,7 @@ __attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, __attribute__((malloc)) StringPtr NewString(void *, const char *str,int length); __attribute__((malloc)) StringPtr NewStringShort(void *, const short *str,int length); __attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(void *ptr, int index); -#elif defined MULTICORE_GC +#elif defined(MULTICORE_GC)||defined(PMC_GC) __attribute__((malloc)) void * allocate_new(void *, int type); __attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, int length); __attribute__((malloc)) StringPtr NewString(void *, const char *str,int length); @@ -110,7 +110,7 @@ void createstartupobject(int argc, char ** argv); void createstartupobject(); #endif -#if defined(PRECISE_GC)||defined(MULTICORE_GC) +#if defined(PRECISE_GC)||defined(MULTICORE_GC)||defined(PMC_GC) #define VAR(name) ___params___->name #define CALL00(name) name(struct name ## _params * ___params___) #define CALL01(name, alt) name(struct name ## _params * ___params___) -- 2.34.1