< prev index next >
src/share/vm/gc/g1/g1RootProcessor.cpp
Print this page
rev 9080 : imported patch move-code
rev 9081 : imported patch rootclosureset
rev 9082 : imported patch cm_refproc_w_oops_do
rev 9083 : imported patch erik-review
*** 31,41 ****
#include "gc/g1/g1CodeBlobClosure.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
! #include "gc/g1/g1RootClosureSet.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/mutex.hpp"
--- 31,41 ----
#include "gc/g1/g1CodeBlobClosure.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
! #include "gc/g1/g1RootClosures.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/mutex.hpp"
*** 68,78 ****
_process_strong_tasks(G1RP_PS_NumElements),
_srs(n_workers),
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
_n_workers_discovered_strong_classes(0) {}
! void G1RootProcessor::evacuate_roots(G1EvacuationRootClosureSet* closures, bool trace_metadata, uint worker_i) {
double ext_roots_start = os::elapsedTime();
G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
process_java_roots(closures, phase_times, worker_i);
--- 68,78 ----
_process_strong_tasks(G1RP_PS_NumElements),
_srs(n_workers),
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
_n_workers_discovered_strong_classes(0) {}
! void G1RootProcessor::evacuate_roots(G1EvacuationRootClosures* closures, bool trace_metadata, uint worker_i) {
double ext_roots_start = os::elapsedTime();
G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
process_java_roots(closures, phase_times, worker_i);
*** 90,100 ****
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
// We need to treat the discovered reference lists of the
// concurrent mark ref processor as roots and keep entries
// (which are added by the marking threads) on them live
// until they can be processed at the end of marking.
! _g1h->ref_processor_cm()->weak_oops_do(closures->weak_oops());
}
}
if (trace_metadata) {
{
--- 90,100 ----
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_refProcessor_oops_do)) {
// We need to treat the discovered reference lists of the
// concurrent mark ref processor as roots and keep entries
// (which are added by the marking threads) on them live
// until they can be processed at the end of marking.
! _g1h->ref_processor_cm()->weak_oops_do(closures->strong_oops());
}
}
if (trace_metadata) {
{
*** 104,119 ****
wait_until_all_strong_classes_discovered();
}
// Now take the complement of the strong CLDs.
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
! assert(closures->second_pass_weak_clds() != NULL, "should be null");
ClassLoaderDataGraph::roots_cld_do(NULL, closures->second_pass_weak_clds());
} else {
phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
! assert(closures->second_pass_weak_clds() == NULL, "should not null");
}
// Finish up any enqueued closure apps (attributed as object copy time).
closures->flush();
--- 104,119 ----
wait_until_all_strong_classes_discovered();
}
// Now take the complement of the strong CLDs.
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::WeakCLDRoots, worker_i);
! assert(closures->second_pass_weak_clds() != NULL, "Should be non-null if we are tracing metadata.");
ClassLoaderDataGraph::roots_cld_do(NULL, closures->second_pass_weak_clds());
} else {
phase_times->record_time_secs(G1GCPhaseTimes::WaitForStrongCLD, worker_i, 0.0);
phase_times->record_time_secs(G1GCPhaseTimes::WeakCLDRoots, worker_i, 0.0);
! assert(closures->second_pass_weak_clds() == NULL, "Should be null if not tracing metadata.");
}
// Finish up any enqueued closure apps (attributed as object copy time).
closures->flush();
*** 137,147 ****
_process_strong_tasks.all_tasks_completed(n_workers());
}
// Adaptor to pass the closures to the strong roots in the VM.
! class StrongRootsClosures : public G1RootClosureSet {
OopClosure* _roots;
CLDClosure* _clds;
CodeBlobClosure* _blobs;
public:
StrongRootsClosures(OopClosure* roots, CLDClosure* clds, CodeBlobClosure* blobs) :
--- 137,147 ----
_process_strong_tasks.all_tasks_completed(n_workers());
}
// Adaptor to pass the closures to the strong roots in the VM.
! class StrongRootsClosures : public G1RootClosures {
OopClosure* _roots;
CLDClosure* _clds;
CodeBlobClosure* _blobs;
public:
StrongRootsClosures(OopClosure* roots, CLDClosure* clds, CodeBlobClosure* blobs) :
*** 170,180 ****
_process_strong_tasks.all_tasks_completed(n_workers());
}
// Adaptor to pass the closures to all the roots in the VM.
! class AllRootsClosures : public G1RootClosureSet {
OopClosure* _roots;
CLDClosure* _clds;
CodeBlobClosure* _blobs;
public:
AllRootsClosures(OopClosure* roots, CLDClosure* clds, CodeBlobClosure* blobs) :
--- 170,180 ----
_process_strong_tasks.all_tasks_completed(n_workers());
}
// Adaptor to pass the closures to all the roots in the VM.
! class AllRootsClosures : public G1RootClosures {
OopClosure* _roots;
CLDClosure* _clds;
CodeBlobClosure* _blobs;
public:
AllRootsClosures(OopClosure* roots, CLDClosure* clds, CodeBlobClosure* blobs) :
*** 202,212 ****
process_vm_roots(&closures, NULL, 0);
_process_strong_tasks.all_tasks_completed(n_workers());
}
! void G1RootProcessor::process_java_roots(G1RootClosureSet* closures,
G1GCPhaseTimes* phase_times,
uint worker_i) {
assert(closures->thread_root_clds() == NULL || closures->weak_clds() == NULL, "There is overlap between those, only one may be set");
// Iterating over the CLDG and the Threads are done early to allow us to
// first process the strong CLDs and nmethods and then, after a barrier,
--- 202,212 ----
process_vm_roots(&closures, NULL, 0);
_process_strong_tasks.all_tasks_completed(n_workers());
}
! void G1RootProcessor::process_java_roots(G1RootClosures* closures,
G1GCPhaseTimes* phase_times,
uint worker_i) {
assert(closures->thread_root_clds() == NULL || closures->weak_clds() == NULL, "There is overlap between those, only one may be set");
// Iterating over the CLDG and the Threads are done early to allow us to
// first process the strong CLDs and nmethods and then, after a barrier,
*** 226,236 ****
closures->thread_root_clds(),
closures->thread_root_codeblobs());
}
}
! void G1RootProcessor::process_vm_roots(G1RootClosureSet* closures,
G1GCPhaseTimes* phase_times,
uint worker_i) {
OopClosure* strong_roots = closures->strong_oops();
OopClosure* weak_roots = closures->weak_oops();
--- 226,236 ----
closures->thread_root_clds(),
closures->thread_root_codeblobs());
}
}
! void G1RootProcessor::process_vm_roots(G1RootClosures* closures,
G1GCPhaseTimes* phase_times,
uint worker_i) {
OopClosure* strong_roots = closures->strong_oops();
OopClosure* weak_roots = closures->weak_oops();
< prev index next >