equal
deleted
inserted
replaced
30 #include "gc/shared/satbMarkQueue.hpp" |
30 #include "gc/shared/satbMarkQueue.hpp" |
31 #include "oops/oop.hpp" |
31 #include "oops/oop.hpp" |
32 #include "utilities/debug.hpp" |
32 #include "utilities/debug.hpp" |
33 #include "utilities/globalDefinitions.hpp" |
33 #include "utilities/globalDefinitions.hpp" |
34 |
34 |
35 G1SATBMarkQueueSet::G1SATBMarkQueueSet() : _g1h(NULL) {} |
35 G1SATBMarkQueueSet::G1SATBMarkQueueSet(BufferNode::Allocator* allocator) : |
36 |
36 SATBMarkQueueSet(allocator) |
37 void G1SATBMarkQueueSet::initialize(G1CollectedHeap* g1h, |
37 {} |
38 Monitor* cbl_mon, |
|
39 BufferNode::Allocator* allocator, |
|
40 size_t process_completed_buffers_threshold, |
|
41 uint buffer_enqueue_threshold_percentage) { |
|
42 SATBMarkQueueSet::initialize(cbl_mon, |
|
43 allocator, |
|
44 process_completed_buffers_threshold, |
|
45 buffer_enqueue_threshold_percentage); |
|
46 _g1h = g1h; |
|
47 } |
|
48 |
38 |
49 void G1SATBMarkQueueSet::handle_zero_index_for_thread(Thread* t) { |
39 void G1SATBMarkQueueSet::handle_zero_index_for_thread(Thread* t) { |
50 G1ThreadLocalData::satb_mark_queue(t).handle_zero_index(); |
40 G1ThreadLocalData::satb_mark_queue(t).handle_zero_index(); |
51 } |
41 } |
52 |
42 |
112 // Workaround for not yet having std::bind. |
102 // Workaround for not yet having std::bind. |
113 class G1SATBMarkQueueFilterFn { |
103 class G1SATBMarkQueueFilterFn { |
114 G1CollectedHeap* _g1h; |
104 G1CollectedHeap* _g1h; |
115 |
105 |
116 public: |
106 public: |
117 G1SATBMarkQueueFilterFn(G1CollectedHeap* g1h) : _g1h(g1h) {} |
107 G1SATBMarkQueueFilterFn() : _g1h(G1CollectedHeap::heap()) {} |
118 |
108 |
119 // Return true if entry should be filtered out (removed), false if |
109 // Return true if entry should be filtered out (removed), false if |
120 // it should be retained. |
110 // it should be retained. |
121 bool operator()(const void* entry) const { |
111 bool operator()(const void* entry) const { |
122 return discard_entry(entry, _g1h); |
112 return discard_entry(entry, _g1h); |
123 } |
113 } |
124 }; |
114 }; |
125 |
115 |
126 void G1SATBMarkQueueSet::filter(SATBMarkQueue* queue) { |
116 void G1SATBMarkQueueSet::filter(SATBMarkQueue* queue) { |
127 assert(_g1h != NULL, "SATB queue set not initialized"); |
117 apply_filter(G1SATBMarkQueueFilterFn(), queue); |
128 apply_filter(G1SATBMarkQueueFilterFn(_g1h), queue); |
|
129 } |
118 } |