mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8016302: Change type of the number of GC workers to unsigned int (2)
Reviewed-by: tschatzl, jwilhelm
This commit is contained in:
parent
a00bf70f6f
commit
0ab60ab172
21 changed files with 96 additions and 98 deletions
|
@ -34,12 +34,12 @@
|
|||
|
||||
bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl,
|
||||
bool consume,
|
||||
size_t worker_i) {
|
||||
uint worker_i) {
|
||||
bool res = true;
|
||||
if (_buf != NULL) {
|
||||
res = apply_closure_to_buffer(cl, _buf, _index, _sz,
|
||||
consume,
|
||||
(int) worker_i);
|
||||
worker_i);
|
||||
if (res && consume) _index = _sz;
|
||||
}
|
||||
return res;
|
||||
|
@ -49,7 +49,7 @@ bool DirtyCardQueue::apply_closure_to_buffer(CardTableEntryClosure* cl,
|
|||
void** buf,
|
||||
size_t index, size_t sz,
|
||||
bool consume,
|
||||
int worker_i) {
|
||||
uint worker_i) {
|
||||
if (cl == NULL) return true;
|
||||
for (size_t i = index; i < sz; i += oopSize) {
|
||||
int ind = byte_index_to_index((int)i);
|
||||
|
@ -79,8 +79,8 @@ DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
|
|||
}
|
||||
|
||||
// Determines how many mutator threads can process the buffers in parallel.
|
||||
size_t DirtyCardQueueSet::num_par_ids() {
|
||||
return os::processor_count();
|
||||
uint DirtyCardQueueSet::num_par_ids() {
|
||||
return (uint)os::processor_count();
|
||||
}
|
||||
|
||||
void DirtyCardQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
|
||||
|
@ -103,7 +103,7 @@ void DirtyCardQueueSet::set_closure(CardTableEntryClosure* closure) {
|
|||
}
|
||||
|
||||
void DirtyCardQueueSet::iterate_closure_all_threads(bool consume,
|
||||
size_t worker_i) {
|
||||
uint worker_i) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
|
||||
for(JavaThread* t = Threads::first(); t; t = t->next()) {
|
||||
bool b = t->dirty_card_queue().apply_closure(_closure, consume);
|
||||
|
@ -126,11 +126,11 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
|
|||
|
||||
// We get the the number of any par_id that this thread
|
||||
// might have already claimed.
|
||||
int worker_i = thread->get_claimed_par_id();
|
||||
uint worker_i = thread->get_claimed_par_id();
|
||||
|
||||
// If worker_i is not -1 then the thread has already claimed
|
||||
// If worker_i is not UINT_MAX then the thread has already claimed
|
||||
// a par_id. We make note of it using the already_claimed value
|
||||
if (worker_i != -1) {
|
||||
if (worker_i != UINT_MAX) {
|
||||
already_claimed = true;
|
||||
} else {
|
||||
|
||||
|
@ -142,7 +142,7 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
|
|||
}
|
||||
|
||||
bool b = false;
|
||||
if (worker_i != -1) {
|
||||
if (worker_i != UINT_MAX) {
|
||||
b = DirtyCardQueue::apply_closure_to_buffer(_closure, buf, 0,
|
||||
_sz, true, worker_i);
|
||||
if (b) Atomic::inc(&_processed_buffers_mut);
|
||||
|
@ -154,8 +154,8 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
|
|||
// we release the id
|
||||
_free_ids->release_par_id(worker_i);
|
||||
|
||||
// and set the claimed_id in the thread to -1
|
||||
thread->set_claimed_par_id(-1);
|
||||
// and set the claimed_id in the thread to UINT_MAX
|
||||
thread->set_claimed_par_id(UINT_MAX);
|
||||
}
|
||||
}
|
||||
return b;
|
||||
|
@ -186,7 +186,7 @@ DirtyCardQueueSet::get_completed_buffer(int stop_at) {
|
|||
|
||||
bool DirtyCardQueueSet::
|
||||
apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
|
||||
int worker_i,
|
||||
uint worker_i,
|
||||
BufferNode* nd) {
|
||||
if (nd != NULL) {
|
||||
void **buf = BufferNode::make_buffer_from_node(nd);
|
||||
|
@ -208,7 +208,7 @@ apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
|
|||
}
|
||||
|
||||
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
|
||||
int worker_i,
|
||||
uint worker_i,
|
||||
int stop_at,
|
||||
bool during_pause) {
|
||||
assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause");
|
||||
|
@ -218,7 +218,7 @@ bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure*
|
|||
return res;
|
||||
}
|
||||
|
||||
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(int worker_i,
|
||||
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(uint worker_i,
|
||||
int stop_at,
|
||||
bool during_pause) {
|
||||
return apply_closure_to_completed_buffer(_closure, worker_i,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue