< prev index next >
src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
Print this page
rev 47675 : [mq]: 8149127-rename-concurrentrefine-a
rev 47676 : imported patch 8149127-rename-concurrentrefine-b
rev 47677 : [mq]: 8149127-rename-concurrentrefine-b-stefanj-review
*** 180,214 ****
"yellow: " SIZE_FORMAT ", "
"red: " SIZE_FORMAT ", "
"min yellow size: " SIZE_FORMAT,
green_zone, yellow_zone, red_zone, min_yellow_zone_size);
! G1ConcurrentRefine* cg1r = new G1ConcurrentRefine(green_zone,
yellow_zone,
red_zone,
min_yellow_zone_size);
! if (cg1r == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1ConcurrentRefine");
return NULL;
}
! cg1r->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(G1ConcurrentRefineThread*, cg1r->_n_worker_threads, mtGC);
! if (cg1r->_threads == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not allocate an array for G1ConcurrentRefineThread");
return NULL;
}
uint worker_id_offset = DirtyCardQueueSet::num_par_ids();
G1ConcurrentRefineThread *next = NULL;
! for (uint i = cg1r->_n_worker_threads - 1; i != UINT_MAX; i--) {
Thresholds thresholds = calc_thresholds(green_zone, yellow_zone, i);
G1ConcurrentRefineThread* t =
! new G1ConcurrentRefineThread(cg1r,
next,
worker_id_offset,
i,
activation_level(thresholds),
deactivation_level(thresholds));
--- 180,214 ----
"yellow: " SIZE_FORMAT ", "
"red: " SIZE_FORMAT ", "
"min yellow size: " SIZE_FORMAT,
green_zone, yellow_zone, red_zone, min_yellow_zone_size);
! G1ConcurrentRefine* cr = new G1ConcurrentRefine(green_zone,
yellow_zone,
red_zone,
min_yellow_zone_size);
! if (cr == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1ConcurrentRefine");
return NULL;
}
! cr->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(G1ConcurrentRefineThread*, cr->_n_worker_threads, mtGC);
! if (cr->_threads == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not allocate an array for G1ConcurrentRefineThread");
return NULL;
}
uint worker_id_offset = DirtyCardQueueSet::num_par_ids();
G1ConcurrentRefineThread *next = NULL;
! for (uint i = cr->_n_worker_threads - 1; i != UINT_MAX; i--) {
Thresholds thresholds = calc_thresholds(green_zone, yellow_zone, i);
G1ConcurrentRefineThread* t =
! new G1ConcurrentRefineThread(cr,
next,
worker_id_offset,
i,
activation_level(thresholds),
deactivation_level(thresholds));
*** 217,240 ****
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1ConcurrentRefineThread");
return NULL;
}
! assert(t->cg1r() == cg1r, "Conc refine thread should refer to this");
! cg1r->_threads[i] = t;
next = t;
}
! cg1r->_sample_thread = new G1YoungRemSetSamplingThread();
! if (cg1r->_sample_thread->osthread() == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread");
return NULL;
}
*ecode = JNI_OK;
! return cg1r;
}
void G1ConcurrentRefine::stop() {
for (uint i = 0; i < _n_worker_threads; i++) {
_threads[i]->stop();
--- 217,240 ----
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1ConcurrentRefineThread");
return NULL;
}
! assert(t->cr() == cr, "Conc refine thread should refer to this");
! cr->_threads[i] = t;
next = t;
}
! cr->_sample_thread = new G1YoungRemSetSamplingThread();
! if (cr->_sample_thread->osthread() == NULL) {
*ecode = JNI_ENOMEM;
vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread");
return NULL;
}
*ecode = JNI_OK;
! return cr;
}
void G1ConcurrentRefine::stop() {
for (uint i = 0; i < _n_worker_threads; i++) {
_threads[i]->stop();
< prev index next >