code towards PMC compiling
authorbdemsky <bdemsky>
Thu, 7 Jul 2011 01:24:46 +0000 (01:24 +0000)
committerbdemsky <bdemsky>
Thu, 7 Jul 2011 01:24:46 +0000 (01:24 +0000)
Robust/src/Runtime/bamboo/multicoregarbage.h
Robust/src/Runtime/bamboo/multicoregc.h
Robust/src/Runtime/bamboo/multicoremem.h
Robust/src/Runtime/bamboo/multicoremsg.c
Robust/src/Runtime/bamboo/multicoreruntime.c
Robust/src/Runtime/bamboo/multicoreruntime.h
Robust/src/Runtime/bamboo/pmc_garbage.c
Robust/src/Runtime/mem.c
Robust/src/Runtime/mem.h
Robust/src/Runtime/runtime.h

index 3e2e218fd137b46010943b079f8b1c94e4cf143a..717169b09cf3a84dfbe431b4757b107efc2118e0 100644 (file)
@@ -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;
index f0f2c02ea872243b6c906b67bf659dbbbde88e09..be085b37a7affeda67143d184e4d0bd5e6ef36ad 100644 (file)
@@ -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
index ed3ffd1ed386dcb618b2e81d14a295bd71c68caf..4dc93afd74c118b5061643cb6fc672c904c6e0e0 100644 (file)
@@ -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)
index 0a54e09d675f4cd0579adbe919b23f6701c309d6..15c1ee8cffde0fb27475da0a67d040fe3a514057 100644 (file)
@@ -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
index 827b23ec02fba2226222f5dda39b10c172a877e8..c1666d64332ddf681449750455143c9b7b4332fd 100644 (file)
@@ -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;
index d543c32f931650d791b8243c74466accd6b530ad..7b107b6f6dde3d35b0b1e6c242f142c4e953420b 100644 (file)
@@ -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)
index 65264f27d2acb48aeab9851c5d7e490154782357..c37d610bf75906c95c2d7f5aad6f251f865a688a 100644 (file)
@@ -2,6 +2,7 @@
 #include "pmc_garbage.h"
 #include "runtime_arch.h"
 
+struct pmc_heap * pmc_heapptr;
 struct pmc_queue * pmc_localqueue;
 
 void incrementthreads() {
index ef3a0a6c9ccbd40dd085de3f9e3562c9ac44509b..d33a6752eec43ff5aed5001f18f0c585cf5790a7 100644 (file)
@@ -4,14 +4,19 @@
 #include "runtime.h"
 #include <stdio.h>
 
-#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;
index 08f0da5449e70883e59af5d9365a01cd178ad671..a2ae634c38a618c164c5044a0b2bab8910aefc52 100644 (file)
@@ -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);
index 0b0ed9378238a1a5aa03ef251d4d0a27b10d2253..de90cadd2efdb9451f303198aa6b1094d9e29afa 100644 (file)
@@ -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___)