1.1 --- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp Tue Apr 08 14:55:16 2014 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp Thu Apr 03 17:49:31 2014 +0400 1.3 @@ -34,12 +34,12 @@ 1.4 1.5 bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl, 1.6 bool consume, 1.7 - size_t worker_i) { 1.8 + uint worker_i) { 1.9 bool res = true; 1.10 if (_buf != NULL) { 1.11 res = apply_closure_to_buffer(cl, _buf, _index, _sz, 1.12 consume, 1.13 - (int) worker_i); 1.14 + worker_i); 1.15 if (res && consume) _index = _sz; 1.16 } 1.17 return res; 1.18 @@ -49,7 +49,7 @@ 1.19 void** buf, 1.20 size_t index, size_t sz, 1.21 bool consume, 1.22 - int worker_i) { 1.23 + uint worker_i) { 1.24 if (cl == NULL) return true; 1.25 for (size_t i = index; i < sz; i += oopSize) { 1.26 int ind = byte_index_to_index((int)i); 1.27 @@ -79,8 +79,8 @@ 1.28 } 1.29 1.30 // Determines how many mutator threads can process the buffers in parallel. 1.31 -size_t DirtyCardQueueSet::num_par_ids() { 1.32 - return os::processor_count(); 1.33 +uint DirtyCardQueueSet::num_par_ids() { 1.34 + return (uint)os::processor_count(); 1.35 } 1.36 1.37 void DirtyCardQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, 1.38 @@ -103,7 +103,7 @@ 1.39 } 1.40 1.41 void DirtyCardQueueSet::iterate_closure_all_threads(bool consume, 1.42 - size_t worker_i) { 1.43 + uint worker_i) { 1.44 assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); 1.45 for(JavaThread* t = Threads::first(); t; t = t->next()) { 1.46 bool b = t->dirty_card_queue().apply_closure(_closure, consume); 1.47 @@ -126,11 +126,11 @@ 1.48 1.49 // We get the the number of any par_id that this thread 1.50 // might have already claimed. 1.51 - int worker_i = thread->get_claimed_par_id(); 1.52 + uint worker_i = thread->get_claimed_par_id(); 1.53 1.54 - // If worker_i is not -1 then the thread has already claimed 1.55 + // If worker_i is not UINT_MAX then the thread has already claimed 1.56 // a par_id. We make note of it using the already_claimed value 1.57 - if (worker_i != -1) { 1.58 + if (worker_i != UINT_MAX) { 1.59 already_claimed = true; 1.60 } else { 1.61 1.62 @@ -142,7 +142,7 @@ 1.63 } 1.64 1.65 bool b = false; 1.66 - if (worker_i != -1) { 1.67 + if (worker_i != UINT_MAX) { 1.68 b = DirtyCardQueue::apply_closure_to_buffer(_closure, buf, 0, 1.69 _sz, true, worker_i); 1.70 if (b) Atomic::inc(&_processed_buffers_mut); 1.71 @@ -154,8 +154,8 @@ 1.72 // we release the id 1.73 _free_ids->release_par_id(worker_i); 1.74 1.75 - // and set the claimed_id in the thread to -1 1.76 - thread->set_claimed_par_id(-1); 1.77 + // and set the claimed_id in the thread to UINT_MAX 1.78 + thread->set_claimed_par_id(UINT_MAX); 1.79 } 1.80 } 1.81 return b; 1.82 @@ -186,7 +186,7 @@ 1.83 1.84 bool DirtyCardQueueSet:: 1.85 apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl, 1.86 - int worker_i, 1.87 + uint worker_i, 1.88 BufferNode* nd) { 1.89 if (nd != NULL) { 1.90 void **buf = BufferNode::make_buffer_from_node(nd); 1.91 @@ -208,7 +208,7 @@ 1.92 } 1.93 1.94 bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure* cl, 1.95 - int worker_i, 1.96 + uint worker_i, 1.97 int stop_at, 1.98 bool during_pause) { 1.99 assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause"); 1.100 @@ -218,7 +218,7 @@ 1.101 return res; 1.102 } 1.103 1.104 -bool DirtyCardQueueSet::apply_closure_to_completed_buffer(int worker_i, 1.105 +bool DirtyCardQueueSet::apply_closure_to_completed_buffer(uint worker_i, 1.106 int stop_at, 1.107 bool during_pause) { 1.108 return apply_closure_to_completed_buffer(_closure, worker_i,