< prev index next >
./b31893aea883.export
Print this page
*** 121,132 ****
// apply to TLAB allocation, which is not part of this interface: it
// is done by clients of this interface.)
-// Notes on implementation of parallelism in different tasks.
-//
! -// G1ParVerifyTask uses heap_region_par_iterate() for parallelism.
! -// The number of GC workers is passed to heap_region_par_iterate().
-// It does use run_task() which sets _n_workers in the task.
-// G1ParTask executes g1_process_roots() ->
-// SharedHeap::process_roots() which calls eventually to
-// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
-// SequentialSubTasksDone. SharedHeap::process_roots() also
--- 121,132 ----
// apply to TLAB allocation, which is not part of this interface: it
// is done by clients of this interface.)
-// Notes on implementation of parallelism in different tasks.
-//
! -// G1ParVerifyTask uses heap_region_par_iterate_chunked() for parallelism.
! -// The number of GC workers is passed to heap_region_par_iterate_chunked().
-// It does use run_task() which sets _n_workers in the task.
-// G1ParTask executes g1_process_roots() ->
-// SharedHeap::process_roots() which calls eventually to
-// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
-// SequentialSubTasksDone. SharedHeap::process_roots() also
*** 334,344 ****
-
-void
-G1CollectedHeap::
-g1_process_roots(OopClosure* scan_non_heap_roots,
- OopClosure* scan_non_heap_weak_roots,
! - G1ParPushHeapRSClosure* scan_rs,
- CLDClosure* scan_strong_clds,
- CLDClosure* scan_weak_clds,
- CodeBlobClosure* scan_strong_code,
- uint worker_i) {
-
--- 334,344 ----
-
-void
-G1CollectedHeap::
-g1_process_roots(OopClosure* scan_non_heap_roots,
- OopClosure* scan_non_heap_weak_roots,
! - OopsInHeapRegionClosure* scan_rs,
- CLDClosure* scan_strong_clds,
- CLDClosure* scan_weak_clds,
- CodeBlobClosure* scan_strong_code,
- uint worker_i) {
-
*** 457,467 ****
- // param is for use with parallel roots processing, and should be
- // the "i" of the calling parallel worker thread's work(i) function.
- // In the sequential case this param will be ignored.
- void g1_process_roots(OopClosure* scan_non_heap_roots,
- OopClosure* scan_non_heap_weak_roots,
! - G1ParPushHeapRSClosure* scan_rs,
- CLDClosure* scan_strong_clds,
- CLDClosure* scan_weak_clds,
- CodeBlobClosure* scan_strong_code,
- uint worker_i);
-
--- 457,467 ----
- // param is for use with parallel roots processing, and should be
- // the "i" of the calling parallel worker thread's work(i) function.
- // In the sequential case this param will be ignored.
- void g1_process_roots(OopClosure* scan_non_heap_roots,
- OopClosure* scan_non_heap_weak_roots,
! - OopsInHeapRegionClosure* scan_rs,
- CLDClosure* scan_strong_clds,
- CLDClosure* scan_weak_clds,
- CodeBlobClosure* scan_strong_code,
- uint worker_i);
-
*** 601,616 ****
if (G1StringDedup::is_enabled()) {
G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
diff --git a/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
! @@ -79,7 +79,6 @@
_cards_scanned(NULL), _total_cards_scanned(0),
_prev_period_summary()
{
- _seq_task = new SubTasksDone(NumSeqTasks);
! _cset_rs_update_cl = NEW_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, n_workers(), mtGC);
for (uint i = 0; i < n_workers(); i++) {
_cset_rs_update_cl[i] = NULL;
@@ -90,7 +89,6 @@
}
--- 601,617 ----
if (G1StringDedup::is_enabled()) {
G1StringDedup::oops_do(&GenMarkSweep::adjust_pointer_closure);
diff --git a/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp
! @@ -79,8 +79,7 @@
_cards_scanned(NULL), _total_cards_scanned(0),
_prev_period_summary()
{
- _seq_task = new SubTasksDone(NumSeqTasks);
! guarantee(n_workers() > 0, "There should be some workers");
! _cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers(), mtGC);
for (uint i = 0; i < n_workers(); i++) {
_cset_rs_update_cl[i] = NULL;
@@ -90,7 +89,6 @@
}
*** 659,669 ****
+ *
+ */
+
+#include "precompiled.hpp"
+
! +#include "classfile/stringTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
--- 660,670 ----
+ *
+ */
+
+#include "precompiled.hpp"
+
! +#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "code/codeCache.hpp"
+#include "gc_implementation/g1/bufferingOopClosure.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
*** 752,762 ****
+
+G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
+ _g1h(g1h),
+ _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
+ _srs(g1h),
! + _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
+ _n_workers_discovered_strong_classes(0) {}
+
+void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
+ OopClosure* scan_non_heap_weak_roots,
+ CLDClosure* scan_strong_clds,
--- 753,763 ----
+
+G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) :
+ _g1h(g1h),
+ _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)),
+ _srs(g1h),
! + _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false),
+ _n_workers_discovered_strong_classes(0) {}
+
+void G1RootProcessor::evacuate_roots(OopClosure* scan_non_heap_roots,
+ OopClosure* scan_non_heap_weak_roots,
+ CLDClosure* scan_strong_clds,
*** 1271,1283 ****
+ &mark_code_closure);
if (younger_gens_as_roots) {
- if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+ if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
! if (level == 1) {
! not_older_gens->set_generation(_young_gen);
! _young_gen->oop_iterate(not_older_gens);
@@ -607,43 +721,18 @@
older_gens->reset_generation();
}
- _gen_process_roots_tasks->all_tasks_completed();
--- 1272,1285 ----
+ &mark_code_closure);
if (younger_gens_as_roots) {
- if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+ if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
! for (int i = 0; i < level; i++) {
! not_older_gens->set_generation(_gens[i]);
! _gens[i]->oop_iterate(not_older_gens);
!
@@ -607,43 +721,18 @@
older_gens->reset_generation();
}
- _gen_process_roots_tasks->all_tasks_completed();
*** 1322,1334 ****
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
- SharedHeap::process_weak_roots(root_closure);
- // "Local" "weak" refs
+ JNIHandles::weak_oops_do(&always_true, root_closure);
! _young_gen->ref_processor()->weak_oops_do(root_closure);
! _old_gen->ref_processor()->weak_oops_do(root_closure);
}
diff --git a/src/share/vm/memory/genCollectedHeap.hpp b/src/share/vm/memory/genCollectedHeap.hpp
--- a/src/share/vm/memory/genCollectedHeap.hpp
+++ b/src/share/vm/memory/genCollectedHeap.hpp
@@ -85,8 +85,7 @@
--- 1324,1337 ----
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
- SharedHeap::process_weak_roots(root_closure);
- // "Local" "weak" refs
+ JNIHandles::weak_oops_do(&always_true, root_closure);
! for (int i = 0; i < _n_gens; i++) {
! _gens[i]->ref_processor()->weak_oops_do(root_closure);
}
+
diff --git a/src/share/vm/memory/genCollectedHeap.hpp b/src/share/vm/memory/genCollectedHeap.hpp
--- a/src/share/vm/memory/genCollectedHeap.hpp
+++ b/src/share/vm/memory/genCollectedHeap.hpp
@@ -85,8 +85,7 @@
*** 1414,1424 ****
#include "runtime/java.hpp"
-#include "services/management.hpp"
#include "utilities/copy.hpp"
#include "utilities/workgroup.hpp"
! @@ -40,32 +39,12 @@
SharedHeap* SharedHeap::_sh;
-// The set of potentially parallel tasks in root scanning.
-enum SH_process_roots_tasks {
--- 1417,1427 ----
#include "runtime/java.hpp"
-#include "services/management.hpp"
#include "utilities/copy.hpp"
#include "utilities/workgroup.hpp"
! @@ -40,33 +39,13 @@
SharedHeap* SharedHeap::_sh;
-// The set of potentially parallel tasks in root scanning.
-enum SH_process_roots_tasks {
*** 1436,1456 ****
-};
-
SharedHeap::SharedHeap(CollectorPolicy* policy_) :
CollectedHeap(),
_collector_policy(policy_),
- _strong_roots_scope(NULL),
_strong_roots_parity(0),
- _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
_workers(NULL)
{
- if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
- vm_exit_during_initialization("Failed necessary allocation.");
- }
_sh = this; // ch is static, should be set only once.
! if (UseConcMarkSweepGC || UseG1GC) {
! _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads,
@@ -79,14 +58,6 @@
}
}
-int SharedHeap::n_termination() {
--- 1439,1460 ----
-};
-
SharedHeap::SharedHeap(CollectorPolicy* policy_) :
CollectedHeap(),
_collector_policy(policy_),
+ _rem_set(NULL),
- _strong_roots_scope(NULL),
_strong_roots_parity(0),
- _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
_workers(NULL)
{
- if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
- vm_exit_during_initialization("Failed necessary allocation.");
- }
_sh = this; // ch is static, should be set only once.
! if ((UseParNewGC ||
! (UseConcMarkSweepGC && (CMSParallelInitialMarkEnabled ||
@@ -79,14 +58,6 @@
}
}
-int SharedHeap::n_termination() {
*** 1515,1525 ****
- if (_active) {
- _sh->unregister_strong_roots_scope(this);
- }
-}
-
! -Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false, Monitor::_safepoint_check_never);
-
-void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
- // The Thread work barrier is only needed by G1 Class Unloading.
- // No need to use the barrier if this is single-threaded code.
- if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
--- 1519,1529 ----
- if (_active) {
- _sh->unregister_strong_roots_scope(this);
- }
-}
-
! -Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false);
-
-void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
- // The Thread work barrier is only needed by G1 Class Unloading.
- // No need to use the barrier if this is single-threaded code.
- if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
< prev index next >