Exemple #1
0
void gc_set_gen_mode(Boolean status)
{
  if(status){
    gc_set_gen_flag(); 
    gc_set_barrier_function(WB_REM_SOURCE_REF);
  }else{
    gc_clear_gen_flag();
    gc_set_barrier_function(WB_REM_NIL);
  }
 
  HelperClass_set_GenMode(status);   
}
Exemple #2
0
/*  gc start marking phase */
void gc_start_con_marking(GC *gc) 
{
  unsigned int num_marker;
  num_marker = gc_get_marker_number(gc);

  if(gc_is_kind(ALGO_CON_OTF_OBJ)) {
    gc_enable_alloc_obj_live(gc);
    gc_set_barrier_function(WB_REM_OBJ_SNAPSHOT);
    gc_ms_start_con_mark((GC_MS*)gc, num_marker);
  } else if(gc_is_kind(ALGO_CON_MOSTLY)) {
    gc_set_barrier_function(WB_REM_SOURCE_OBJ);
    gc_ms_start_mostly_con_mark((GC_MS*)gc, num_marker);
  } else if(gc_is_kind(ALGO_CON_OTF_REF)) {
    gc_enable_alloc_obj_live(gc);
    gc_set_barrier_function(WB_REM_OLD_VAR);
    gc_ms_start_con_mark((GC_MS*)gc, num_marker);
  }
}
Exemple #3
0
void wspace_last_otf_marker_work( Conclctor *last_marker ) {
  GC *gc = last_marker->gc;
  
  gc_reset_dirty_set(gc);
  gc_set_barrier_function(WB_REM_NIL);
  
  //INFO2("gc.con.info", "<stage 6>all markers finish ");
  gc_con_update_stat_after_marking(gc); //calculate marked size

  gc_clear_rootset(gc);

  gc_prepare_sweeping(gc);
  state_transformation( gc, GC_CON_TRACE_DONE, GC_CON_BEFORE_SWEEP );
}
Exemple #4
0
static unsigned int gc_con_heap_full_mostly_con( GC *gc )
{
   while( gc->gc_concurrent_status == GC_CON_START_MARKERS ) { // we should enumerate rootset after old rootset is traced
      vm_thread_yield();
   }

   int64 final_start = time_now();
   int disable_count = hythread_reset_suspend_disable();
   gc_set_rootset_type(ROOTSET_IS_OBJ);
   gc_prepare_rootset(gc);
  
   gc_set_barrier_function(WB_REM_NIL); //in stw phase, so we can remove write barrier at any time
   terminate_mostly_con_mark(); // terminate current mostly concurrent marking

   //in the stop the world phase (only conclctors is running at the moment), so the spin lock will not lose more performance
   while(gc->gc_concurrent_status == GC_CON_TRACING) {
      vm_thread_yield(); //let the unfinished marker run
   }

   //final marking phase
   gc_clear_conclctor_role(gc);
   wspace_mostly_con_final_mark(gc);

   /*just debugging*/
   int64 final_time = time_now() - final_start;
   INFO2("gc.scheduler", "[MOSTLY_CON] final marking time=" << final_time << " us");
   gc_ms_get_current_heap_usage((GC_MS *)gc);
  
  // start STW reclaiming heap
   gc_con_update_stat_heap_exhausted(gc); // calculate util rate
   gc_reset_mutator_context(gc);
   if(!IGNORE_FINREF ) gc_set_obj_with_fin(gc);
   gc_ms_reclaim_heap((GC_MS*)gc);
  
   // reset after partial stop the world collection
   gc_reset_after_con_collection(gc);
   set_con_nil(gc);
  
   vm_resume_threads_after();
   hythread_set_suspend_disable(disable_count);
   return GC_PARTIAL_PMSS;
   
}