comparison src/share/vm/memory/referenceProcessor.hpp @ 4728:441e946dc1af

7121618: Change type of number of GC workers to unsigned int. Summary: Change variables representing the number of GC workers to uint from int and size_t. Change the parameter in work(int i) to work(uint worker_id). Reviewed-by: brutisso, tonyp
author jmasa
date Wed, 14 Dec 2011 13:34:57 -0800
parents bf2d2b8b1726
children d2a62e0f25eb
comparison
equal deleted inserted replaced
4727:67fdcb391461 4728:441e946dc1af
229 229
230 BarrierSet* _bs; // Cached copy of BarrierSet. 230 BarrierSet* _bs; // Cached copy of BarrierSet.
231 bool _enqueuing_is_done; // true if all weak references enqueued 231 bool _enqueuing_is_done; // true if all weak references enqueued
232 bool _processing_is_mt; // true during phases when 232 bool _processing_is_mt; // true during phases when
233 // reference processing is MT. 233 // reference processing is MT.
234 int _next_id; // round-robin mod _num_q counter in 234 uint _next_id; // round-robin mod _num_q counter in
235 // support of work distribution 235 // support of work distribution
236 236
237 // For collectors that do not keep GC liveness information 237 // For collectors that do not keep GC liveness information
238 // in the object header, this field holds a closure that 238 // in the object header, this field holds a closure that
239 // helps the reference processor determine the reachability 239 // helps the reference processor determine the reachability
250 ReferencePolicy* _current_soft_ref_policy; 250 ReferencePolicy* _current_soft_ref_policy;
251 251
252 // The discovered ref lists themselves 252 // The discovered ref lists themselves
253 253
254 // The active MT'ness degree of the queues below 254 // The active MT'ness degree of the queues below
255 int _num_q; 255 uint _num_q;
256 // The maximum MT'ness degree of the queues below 256 // The maximum MT'ness degree of the queues below
257 int _max_num_q; 257 uint _max_num_q;
258 258
259 // Master array of discovered oops 259 // Master array of discovered oops
260 DiscoveredList* _discovered_refs; 260 DiscoveredList* _discovered_refs;
261 261
262 // Arrays of lists of oops, one per thread (pointers into master array above) 262 // Arrays of lists of oops, one per thread (pointers into master array above)
266 DiscoveredList* _discoveredPhantomRefs; 266 DiscoveredList* _discoveredPhantomRefs;
267 267
268 public: 268 public:
269 static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); } 269 static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); }
270 270
271 int num_q() { return _num_q; } 271 uint num_q() { return _num_q; }
272 int max_num_q() { return _max_num_q; } 272 uint max_num_q() { return _max_num_q; }
273 void set_active_mt_degree(int v) { _num_q = v; } 273 void set_active_mt_degree(uint v) { _num_q = v; }
274 274
275 DiscoveredList* discovered_refs() { return _discovered_refs; } 275 DiscoveredList* discovered_refs() { return _discovered_refs; }
276 276
277 ReferencePolicy* setup_policy(bool always_clear) { 277 ReferencePolicy* setup_policy(bool always_clear) {
278 _current_soft_ref_policy = always_clear ? 278 _current_soft_ref_policy = always_clear ?
366 void clean_up_discovered_references(); 366 void clean_up_discovered_references();
367 void clean_up_discovered_reflist(DiscoveredList& refs_list); 367 void clean_up_discovered_reflist(DiscoveredList& refs_list);
368 368
369 // Returns the name of the discovered reference list 369 // Returns the name of the discovered reference list
370 // occupying the i / _num_q slot. 370 // occupying the i / _num_q slot.
371 const char* list_name(int i); 371 const char* list_name(uint i);
372 372
373 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor); 373 void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
374 374
375 protected: 375 protected:
376 // Set the 'discovered' field of the given reference to 376 // Set the 'discovered' field of the given reference to
386 OopClosure* keep_alive, 386 OopClosure* keep_alive,
387 VoidClosure* complete_gc, 387 VoidClosure* complete_gc,
388 YieldClosure* yield); 388 YieldClosure* yield);
389 389
390 // round-robin mod _num_q (not: _not_ mode _max_num_q) 390 // round-robin mod _num_q (not: _not_ mode _max_num_q)
391 int next_id() { 391 uint next_id() {
392 int id = _next_id; 392 uint id = _next_id;
393 if (++_next_id == _num_q) { 393 if (++_next_id == _num_q) {
394 _next_id = 0; 394 _next_id = 0;
395 } 395 }
396 return id; 396 return id;
397 } 397 }
432 _next_id(0) 432 _next_id(0)
433 { } 433 { }
434 434
435 // Default parameters give you a vanilla reference processor. 435 // Default parameters give you a vanilla reference processor.
436 ReferenceProcessor(MemRegion span, 436 ReferenceProcessor(MemRegion span,
437 bool mt_processing = false, int mt_processing_degree = 1, 437 bool mt_processing = false, uint mt_processing_degree = 1,
438 bool mt_discovery = false, int mt_discovery_degree = 1, 438 bool mt_discovery = false, uint mt_discovery_degree = 1,
439 bool atomic_discovery = true, 439 bool atomic_discovery = true,
440 BoolObjectClosure* is_alive_non_header = NULL, 440 BoolObjectClosure* is_alive_non_header = NULL,
441 bool discovered_list_needs_barrier = false); 441 bool discovered_list_needs_barrier = false);
442 442
443 // RefDiscoveryPolicy values 443 // RefDiscoveryPolicy values