537 }
538
539 OopTaskQueueSet* _task_queues;
540
541 // Overflow list of grey objects, threaded through mark-word
542 // Manipulated with CAS in the parallel/multi-threaded case.
543 oopDesc* volatile _overflow_list;
544 // The following array-pair keeps track of mark words
545 // displaced for accommodating overflow list above.
546 // This code will likely be revisited under RFE#4922830.
547 Stack<oop, mtGC> _preserved_oop_stack;
548 Stack<markOop, mtGC> _preserved_mark_stack;
549
550 int* _hash_seed;
551
552 // In support of multi-threaded concurrent phases
553 YieldingFlexibleWorkGang* _conc_workers;
554
555 // Performance Counters
556 CollectorCounters* _gc_counters;
557
558 // Initialization Errors
559 bool _completed_initialization;
560
561 // In support of ExplicitGCInvokesConcurrent
562 static bool _full_gc_requested;
563 static GCCause::Cause _full_gc_cause;
564 unsigned int _collection_count_start;
565
566 // Should we unload classes this concurrent cycle?
567 bool _should_unload_classes;
568 unsigned int _concurrent_cycles_since_last_unload;
569 unsigned int concurrent_cycles_since_last_unload() const {
570 return _concurrent_cycles_since_last_unload;
571 }
572 // Did we (allow) unload classes in the previous concurrent cycle?
573 bool unloaded_classes_last_cycle() const {
574 return concurrent_cycles_since_last_unload() == 0;
575 }
576 // Root scanning options for perm gen
912
913 CMSBitMap* markBitMap() { return &_markBitMap; }
914 void directAllocated(HeapWord* start, size_t size);
915
916 // Main CMS steps and related support
917 void checkpointRootsInitial();
918 bool markFromRoots(); // a return value of false indicates failure
919 // due to stack overflow
920 void preclean();
921 void checkpointRootsFinal();
922 void sweep();
923
924 // Check that the currently executing thread is the expected
925 // one (foreground collector or background collector).
926 static void check_correct_thread_executing() PRODUCT_RETURN;
927
928 NOT_PRODUCT(bool is_cms_reachable(HeapWord* addr);)
929
930 // Performance Counter Support
931 CollectorCounters* counters() { return _gc_counters; }
932
933 // Timer stuff
934 void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); }
935 void stopTimer() { assert( _timer.is_active(), "Error"); _timer.stop(); }
936 void resetTimer() { assert(!_timer.is_active(), "Error"); _timer.reset(); }
937 jlong timerTicks() { assert(!_timer.is_active(), "Error"); return _timer.ticks(); }
938
939 int yields() { return _numYields; }
940 void resetYields() { _numYields = 0; }
941 void incrementYields() { _numYields++; }
942 void resetNumDirtyCards() { _numDirtyCards = 0; }
943 void incrementNumDirtyCards(size_t num) { _numDirtyCards += num; }
944 size_t numDirtyCards() { return _numDirtyCards; }
945
946 static bool foregroundGCShouldWait() { return _foregroundGCShouldWait; }
947 static void set_foregroundGCShouldWait(bool v) { _foregroundGCShouldWait = v; }
948 static bool foregroundGCIsActive() { return _foregroundGCIsActive; }
949 static void set_foregroundGCIsActive(bool v) { _foregroundGCIsActive = v; }
950 size_t sweep_count() const { return _sweep_count; }
951 void increment_sweep_count() { _sweep_count++; }
|
537 }
538
539 OopTaskQueueSet* _task_queues;
540
541 // Overflow list of grey objects, threaded through mark-word
542 // Manipulated with CAS in the parallel/multi-threaded case.
543 oopDesc* volatile _overflow_list;
544 // The following array-pair keeps track of mark words
545 // displaced for accommodating overflow list above.
546 // This code will likely be revisited under RFE#4922830.
547 Stack<oop, mtGC> _preserved_oop_stack;
548 Stack<markOop, mtGC> _preserved_mark_stack;
549
550 int* _hash_seed;
551
552 // In support of multi-threaded concurrent phases
553 YieldingFlexibleWorkGang* _conc_workers;
554
555 // Performance Counters
556 CollectorCounters* _gc_counters;
557 CollectorCounters* _cgc_counters;
558
559 // Initialization Errors
560 bool _completed_initialization;
561
562 // In support of ExplicitGCInvokesConcurrent
563 static bool _full_gc_requested;
564 static GCCause::Cause _full_gc_cause;
565 unsigned int _collection_count_start;
566
567 // Should we unload classes this concurrent cycle?
568 bool _should_unload_classes;
569 unsigned int _concurrent_cycles_since_last_unload;
570 unsigned int concurrent_cycles_since_last_unload() const {
571 return _concurrent_cycles_since_last_unload;
572 }
573 // Did we (allow) unload classes in the previous concurrent cycle?
574 bool unloaded_classes_last_cycle() const {
575 return concurrent_cycles_since_last_unload() == 0;
576 }
577 // Root scanning options for perm gen
913
914 CMSBitMap* markBitMap() { return &_markBitMap; }
915 void directAllocated(HeapWord* start, size_t size);
916
917 // Main CMS steps and related support
918 void checkpointRootsInitial();
919 bool markFromRoots(); // a return value of false indicates failure
920 // due to stack overflow
921 void preclean();
922 void checkpointRootsFinal();
923 void sweep();
924
925 // Check that the currently executing thread is the expected
926 // one (foreground collector or background collector).
927 static void check_correct_thread_executing() PRODUCT_RETURN;
928
929 NOT_PRODUCT(bool is_cms_reachable(HeapWord* addr);)
930
931 // Performance Counter Support
932 CollectorCounters* counters() { return _gc_counters; }
933 CollectorCounters* cgc_counters() { return _cgc_counters; }
934
935 // Timer stuff
936 void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); }
937 void stopTimer() { assert( _timer.is_active(), "Error"); _timer.stop(); }
938 void resetTimer() { assert(!_timer.is_active(), "Error"); _timer.reset(); }
939 jlong timerTicks() { assert(!_timer.is_active(), "Error"); return _timer.ticks(); }
940
941 int yields() { return _numYields; }
942 void resetYields() { _numYields = 0; }
943 void incrementYields() { _numYields++; }
944 void resetNumDirtyCards() { _numDirtyCards = 0; }
945 void incrementNumDirtyCards(size_t num) { _numDirtyCards += num; }
946 size_t numDirtyCards() { return _numDirtyCards; }
947
948 static bool foregroundGCShouldWait() { return _foregroundGCShouldWait; }
949 static void set_foregroundGCShouldWait(bool v) { _foregroundGCShouldWait = v; }
950 static bool foregroundGCIsActive() { return _foregroundGCIsActive; }
951 static void set_foregroundGCIsActive(bool v) { _foregroundGCIsActive = v; }
952 size_t sweep_count() const { return _sweep_count; }
953 void increment_sweep_count() { _sweep_count++; }
|