comparison src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents 52b4284cb496 8ba0078861d4
children
comparison
equal deleted inserted replaced
20184:84105dcdb05b 20804:7848fc12602b
27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp" 27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp"
28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
29 #include "gc_implementation/g1/g1HotCardCache.hpp" 29 #include "gc_implementation/g1/g1HotCardCache.hpp"
30 #include "runtime/java.hpp" 30 #include "runtime/java.hpp"
31 31
32 ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) : 32 ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h, CardTableEntryClosure* refine_closure) :
33 _threads(NULL), _n_threads(0), 33 _threads(NULL), _n_threads(0),
34 _hot_card_cache(g1h) 34 _hot_card_cache(g1h)
35 { 35 {
36 // Ergomonically select initial concurrent refinement parameters 36 // Ergomonically select initial concurrent refinement parameters
37 if (FLAG_IS_DEFAULT(G1ConcRefinementGreenZone)) { 37 if (FLAG_IS_DEFAULT(G1ConcRefinementGreenZone)) {
59 59
60 uint worker_id_offset = DirtyCardQueueSet::num_par_ids(); 60 uint worker_id_offset = DirtyCardQueueSet::num_par_ids();
61 61
62 ConcurrentG1RefineThread *next = NULL; 62 ConcurrentG1RefineThread *next = NULL;
63 for (uint i = _n_threads - 1; i != UINT_MAX; i--) { 63 for (uint i = _n_threads - 1; i != UINT_MAX; i--) {
64 ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); 64 ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, refine_closure, worker_id_offset, i);
65 assert(t != NULL, "Conc refine should have been created"); 65 assert(t != NULL, "Conc refine should have been created");
66 if (t->osthread() == NULL) { 66 if (t->osthread() == NULL) {
67 vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread"); 67 vm_shutdown_during_initialization("Could not create ConcurrentG1RefineThread");
68 } 68 }
69 69
79 } else { 79 } else {
80 _thread_threshold_step = G1ConcRefinementThresholdStep; 80 _thread_threshold_step = G1ConcRefinementThresholdStep;
81 } 81 }
82 } 82 }
83 83
84 void ConcurrentG1Refine::init() { 84 void ConcurrentG1Refine::init(G1RegionToSpaceMapper* card_counts_storage) {
85 _hot_card_cache.initialize(); 85 _hot_card_cache.initialize(card_counts_storage);
86 } 86 }
87 87
88 void ConcurrentG1Refine::stop() { 88 void ConcurrentG1Refine::stop() {
89 if (_threads != NULL) { 89 if (_threads != NULL) {
90 for (uint i = 0; i < _n_threads; i++) { 90 for (uint i = 0; i < _n_threads; i++) {
126 } 126 }
127 } 127 }
128 } 128 }
129 129
130 uint ConcurrentG1Refine::thread_num() { 130 uint ConcurrentG1Refine::thread_num() {
131 uint n_threads = (G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads 131 return G1ConcRefinementThreads;
132 : ParallelGCThreads;
133 return MAX2<uint>(n_threads, 1);
134 } 132 }
135 133
136 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { 134 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const {
137 for (uint i = 0; i < _n_threads; ++i) { 135 for (uint i = 0; i < _n_threads; ++i) {
138 _threads[i]->print_on(st); 136 _threads[i]->print_on(st);