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
-#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"
#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"
BAMBOO_EXIT_APP(0);
}
+#ifndef PMC_GC
void processmsg_memrequest_I() {
int data1 = msgdata[msgdataindex];
MSG_INDEXINC_I();
}
#endif
}
+#endif //ifndef PMCGC
+
#ifdef MULTICORE_GC
void processmsg_gcinvoke_I() {
processmsg_terminate_I();
break;
}
-
+#ifndef PMC_GC
case MEMREQUEST: {
processmsg_memrequest_I();
break;
processmsg_memresponse_I();
break;
}
-
+#endif
#ifdef MULTICORE_GC
// GC msgs
case GCINVOKE: {
#include "multicoreruntime.h"
#include "methodheaders.h"
#include "multicoregarbage.h"
+#ifdef PMC_GC
+#include "multicoregcprofile.h"
+#endif
#include "multicore_arch.h"
#include <stdio.h>
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);
#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);
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;
+ }
+}
#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));