< prev index next >

src/hotspot/share/gc/parallel/psScavenge.hpp

Print this page
rev 49944 : imported patch 8201492-properly-implement-non-contiguous-reference-processing
rev 49945 : imported patch 8201492-stefanj-review


  48   friend class PSKeepAliveClosure;
  49   friend class PSPromotionManager;
  50 
  51  enum ScavengeSkippedCause {
  52    not_skipped = 0,
  53    to_space_not_empty,
  54    promoted_too_large,
  55    full_follows_scavenge
  56  };
  57 
  58   // Saved value of to_space->top(), used to prevent objects in to_space from
  59   // being rescanned.
  60   static HeapWord* _to_space_top_before_gc;
  61 
  62   // Number of consecutive attempts to scavenge that were skipped
  63   static int                _consecutive_skipped_scavenges;
  64 
  65 
  66  protected:
  67   // Flags/counters
  68   static SpanReferenceProcessor* _ref_processor;        // Reference processor for scavenging.

  69   static PSIsAliveClosure        _is_alive_closure;     // Closure used for reference processing
  70   static PSCardTable*            _card_table;           // We cache the card table for fast access.
  71   static bool                    _survivor_overflow;    // Overflow this collection
  72   static uint                    _tenuring_threshold;   // tenuring threshold for next scavenge
  73   static elapsedTimer            _accumulated_time;     // total time spent on scavenge
  74   static STWGCTimer              _gc_timer;             // GC time book keeper
  75   static ParallelScavengeTracer  _gc_tracer;          // GC tracing
  76   // The lowest address possible for the young_gen.
  77   // This is used to decide if an oop should be scavenged,
  78   // cards should be marked, etc.
  79   static HeapWord*            _young_generation_boundary;
  80   // Used to optimize compressed oops young gen boundary checking.
  81   static uintptr_t            _young_generation_boundary_compressed;
  82   static CollectorCounters*   _counters;             // collector performance counters
  83 
  84   static void clean_up_failed_promotion();
  85 
  86   static bool should_attempt_scavenge();
  87 
  88   static HeapWord* to_space_top_before_gc() { return _to_space_top_before_gc; }
  89   static inline void save_to_space_top_before_gc();
  90 
  91   // Private accessors
  92   static PSCardTable* const card_table()           { assert(_card_table != NULL, "Sanity"); return _card_table; }
  93   static const ParallelScavengeTracer* gc_tracer() { return &_gc_tracer; }
  94 
  95  public:
  96   // Accessors
  97   static uint             tenuring_threshold()  { return _tenuring_threshold; }
  98   static elapsedTimer*    accumulated_time()    { return &_accumulated_time; }
  99   static int              consecutive_skipped_scavenges()
 100     { return _consecutive_skipped_scavenges; }
 101 
 102   // Performance Counters
 103   static CollectorCounters* counters()           { return _counters; }
 104 



 105   // Used by scavenge_contents && psMarkSweep
 106   static SpanReferenceProcessor* const reference_processor() {
 107     assert(_ref_processor != NULL, "Sanity");
 108     return _ref_processor;
 109   }
 110   // Used to add tasks
 111   static GCTaskManager* const gc_task_manager();
 112   // The promotion managers tell us if they encountered overflow
 113   static void set_survivor_overflow(bool state) {
 114     _survivor_overflow = state;
 115   }
 116   // Adaptive size policy support.  When the young generation/old generation
 117   // boundary moves, _young_generation_boundary must be reset
 118   static void set_young_generation_boundary(HeapWord* v);
 119 
 120   // Called by parallelScavengeHeap to init the tenuring threshold
 121   static void initialize();
 122 
 123   // Scavenge entry point.  This may invoke a full gc; return true if so.
 124   static bool invoke();
 125   // Return true if a collection was done; false otherwise.
 126   static bool invoke_no_policy();




  48   friend class PSKeepAliveClosure;
  49   friend class PSPromotionManager;
  50 
  51  enum ScavengeSkippedCause {
  52    not_skipped = 0,
  53    to_space_not_empty,
  54    promoted_too_large,
  55    full_follows_scavenge
  56  };
  57 
  58   // Saved value of to_space->top(), used to prevent objects in to_space from
  59   // being rescanned.
  60   static HeapWord* _to_space_top_before_gc;
  61 
  62   // Number of consecutive attempts to scavenge that were skipped
  63   static int                _consecutive_skipped_scavenges;
  64 
  65 
  66  protected:
  67   // Flags/counters
  68   static SpanSubjectToDiscoveryClosure _span_discoverer;
  69   static ReferenceProcessor*           _ref_processor;        // Reference processor for scavenging.
  70   static PSIsAliveClosure              _is_alive_closure;     // Closure used for reference processing
  71   static PSCardTable*                  _card_table;           // We cache the card table for fast access.
  72   static bool                          _survivor_overflow;    // Overflow this collection
  73   static uint                          _tenuring_threshold;   // tenuring threshold for next scavenge
  74   static elapsedTimer                  _accumulated_time;     // total time spent on scavenge
  75   static STWGCTimer                    _gc_timer;             // GC time book keeper
  76   static ParallelScavengeTracer        _gc_tracer;          // GC tracing
  77   // The lowest address possible for the young_gen.
  78   // This is used to decide if an oop should be scavenged,
  79   // cards should be marked, etc.
  80   static HeapWord*            _young_generation_boundary;
  81   // Used to optimize compressed oops young gen boundary checking.
  82   static uintptr_t            _young_generation_boundary_compressed;
  83   static CollectorCounters*   _counters;             // collector performance counters
  84 
  85   static void clean_up_failed_promotion();
  86 
  87   static bool should_attempt_scavenge();
  88 
  89   static HeapWord* to_space_top_before_gc() { return _to_space_top_before_gc; }
  90   static inline void save_to_space_top_before_gc();
  91 
  92   // Private accessors
  93   static PSCardTable* const card_table()           { assert(_card_table != NULL, "Sanity"); return _card_table; }
  94   static const ParallelScavengeTracer* gc_tracer() { return &_gc_tracer; }
  95 
  96  public:
  97   // Accessors
  98   static uint             tenuring_threshold()  { return _tenuring_threshold; }
  99   static elapsedTimer*    accumulated_time()    { return &_accumulated_time; }
 100   static int              consecutive_skipped_scavenges()
 101     { return _consecutive_skipped_scavenges; }
 102 
 103   // Performance Counters
 104   static CollectorCounters* counters()           { return _counters; }
 105 
 106   static void set_subject_to_discovery_span(MemRegion mr) {
 107     _span_discoverer.set_span(mr);
 108   }
 109   // Used by scavenge_contents && psMarkSweep
 110   static ReferenceProcessor* const reference_processor() {
 111     assert(_ref_processor != NULL, "Sanity");
 112     return _ref_processor;
 113   }
 114   // Used to add tasks
 115   static GCTaskManager* const gc_task_manager();
 116   // The promotion managers tell us if they encountered overflow
 117   static void set_survivor_overflow(bool state) {
 118     _survivor_overflow = state;
 119   }
 120   // Adaptive size policy support.  When the young generation/old generation
 121   // boundary moves, _young_generation_boundary must be reset
 122   static void set_young_generation_boundary(HeapWord* v);
 123 
 124   // Called by parallelScavengeHeap to init the tenuring threshold
 125   static void initialize();
 126 
 127   // Scavenge entry point.  This may invoke a full gc; return true if so.
 128   static bool invoke();
 129   // Return true if a collection was done; false otherwise.
 130   static bool invoke_no_policy();


< prev index next >