15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_PARALLEL_PSSCAVENGE_HPP
25 #define SHARE_GC_PARALLEL_PSSCAVENGE_HPP
26
27 #include "gc/parallel/psCardTable.hpp"
28 #include "gc/parallel/psVirtualspace.hpp"
29 #include "gc/shared/collectorCounters.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "memory/allocation.hpp"
32 #include "oops/oop.hpp"
33 #include "utilities/stack.hpp"
34
35 class GCTaskManager;
36 class GCTaskQueue;
37 class OopStack;
38 class ReferenceProcessor;
39 class ParallelScavengeHeap;
40 class ParallelScavengeTracer;
41 class PSIsAliveClosure;
42 class PSRefProcTaskExecutor;
43 class STWGCTimer;
44
45 class PSScavenge: AllStatic {
46 friend class PSIsAliveClosure;
47 friend class PSKeepAliveClosure;
48 friend class PSPromotionManager;
49
50 enum ScavengeSkippedCause {
51 not_skipped = 0,
52 to_space_not_empty,
53 promoted_too_large,
54 full_follows_scavenge
55 };
|
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_PARALLEL_PSSCAVENGE_HPP
25 #define SHARE_GC_PARALLEL_PSSCAVENGE_HPP
26
27 #include "gc/parallel/psCardTable.hpp"
28 #include "gc/parallel/psVirtualspace.hpp"
29 #include "gc/shared/collectorCounters.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "memory/allocation.hpp"
32 #include "oops/oop.hpp"
33 #include "utilities/stack.hpp"
34
35 class OopStack;
36 class ReferenceProcessor;
37 class ParallelScavengeHeap;
38 class ParallelScavengeTracer;
39 class PSIsAliveClosure;
40 class PSRefProcTaskExecutor;
41 class STWGCTimer;
42
43 class PSScavenge: AllStatic {
44 friend class PSIsAliveClosure;
45 friend class PSKeepAliveClosure;
46 friend class PSPromotionManager;
47
48 enum ScavengeSkippedCause {
49 not_skipped = 0,
50 to_space_not_empty,
51 promoted_too_large,
52 full_follows_scavenge
53 };
|
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 static void set_subject_to_discovery_span(MemRegion mr) {
106 _span_based_discoverer.set_span(mr);
107 }
108 // Used by scavenge_contents && psMarkSweep
109 static ReferenceProcessor* const reference_processor() {
110 assert(_ref_processor != NULL, "Sanity");
111 return _ref_processor;
112 }
113 // Used to add tasks
114 static GCTaskManager* const gc_task_manager();
115 // The promotion managers tell us if they encountered overflow
116 static void set_survivor_overflow(bool state) {
117 _survivor_overflow = state;
118 }
119 // Adaptive size policy support. When the young generation/old generation
120 // boundary moves, _young_generation_boundary must be reset
121 static void set_young_generation_boundary(HeapWord* v);
122
123 // Called by parallelScavengeHeap to init the tenuring threshold
124 static void initialize();
125
126 // Scavenge entry point. This may invoke a full gc; return true if so.
127 static bool invoke();
128 // Return true if a collection was done; false otherwise.
129 static bool invoke_no_policy();
130
131 template <class T> static inline bool should_scavenge(T* p);
132
133 // These call should_scavenge() above and, if it returns true, also check that
|
91 static const ParallelScavengeTracer* gc_tracer() { return &_gc_tracer; }
92
93 public:
94 // Accessors
95 static uint tenuring_threshold() { return _tenuring_threshold; }
96 static elapsedTimer* accumulated_time() { return &_accumulated_time; }
97 static int consecutive_skipped_scavenges()
98 { return _consecutive_skipped_scavenges; }
99
100 // Performance Counters
101 static CollectorCounters* counters() { return _counters; }
102
103 static void set_subject_to_discovery_span(MemRegion mr) {
104 _span_based_discoverer.set_span(mr);
105 }
106 // Used by scavenge_contents && psMarkSweep
107 static ReferenceProcessor* const reference_processor() {
108 assert(_ref_processor != NULL, "Sanity");
109 return _ref_processor;
110 }
111 // The promotion managers tell us if they encountered overflow
112 static void set_survivor_overflow(bool state) {
113 _survivor_overflow = state;
114 }
115 // Adaptive size policy support. When the young generation/old generation
116 // boundary moves, _young_generation_boundary must be reset
117 static void set_young_generation_boundary(HeapWord* v);
118
119 // Called by parallelScavengeHeap to init the tenuring threshold
120 static void initialize();
121
122 // Scavenge entry point. This may invoke a full gc; return true if so.
123 static bool invoke();
124 // Return true if a collection was done; false otherwise.
125 static bool invoke_no_policy();
126
127 template <class T> static inline bool should_scavenge(T* p);
128
129 // These call should_scavenge() above and, if it returns true, also check that
|