// adapt the cache strategy for the mutator
void cacheAdapt_mutator() {
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
BAMBOO_CACHE_MF();
// check the changes and adapt them
unsigned int * tmp_p = gccachepolicytbl;
send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE);
GC_PRINTF("Finish prefinish phase\n");
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl
cacheAdapt_gc(false);
GC_CHECK_ALL_CORE_STATUS();
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
CACHEADAPT_SAMPLING_RESET();
if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
// zero out the gccachesamplingtbl
void gc_output_cache_sampling();
void gc_output_cache_sampling_r();
-#if defined(GC_CACHE_SAMPLING)&&defined(GC_CACHE_ADAPT_POLICY4)
+#if defined(GC_CACHE_SAMPLING)&&(defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
// enable the timer interrupt
#define CACHEADAPT_ENABLE_TIMER() \
{ \
#define CACHEADAPT_SAMPLING_RESET()
#endif
-#if defined(GC_CACHE_ADAPT_POLICY4)
+#if (defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
#define CACHEADAPT_FINISH_SRC_PAGE(a,b,c) cacheadapt_finish_src_page(a,b,c);
#define CACHEADAPT_FINISH_DST_PAGE(a,b,c,d) cacheadapt_finish_dst_page(a,b,c,d);
#define CACHEADAPT_FINISH_COMPACT(a) cacheadapt_finish_compact(a);
CACHEADAPT_GC(true);
//tprintf("Check core status \n");
GC_CHECK_ALL_CORE_STATUS();
- GCPROFILE_ITEM_MASTER();
unsigned long long tmpt = BAMBOO_GET_EXE_TIME();
CACHEADAPT_OUTPUT_CACHE_SAMPLING();
gc_output_cache_policy_time += (BAMBOO_GET_EXE_TIME()-tmpt);
//tprintf("start mark phase\n");
// do mark phase
+ GCPROFILE_ITEM_MASTER();
master_mark(stackptr);
GCPROFILE_ITEM_MASTER();
//tprintf("finish mark phase\n");
}
void pregcprocessing() {
-#if defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&defined(GC_CACHE_ADAPT_POLICY4)
+#if defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&(defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
// disable the timer interrupt
bamboo_mask_timer_intr();
// get the sampling data
}
void postgcprocessing() {
-#if defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&defined(GC_CACHE_ADAPT_POLICY4)
+#if defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&(defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
// enable the timer interrupt
bamboo_tile_timer_set_next_event(GC_TILE_TIMER_EVENT_SETTING);
bamboo_unmask_timer_intr();
// core coordinator routine
if(0 == BAMBOO_NUM_OF_CORE) {
+ GC_PRINTF("start gc! \n");
+ GCPROFILE_START_MASTER();
+
GC_PRINTF("Check if we can do gc or not\n");
gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
pregcprocessing();
;
//pregccheck();
- GCPROFILE_START_MASTER();
- GC_PRINTF("start gc! \n");
gc_master(stackptr);
} else if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) {
GC_PRINTF("Core reporting for gc.\n");
void processmsg_terminate_I() {
disruntimedata();
-#if defined(MULTICORE_GC)&&defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&defined(GC_CACHE_ADAPT_POLICY4)
+#if defined(MULTICORE_GC)&&defined(GC_CACHE_ADAPT)&&defined(GC_CACHE_SAMPLING)&&(defined(GC_CACHE_ADAPT_POLICY4)||defined(GC_CACHE_ADAPT_POLICY3))
bamboo_mask_timer_intr(); // disable the TILE_TIMER interrupt
#endif
BAMBOO_EXIT_APP(0);