127 } |
127 } |
128 } |
128 } |
129 |
129 |
130 void G1RedirtyCardsQueueSet::enqueue_completed_buffer(BufferNode* node) { |
130 void G1RedirtyCardsQueueSet::enqueue_completed_buffer(BufferNode* node) { |
131 assert(_collecting, "precondition"); |
131 assert(_collecting, "precondition"); |
132 Atomic::add(buffer_size() - node->index(), &_entry_count); |
132 Atomic::add(&_entry_count, buffer_size() - node->index()); |
133 _list.push(*node); |
133 _list.push(*node); |
134 update_tail(node); |
134 update_tail(node); |
135 } |
135 } |
136 |
136 |
137 void G1RedirtyCardsQueueSet::merge_bufferlist(LocalQSet* src) { |
137 void G1RedirtyCardsQueueSet::merge_bufferlist(LocalQSet* src) { |
138 assert(_collecting, "precondition"); |
138 assert(_collecting, "precondition"); |
139 const G1BufferNodeList from = src->take_all_completed_buffers(); |
139 const G1BufferNodeList from = src->take_all_completed_buffers(); |
140 if (from._head != NULL) { |
140 if (from._head != NULL) { |
141 assert(from._tail != NULL, "invariant"); |
141 assert(from._tail != NULL, "invariant"); |
142 Atomic::add(from._entry_count, &_entry_count); |
142 Atomic::add(&_entry_count, from._entry_count); |
143 _list.prepend(*from._head, *from._tail); |
143 _list.prepend(*from._head, *from._tail); |
144 update_tail(from._tail); |
144 update_tail(from._tail); |
145 } |
145 } |
146 } |
146 } |