150
151 rp->setup_policy(clear_all_softrefs);
152 const ReferenceProcessorStats& stats =
153 rp->process_discovered_references(&GenMarkSweep::is_alive,
154 &GenMarkSweep::keep_alive,
155 &GenMarkSweep::follow_stack_closure,
156 NULL,
157 gc_timer());
158 gc_tracer()->report_gc_reference_stats(stats);
159 }
160
161 // This is the point where the entire marking should have completed.
162 assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
163
164 if (ClassUnloading) {
165 GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer());
166
167 // Unload classes and purge the SystemDictionary.
168 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
169
170 g1h->full_cleaning(&GenMarkSweep::is_alive, purged_class);
171 } else {
172 GCTraceTime(Debug, gc, phases) trace("Cleanup", gc_timer());
173 g1h->partial_cleaning(&GenMarkSweep::is_alive, true, true, G1StringDedup::is_enabled());
174 }
175
176 if (VerifyDuringGC) {
177 HandleMark hm; // handle scope
178 #if defined(COMPILER2) || INCLUDE_JVMCI
179 DerivedPointerTableDeactivate dpt_deact;
180 #endif
181 g1h->prepare_for_verify();
182 // Note: we can verify only the heap here. When an object is
183 // marked, the previous value of the mark word (including
184 // identity hash values, ages, etc) is preserved, and the mark
185 // word is set to markOop::marked_value - effectively removing
186 // any hash values from the mark word. These hash values are
187 // used when verifying the dictionaries and so removing them
188 // from the mark word can make verification of the dictionaries
189 // fail. At the end of the GC, the original mark word values
190 // (including hash values) are restored to the appropriate
|
150
151 rp->setup_policy(clear_all_softrefs);
152 const ReferenceProcessorStats& stats =
153 rp->process_discovered_references(&GenMarkSweep::is_alive,
154 &GenMarkSweep::keep_alive,
155 &GenMarkSweep::follow_stack_closure,
156 NULL,
157 gc_timer());
158 gc_tracer()->report_gc_reference_stats(stats);
159 }
160
161 // This is the point where the entire marking should have completed.
162 assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
163
164 if (ClassUnloading) {
165 GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer());
166
167 // Unload classes and purge the SystemDictionary.
168 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive);
169
170 g1h->complete_cleaning(&GenMarkSweep::is_alive, purged_class);
171 } else {
172 GCTraceTime(Debug, gc, phases) trace("Cleanup", gc_timer());
173 g1h->partial_cleaning(&GenMarkSweep::is_alive, true, true, G1StringDedup::is_enabled());
174 }
175
176 if (VerifyDuringGC) {
177 HandleMark hm; // handle scope
178 #if defined(COMPILER2) || INCLUDE_JVMCI
179 DerivedPointerTableDeactivate dpt_deact;
180 #endif
181 g1h->prepare_for_verify();
182 // Note: we can verify only the heap here. When an object is
183 // marked, the previous value of the mark word (including
184 // identity hash values, ages, etc) is preserved, and the mark
185 // word is set to markOop::marked_value - effectively removing
186 // any hash values from the mark word. These hash values are
187 // used when verifying the dictionaries and so removing them
188 // from the mark word can make verification of the dictionaries
189 // fail. At the end of the GC, the original mark word values
190 // (including hash values) are restored to the appropriate
|