--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-08-13 12:34:11.974173165 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-08-13 12:34:11.893170762 +0200 @@ -4469,10 +4469,10 @@ uint _n_workers; public: - G1ParTask(G1CollectedHeap* g1h, G1ParScanThreadState** pss, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor, uint n_workers) + G1ParTask(G1CollectedHeap* g1h, G1ParScanThreadState** per_thread_states, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor, uint n_workers) : AbstractGangTask("G1 collection"), _g1h(g1h), - _pss(pss), + _pss(per_thread_states), _queues(task_queues), _root_processor(root_processor), _terminator(n_workers, _queues), @@ -4576,6 +4576,7 @@ weak_cld_cl = &scan_only_cld_cl; } + double start_strong_roots_sec = os::elapsedTime(); _root_processor->evacuate_roots(strong_root_cl, weak_root_cl, strong_cld_cl, @@ -4584,7 +4585,6 @@ worker_id); G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, pss); - double start_strong_roots_sec = os::elapsedTime(); _root_processor->scan_remembered_sets(&push_heap_rs_cl, weak_root_cl, worker_id); @@ -5196,12 +5196,12 @@ public: G1STWRefProcTaskExecutor(G1CollectedHeap* g1h, - G1ParScanThreadState** pss, + G1ParScanThreadState** per_thread_states, FlexibleWorkGang* workers, RefToScanQueueSet *task_queues, uint n_workers) : _g1h(g1h), - _pss(pss), + _pss(per_thread_states), _queues(task_queues), _workers(workers), _active_workers(n_workers) @@ -5227,13 +5227,13 @@ public: G1STWRefProcTaskProxy(ProcessTask& proc_task, G1CollectedHeap* g1h, - G1ParScanThreadState** pss, + G1ParScanThreadState** per_thread_states, RefToScanQueueSet *task_queues, ParallelTaskTerminator* terminator) : AbstractGangTask("Process reference objects in parallel"), _proc_task(proc_task), _g1h(g1h), - _pss(pss), + _pss(per_thread_states), _task_queues(task_queues), _terminator(terminator) {} @@ -5331,10 +5331,10 @@ uint _n_workers; public: - G1ParPreserveCMReferentsTask(G1CollectedHeap* g1h, G1ParScanThreadState** pss, int workers, RefToScanQueueSet *task_queues) : + G1ParPreserveCMReferentsTask(G1CollectedHeap* g1h, G1ParScanThreadState** per_thread_states, int workers, RefToScanQueueSet *task_queues) : AbstractGangTask("ParPreserveCMReferents"), _g1h(g1h), - _pss(pss), + _pss(per_thread_states), _queues(task_queues), _terminator(workers, _queues), _n_workers(workers) @@ -5405,7 +5405,7 @@ }; // Weak Reference processing during an evacuation pause (part 1). -void G1CollectedHeap::process_discovered_references(G1ParScanThreadState** pss_) { +void G1CollectedHeap::process_discovered_references(G1ParScanThreadState** per_thread_states) { double ref_proc_start = os::elapsedTime(); ReferenceProcessor* rp = _ref_processor_stw; @@ -5435,7 +5435,7 @@ uint no_of_gc_workers = workers()->active_workers(); G1ParPreserveCMReferentsTask keep_cm_referents(this, - pss_, + per_thread_states, no_of_gc_workers, _task_queues); @@ -5450,7 +5450,7 @@ // JNI refs. // Use only a single queue for this PSS. - G1ParScanThreadState* pss = pss_[0]; + G1ParScanThreadState* pss = per_thread_states[0]; pss->set_ref_processor(NULL); assert(pss->queue_is_empty(), "pre-condition"); @@ -5492,7 +5492,7 @@ assert(rp->num_q() == no_of_gc_workers, "sanity"); assert(no_of_gc_workers <= rp->max_num_q(), "sanity"); - G1STWRefProcTaskExecutor par_task_executor(this, pss_, workers(), _task_queues, no_of_gc_workers); + G1STWRefProcTaskExecutor par_task_executor(this, per_thread_states, workers(), _task_queues, no_of_gc_workers); stats = rp->process_discovered_references(&is_alive, &keep_alive, &drain_queue, @@ -5511,7 +5511,7 @@ } // Weak Reference processing during an evacuation pause (part 2). -void G1CollectedHeap::enqueue_discovered_references(G1ParScanThreadState** pss) { +void G1CollectedHeap::enqueue_discovered_references(G1ParScanThreadState** per_thread_states) { double ref_enq_start = os::elapsedTime(); ReferenceProcessor* rp = _ref_processor_stw; @@ -5530,7 +5530,7 @@ assert(rp->num_q() == n_workers, "sanity"); assert(n_workers <= rp->max_num_q(), "sanity"); - G1STWRefProcTaskExecutor par_task_executor(this, pss, workers(), _task_queues, n_workers); + G1STWRefProcTaskExecutor par_task_executor(this, per_thread_states, workers(), _task_queues, n_workers); rp->enqueue_discovered_references(&par_task_executor); } --- old/src/share/vm/gc/g1/g1CollectedHeap.hpp 2015-08-13 12:34:12.506188945 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.hpp 2015-08-13 12:34:12.427186602 +0200 @@ -584,11 +584,11 @@ // Process any reference objects discovered during // an incremental evacuation pause. - void process_discovered_references(G1ParScanThreadState** pss); + void process_discovered_references(G1ParScanThreadState** per_thread_states); // Enqueue any remaining discovered references // after processing. - void enqueue_discovered_references(G1ParScanThreadState** pss); + void enqueue_discovered_references(G1ParScanThreadState** per_thread_states); public: FlexibleWorkGang* workers() const { return _workers; } --- old/src/share/vm/gc/g1/g1OopClosures.hpp 2015-08-13 12:34:12.972202768 +0200 +++ new/src/share/vm/gc/g1/g1OopClosures.hpp 2015-08-13 12:34:12.891200366 +0200 @@ -61,7 +61,6 @@ bool apply_to_weak_ref_discovered_field() { return true; } void set_par_scan_thread_state(G1ParScanThreadState* par_scan_state); - void set_ref_processor(ReferenceProcessor* ref_processor) { _ref_processor = ref_processor; } }; class G1ParPushHeapRSClosure : public G1ParClosureSuper { @@ -82,6 +81,8 @@ template void do_oop_nv(T* p); virtual void do_oop(oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + + void set_ref_processor(ReferenceProcessor* ref_processor) { _ref_processor = ref_processor; } }; // Add back base class for metadata