equal
deleted
inserted
replaced
60 void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, |
60 void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, |
61 bool clear_all_softrefs) { |
61 bool clear_all_softrefs) { |
62 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); |
62 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); |
63 HandleMark hm; // Discard invalid handles created during gc |
63 HandleMark hm; // Discard invalid handles created during gc |
64 |
64 |
65 #if defined(COMPILER2) || INCLUDE_JVMCI |
65 #if COMPILER2_OR_JVMCI |
66 DerivedPointerTable::clear(); |
66 DerivedPointerTable::clear(); |
67 #endif |
67 #endif |
68 #ifdef ASSERT |
68 #ifdef ASSERT |
69 if (G1CollectedHeap::heap()->collector_policy()->should_clear_all_soft_refs()) { |
69 if (G1CollectedHeap::heap()->collector_policy()->should_clear_all_soft_refs()) { |
70 assert(clear_all_softrefs, "Policy should have been checked earler"); |
70 assert(clear_all_softrefs, "Policy should have been checked earler"); |
94 mark_sweep_phase1(marked_for_unloading, clear_all_softrefs); |
94 mark_sweep_phase1(marked_for_unloading, clear_all_softrefs); |
95 |
95 |
96 // Prepare compaction. |
96 // Prepare compaction. |
97 mark_sweep_phase2(); |
97 mark_sweep_phase2(); |
98 |
98 |
99 #if defined(COMPILER2) || INCLUDE_JVMCI |
99 #if COMPILER2_OR_JVMCI |
100 // Don't add any more derived pointers during phase3 |
100 // Don't add any more derived pointers during phase3 |
101 DerivedPointerTable::set_active(false); |
101 DerivedPointerTable::set_active(false); |
102 #endif |
102 #endif |
103 |
103 |
104 // Adjust all pointers. |
104 // Adjust all pointers. |
109 |
109 |
110 GenMarkSweep::restore_marks(); |
110 GenMarkSweep::restore_marks(); |
111 BiasedLocking::restore_marks(); |
111 BiasedLocking::restore_marks(); |
112 GenMarkSweep::deallocate_stacks(); |
112 GenMarkSweep::deallocate_stacks(); |
113 |
113 |
114 #if defined(COMPILER2) || INCLUDE_JVMCI |
114 #if COMPILER2_OR_JVMCI |
115 // Now update the derived pointers. |
115 // Now update the derived pointers. |
116 DerivedPointerTable::update_pointers(); |
116 DerivedPointerTable::update_pointers(); |
117 #endif |
117 #endif |
118 |
118 |
119 CodeCache::gc_epilogue(); |
119 CodeCache::gc_epilogue(); |
202 g1h->partial_cleaning(&GenMarkSweep::is_alive, true, true, G1StringDedup::is_enabled()); |
202 g1h->partial_cleaning(&GenMarkSweep::is_alive, true, true, G1StringDedup::is_enabled()); |
203 } |
203 } |
204 |
204 |
205 if (VerifyDuringGC) { |
205 if (VerifyDuringGC) { |
206 HandleMark hm; // handle scope |
206 HandleMark hm; // handle scope |
207 #if defined(COMPILER2) || INCLUDE_JVMCI |
207 #if COMPILER2_OR_JVMCI |
208 DerivedPointerTableDeactivate dpt_deact; |
208 DerivedPointerTableDeactivate dpt_deact; |
209 #endif |
209 #endif |
210 g1h->prepare_for_verify(); |
210 g1h->prepare_for_verify(); |
211 // Note: we can verify only the heap here. When an object is |
211 // Note: we can verify only the heap here. When an object is |
212 // marked, the previous value of the mark word (including |
212 // marked, the previous value of the mark word (including |