comparison src/share/vm/gc_implementation/g1/concurrentMark.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 adedfbbf0360
children 2ace1c4ee8da
comparison
equal deleted inserted replaced
4727:67fdcb391461 4728:441e946dc1af
372 friend class G1CMParDrainMarkingStackClosure; 372 friend class G1CMParDrainMarkingStackClosure;
373 373
374 protected: 374 protected:
375 ConcurrentMarkThread* _cmThread; // the thread doing the work 375 ConcurrentMarkThread* _cmThread; // the thread doing the work
376 G1CollectedHeap* _g1h; // the heap. 376 G1CollectedHeap* _g1h; // the heap.
377 size_t _parallel_marking_threads; // the number of marking 377 uint _parallel_marking_threads; // the number of marking
378 // threads we're use 378 // threads we're use
379 size_t _max_parallel_marking_threads; // max number of marking 379 uint _max_parallel_marking_threads; // max number of marking
380 // threads we'll ever use 380 // threads we'll ever use
381 double _sleep_factor; // how much we have to sleep, with 381 double _sleep_factor; // how much we have to sleep, with
382 // respect to the work we just did, to 382 // respect to the work we just did, to
383 // meet the marking overhead goal 383 // meet the marking overhead goal
384 double _marking_task_overhead; // marking target overhead for 384 double _marking_task_overhead; // marking target overhead for
410 HeapWord* volatile _finger; // the global finger, region aligned, 410 HeapWord* volatile _finger; // the global finger, region aligned,
411 // always points to the end of the 411 // always points to the end of the
412 // last claimed region 412 // last claimed region
413 413
414 // marking tasks 414 // marking tasks
415 size_t _max_task_num; // maximum task number 415 uint _max_task_num; // maximum task number
416 size_t _active_tasks; // task num currently active 416 uint _active_tasks; // task num currently active
417 CMTask** _tasks; // task queue array (max_task_num len) 417 CMTask** _tasks; // task queue array (max_task_num len)
418 CMTaskQueueSet* _task_queues; // task queue set 418 CMTaskQueueSet* _task_queues; // task queue set
419 ParallelTaskTerminator _terminator; // for termination 419 ParallelTaskTerminator _terminator; // for termination
420 420
421 // Two sync barriers that are used to synchronise tasks when an 421 // Two sync barriers that are used to synchronise tasks when an
490 // It resets all the marking data structures. 490 // It resets all the marking data structures.
491 void clear_marking_state(bool clear_overflow = true); 491 void clear_marking_state(bool clear_overflow = true);
492 492
493 // It should be called to indicate which phase we're in (concurrent 493 // It should be called to indicate which phase we're in (concurrent
494 // mark or remark) and how many threads are currently active. 494 // mark or remark) and how many threads are currently active.
495 void set_phase(size_t active_tasks, bool concurrent); 495 void set_phase(uint active_tasks, bool concurrent);
496 // We do this after we're done with marking so that the marking data 496 // We do this after we're done with marking so that the marking data
497 // structures are initialised to a sensible and predictable state. 497 // structures are initialised to a sensible and predictable state.
498 void set_non_marking_state(); 498 void set_non_marking_state();
499 499
500 // prints all gathered CM-related statistics 500 // prints all gathered CM-related statistics
503 bool cleanup_list_is_empty() { 503 bool cleanup_list_is_empty() {
504 return _cleanup_list.is_empty(); 504 return _cleanup_list.is_empty();
505 } 505 }
506 506
507 // accessor methods 507 // accessor methods
508 size_t parallel_marking_threads() { return _parallel_marking_threads; } 508 uint parallel_marking_threads() { return _parallel_marking_threads; }
509 size_t max_parallel_marking_threads() { return _max_parallel_marking_threads;} 509 uint max_parallel_marking_threads() { return _max_parallel_marking_threads;}
510 double sleep_factor() { return _sleep_factor; } 510 double sleep_factor() { return _sleep_factor; }
511 double marking_task_overhead() { return _marking_task_overhead;} 511 double marking_task_overhead() { return _marking_task_overhead;}
512 double cleanup_sleep_factor() { return _cleanup_sleep_factor; } 512 double cleanup_sleep_factor() { return _cleanup_sleep_factor; }
513 double cleanup_task_overhead() { return _cleanup_task_overhead;} 513 double cleanup_task_overhead() { return _cleanup_task_overhead;}
514 514
515 HeapWord* finger() { return _finger; } 515 HeapWord* finger() { return _finger; }
516 bool concurrent() { return _concurrent; } 516 bool concurrent() { return _concurrent; }
517 size_t active_tasks() { return _active_tasks; } 517 uint active_tasks() { return _active_tasks; }
518 ParallelTaskTerminator* terminator() { return &_terminator; } 518 ParallelTaskTerminator* terminator() { return &_terminator; }
519 519
520 // It claims the next available region to be scanned by a marking 520 // It claims the next available region to be scanned by a marking
521 // task. It might return NULL if the next region is empty or we have 521 // task. It might return NULL if the next region is empty or we have
522 // run out of regions. In the latter case, out_of_regions() 522 // run out of regions. In the latter case, out_of_regions()
713 CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; } 713 CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
714 714
715 // Returns the number of GC threads to be used in a concurrent 715 // Returns the number of GC threads to be used in a concurrent
716 // phase based on the number of GC threads being used in a STW 716 // phase based on the number of GC threads being used in a STW
717 // phase. 717 // phase.
718 size_t scale_parallel_threads(size_t n_par_threads); 718 uint scale_parallel_threads(uint n_par_threads);
719 719
720 // Calculates the number of GC threads to be used in a concurrent phase. 720 // Calculates the number of GC threads to be used in a concurrent phase.
721 size_t calc_parallel_marking_threads(); 721 uint calc_parallel_marking_threads();
722 722
723 // The following three are interaction between CM and 723 // The following three are interaction between CM and
724 // G1CollectedHeap 724 // G1CollectedHeap
725 725
726 // This notifies CM that a root during initial-mark needs to be 726 // This notifies CM that a root during initial-mark needs to be
871 addr < _prevMarkBitMap->endWord(), "in a region"); 871 addr < _prevMarkBitMap->endWord(), "in a region");
872 872
873 return _prevMarkBitMap->isMarked(addr); 873 return _prevMarkBitMap->isMarked(addr);
874 } 874 }
875 875
876 inline bool do_yield_check(int worker_i = 0); 876 inline bool do_yield_check(uint worker_i = 0);
877 inline bool should_yield(); 877 inline bool should_yield();
878 878
879 // Called to abort the marking cycle after a Full GC takes palce. 879 // Called to abort the marking cycle after a Full GC takes palce.
880 void abort(); 880 void abort();
881 881