< prev index next >
src/share/vm/gc/g1/g1CollectedHeap.cpp
Print this page
rev 13232 : imported patch parallel-fullgc-stefanj
rev 13237 : imported patch 8183226-periodic-rem-set-summary-accesses-uninitialized-stuff
rev 13238 : imported patch 8183226-eridk-sjohanss-review
rev 13240 : imported patch 8183128-cleanup-refinecardtableentryclosure
rev 13241 : imported patch 8183128-erikd-review
*** 93,124 ****
// and allocate_new_tlab, which are the "entry" points to the
// allocation code from the rest of the JVM. (Note that this does not
// apply to TLAB allocation, which is not part of this interface: it
// is done by clients of this interface.)
- // Local to this file.
-
- class RefineCardTableEntryClosure: public CardTableEntryClosure {
- bool _concurrent;
- public:
- RefineCardTableEntryClosure() : _concurrent(true) { }
-
- bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
- G1CollectedHeap::heap()->g1_rem_set()->refine_card_concurrently(card_ptr, worker_i);
-
- if (_concurrent && SuspendibleThreadSet::should_yield()) {
- // Caller will actually yield.
- return false;
- }
- // Otherwise, we finished successfully; return true.
- return true;
- }
-
- void set_concurrent(bool b) { _concurrent = b; }
- };
-
-
class RedirtyLoggedCardTableEntryClosure : public CardTableEntryClosure {
private:
size_t _num_dirtied;
G1CollectedHeap* _g1h;
G1SATBCardTableLoggingModRefBS* _g1_bs;
--- 93,102 ----
*** 1580,1590 ****
_bot(NULL),
_hot_card_cache(NULL),
_g1_rem_set(NULL),
_cg1r(NULL),
_g1mm(NULL),
- _refine_cte_cl(NULL),
_preserved_marks_set(true /* in_c_heap */),
_secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()),
_old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
_humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
_humongous_reclaim_candidates(),
--- 1558,1567 ----
*** 1659,1672 ****
return result;
}
jint G1CollectedHeap::initialize_concurrent_refinement() {
- _refine_cte_cl = new RefineCardTableEntryClosure();
-
jint ecode = JNI_OK;
! _cg1r = ConcurrentG1Refine::create(_refine_cte_cl, &ecode);
return ecode;
}
jint G1CollectedHeap::initialize() {
CollectedHeap::pre_initialize();
--- 1636,1647 ----
return result;
}
jint G1CollectedHeap::initialize_concurrent_refinement() {
jint ecode = JNI_OK;
! _cg1r = ConcurrentG1Refine::create(&ecode);
return ecode;
}
jint G1CollectedHeap::initialize() {
CollectedHeap::pre_initialize();
*** 1819,1839 ****
jint ecode = initialize_concurrent_refinement();
if (ecode != JNI_OK) {
return ecode;
}
! JavaThread::dirty_card_queue_set().initialize(_refine_cte_cl,
! DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
(int)concurrent_g1_refine()->yellow_zone(),
(int)concurrent_g1_refine()->red_zone(),
Shared_DirtyCardQ_lock,
NULL, // fl_owner
true); // init_free_ids
! dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code
! DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
-1, // never trigger processing
-1, // no limit on length
Shared_DirtyCardQ_lock,
&JavaThread::dirty_card_queue_set());
--- 1794,1812 ----
jint ecode = initialize_concurrent_refinement();
if (ecode != JNI_OK) {
return ecode;
}
! JavaThread::dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
(int)concurrent_g1_refine()->yellow_zone(),
(int)concurrent_g1_refine()->red_zone(),
Shared_DirtyCardQ_lock,
NULL, // fl_owner
true); // init_free_ids
! dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon,
DirtyCardQ_FL_lock,
-1, // never trigger processing
-1, // no limit on length
Shared_DirtyCardQ_lock,
&JavaThread::dirty_card_queue_set());
*** 2006,2016 ****
}
void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl, uint worker_i) {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
size_t n_completed_buffers = 0;
! while (dcqs.apply_closure_to_completed_buffer(cl, worker_i, 0, true)) {
n_completed_buffers++;
}
g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
dcqs.clear_n_completed_buffers();
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
--- 1979,1989 ----
}
void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl, uint worker_i) {
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
size_t n_completed_buffers = 0;
! while (dcqs.apply_closure_during_gc(cl, worker_i)) {
n_completed_buffers++;
}
g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
dcqs.clear_n_completed_buffers();
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
*** 5165,5178 ****
"inconsistent used_unlocked(), "
"value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
used_unlocked(), recalculate_used());
}
- void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) {
- _refine_cte_cl->set_concurrent(concurrent);
- }
-
bool G1CollectedHeap::is_in_closed_subset(const void* p) const {
HeapRegion* hr = heap_region_containing(p);
return hr->is_in(p);
}
--- 5138,5147 ----
< prev index next >