comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 1974:fd1d227ef1b9

6983204: G1: Nightly test nsk/regression/b4958615 failing with +ExplicitGCInvokesConcurrent Summary: Enable reference discovery during concurrent marking by setting the reference processor field of the concurrent marking closure. Keep reference objects on the discovered reference lists alive during incremental evacuation pauses until they are processed at the end of concurrent marking. Reviewed-by: ysr, tonyp
author johnc
date Wed, 01 Dec 2010 17:34:02 -0800
parents f95d63e2154a
children b03260081e9b
comparison
equal deleted inserted replaced
1973:631f79e71e90 1974:fd1d227ef1b9
1049 1049
1050 public: 1050 public:
1051 void work(int worker_i) { 1051 void work(int worker_i) {
1052 assert(Thread::current()->is_ConcurrentGC_thread(), 1052 assert(Thread::current()->is_ConcurrentGC_thread(),
1053 "this should only be done by a conc GC thread"); 1053 "this should only be done by a conc GC thread");
1054 ResourceMark rm;
1054 1055
1055 double start_vtime = os::elapsedVTime(); 1056 double start_vtime = os::elapsedVTime();
1056 1057
1057 ConcurrentGCThread::stsJoin(); 1058 ConcurrentGCThread::stsJoin();
1058 1059
1886 ResourceMark rm; 1887 ResourceMark rm;
1887 HandleMark hm; 1888 HandleMark hm;
1888 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 1889 G1CollectedHeap* g1h = G1CollectedHeap::heap();
1889 ReferenceProcessor* rp = g1h->ref_processor(); 1890 ReferenceProcessor* rp = g1h->ref_processor();
1890 1891
1892 // See the comment in G1CollectedHeap::ref_processing_init()
1893 // about how reference processing currently works in G1.
1894
1891 // Process weak references. 1895 // Process weak references.
1892 rp->setup_policy(clear_all_soft_refs); 1896 rp->setup_policy(clear_all_soft_refs);
1893 assert(_markStack.isEmpty(), "mark stack should be empty"); 1897 assert(_markStack.isEmpty(), "mark stack should be empty");
1894 1898
1895 G1CMIsAliveClosure g1IsAliveClosure (g1h); 1899 G1CMIsAliveClosure g1IsAliveClosure (g1h);
2916 } 2920 }
2917 2921
2918 CMOopClosure(G1CollectedHeap* g1h, 2922 CMOopClosure(G1CollectedHeap* g1h,
2919 ConcurrentMark* cm, 2923 ConcurrentMark* cm,
2920 CMTask* task) 2924 CMTask* task)
2921 : _g1h(g1h), _cm(cm), _task(task) { } 2925 : _g1h(g1h), _cm(cm), _task(task)
2926 {
2927 _ref_processor = g1h->ref_processor();
2928 assert(_ref_processor != NULL, "should not be NULL");
2929 }
2922 }; 2930 };
2923 2931
2924 void CMTask::setup_for_region(HeapRegion* hr) { 2932 void CMTask::setup_for_region(HeapRegion* hr) {
2925 // Separated the asserts so that we know which one fires. 2933 // Separated the asserts so that we know which one fires.
2926 assert(hr != NULL, 2934 assert(hr != NULL,