< prev index next >
src/share/vm/gc/g1/dirtyCardQueue.cpp
Print this page
rev 10163 : [mq]: remove_apply_closure_helper
*** 1,7 ****
/*
! * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 226,268 ****
}
DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
return nd;
}
! bool DirtyCardQueueSet::apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
uint worker_i,
! BufferNode* nd) {
! if (nd != NULL) {
! void **buf = BufferNode::make_buffer_from_node(nd);
size_t index = nd->index();
! bool b =
! DirtyCardQueue::apply_closure_to_buffer(cl, buf,
! index, _sz,
! true, worker_i);
! if (b) {
deallocate_buffer(buf);
! return true; // In normal case, go on to next buffer.
} else {
enqueue_complete_buffer(buf, index);
return false;
}
- } else {
- return false;
}
}
- bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
- uint worker_i,
- int stop_at,
- bool during_pause) {
- assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause");
- BufferNode* nd = get_completed_buffer(stop_at);
- bool res = apply_closure_to_completed_buffer_helper(cl, worker_i, nd);
- if (res) Atomic::inc(&_processed_buffers_rs_thread);
- return res;
- }
-
void DirtyCardQueueSet::apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl) {
BufferNode* nd = _completed_buffers_head;
while (nd != NULL) {
bool b =
DirtyCardQueue::apply_closure_to_buffer(cl,
--- 226,261 ----
}
DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked());
return nd;
}
! bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
uint worker_i,
! int stop_at,
! bool during_pause) {
! assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause");
! BufferNode* nd = get_completed_buffer(stop_at);
! if (nd == NULL) {
! return false;
! } else {
! void** buf = BufferNode::make_buffer_from_node(nd);
size_t index = nd->index();
! if (DirtyCardQueue::apply_closure_to_buffer(cl,
! buf, index, _sz,
! true, worker_i)) {
! // Done with fully processed buffer.
deallocate_buffer(buf);
! Atomic::inc(&_processed_buffers_rs_thread);
! return true;
} else {
+ // Return partially processed buffer to the queue.
enqueue_complete_buffer(buf, index);
return false;
}
}
}
void DirtyCardQueueSet::apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl) {
BufferNode* nd = _completed_buffers_head;
while (nd != NULL) {
bool b =
DirtyCardQueue::apply_closure_to_buffer(cl,
< prev index next >