92 IsGCActiveMark mark;
93
94 if (ScavengeBeforeFullGC) {
95 PSScavenge::invoke_no_policy();
96 }
97
98 const bool clear_all_soft_refs =
99 heap->collector_policy()->should_clear_all_soft_refs();
100
101 uint count = maximum_heap_compaction ? 1 : MarkSweepAlwaysCompactCount;
102 UIntXFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
103 PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction);
104 }
105
106 // This method contains no policy. You should probably
107 // be calling invoke() instead.
108 bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
109 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
110 assert(ref_processor() != NULL, "Sanity");
111
112 if (GC_locker::check_active_before_gc()) {
113 return false;
114 }
115
116 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
117 GCCause::Cause gc_cause = heap->gc_cause();
118
119 GCIdMark gc_id_mark;
120 _gc_timer->register_gc_start();
121 _gc_tracer->report_gc_start(gc_cause, _gc_timer->gc_start());
122
123 PSAdaptiveSizePolicy* size_policy = heap->size_policy();
124
125 // The scope of casr should end after code that can change
126 // CollectorPolicy::_should_clear_all_soft_refs.
127 ClearedAllSoftRefs casr(clear_all_softrefs, heap->collector_policy());
128
129 PSYoungGen* young_gen = heap->young_gen();
130 PSOldGen* old_gen = heap->old_gen();
131
132 // Increment the invocation count
|
92 IsGCActiveMark mark;
93
94 if (ScavengeBeforeFullGC) {
95 PSScavenge::invoke_no_policy();
96 }
97
98 const bool clear_all_soft_refs =
99 heap->collector_policy()->should_clear_all_soft_refs();
100
101 uint count = maximum_heap_compaction ? 1 : MarkSweepAlwaysCompactCount;
102 UIntXFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count);
103 PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction);
104 }
105
106 // This method contains no policy. You should probably
107 // be calling invoke() instead.
108 bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
109 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
110 assert(ref_processor() != NULL, "Sanity");
111
112 if (GCLocker::check_active_before_gc()) {
113 return false;
114 }
115
116 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
117 GCCause::Cause gc_cause = heap->gc_cause();
118
119 GCIdMark gc_id_mark;
120 _gc_timer->register_gc_start();
121 _gc_tracer->report_gc_start(gc_cause, _gc_timer->gc_start());
122
123 PSAdaptiveSizePolicy* size_policy = heap->size_policy();
124
125 // The scope of casr should end after code that can change
126 // CollectorPolicy::_should_clear_all_soft_refs.
127 ClearedAllSoftRefs casr(clear_all_softrefs, heap->collector_policy());
128
129 PSYoungGen* young_gen = heap->young_gen();
130 PSOldGen* old_gen = heap->old_gen();
131
132 // Increment the invocation count
|