src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp

Print this page
rev 6805 : imported patch commit-uncommit-within-heap


  64     ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, refine_closure, worker_id_offset, i);
  65     assert(t != NULL, "Conc refine should have been created");
  66     if (t->osthread() == NULL) {
  67         vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread");
  68     }
  69 
  70     assert(t->cg1r() == this, "Conc refine thread should refer to this");
  71     _threads[i] = t;
  72     next = t;
  73   }
  74 }
  75 
  76 void ConcurrentG1Refine::reset_threshold_step() {
  77   if (FLAG_IS_DEFAULT(G1ConcRefinementThresholdStep)) {
  78     _thread_threshold_step = (yellow_zone() - green_zone()) / (worker_thread_num() + 1);
  79   } else {
  80     _thread_threshold_step = G1ConcRefinementThresholdStep;
  81   }
  82 }
  83 
  84 void ConcurrentG1Refine::init() {
  85   _hot_card_cache.initialize();
  86 }
  87 
  88 void ConcurrentG1Refine::stop() {
  89   if (_threads != NULL) {
  90     for (uint i = 0; i < _n_threads; i++) {
  91       _threads[i]->stop();
  92     }
  93   }
  94 }
  95 
  96 void ConcurrentG1Refine::reinitialize_threads() {
  97   reset_threshold_step();
  98   if (_threads != NULL) {
  99     for (uint i = 0; i < _n_threads; i++) {
 100       _threads[i]->initialize();
 101     }
 102   }
 103 }
 104 
 105 ConcurrentG1Refine::~ConcurrentG1Refine() {




  64     ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, refine_closure, worker_id_offset, i);
  65     assert(t != NULL, "Conc refine should have been created");
  66     if (t->osthread() == NULL) {
  67         vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread");
  68     }
  69 
  70     assert(t->cg1r() == this, "Conc refine thread should refer to this");
  71     _threads[i] = t;
  72     next = t;
  73   }
  74 }
  75 
  76 void ConcurrentG1Refine::reset_threshold_step() {
  77   if (FLAG_IS_DEFAULT(G1ConcRefinementThresholdStep)) {
  78     _thread_threshold_step = (yellow_zone() - green_zone()) / (worker_thread_num() + 1);
  79   } else {
  80     _thread_threshold_step = G1ConcRefinementThresholdStep;
  81   }
  82 }
  83 
  84 void ConcurrentG1Refine::init(G1RegionToSpaceMapper* card_counts_storage) {
  85   _hot_card_cache.initialize(card_counts_storage);
  86 }
  87 
  88 void ConcurrentG1Refine::stop() {
  89   if (_threads != NULL) {
  90     for (uint i = 0; i < _n_threads; i++) {
  91       _threads[i]->stop();
  92     }
  93   }
  94 }
  95 
  96 void ConcurrentG1Refine::reinitialize_threads() {
  97   reset_threshold_step();
  98   if (_threads != NULL) {
  99     for (uint i = 0; i < _n_threads; i++) {
 100       _threads[i]->initialize();
 101     }
 102   }
 103 }
 104 
 105 ConcurrentG1Refine::~ConcurrentG1Refine() {