comparison src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @ 14909:4ca6dc0799b6

Backout jdk9 merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 01 Apr 2014 13:57:07 +0200
parents 10c424c5a362
children 52b4284cb496
comparison
equal deleted inserted replaced
14908:8db6e76cb658 14909:4ca6dc0799b6
129 129
130 // Need cleared claim bits for the strong roots processing 130 // Need cleared claim bits for the strong roots processing
131 ClassLoaderDataGraph::clear_claimed_marks(); 131 ClassLoaderDataGraph::clear_claimed_marks();
132 132
133 sh->process_strong_roots(true, // activate StrongRootsScope 133 sh->process_strong_roots(true, // activate StrongRootsScope
134 false, // not scavenging.
134 SharedHeap::SO_SystemClasses, 135 SharedHeap::SO_SystemClasses,
135 &GenMarkSweep::follow_root_closure, 136 &GenMarkSweep::follow_root_closure,
137 &GenMarkSweep::follow_code_root_closure,
136 &GenMarkSweep::follow_klass_closure); 138 &GenMarkSweep::follow_klass_closure);
137 139
138 // Process reference objects found during marking 140 // Process reference objects found during marking
139 ReferenceProcessor* rp = GenMarkSweep::ref_processor(); 141 ReferenceProcessor* rp = GenMarkSweep::ref_processor();
140 assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity"); 142 assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
159 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); 161 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class);
160 162
161 // Prune dead klasses from subklass/sibling/implementor lists. 163 // Prune dead klasses from subklass/sibling/implementor lists.
162 Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); 164 Klass::clean_weak_klass_links(&GenMarkSweep::is_alive);
163 165
164 // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. 166 // Delete entries for dead interned strings.
165 G1CollectedHeap::heap()->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); 167 StringTable::unlink(&GenMarkSweep::is_alive);
168
169 // Clean up unreferenced symbols in symbol table.
170 SymbolTable::unlink();
166 171
167 if (VerifyDuringGC) { 172 if (VerifyDuringGC) {
168 HandleMark hm; // handle scope 173 HandleMark hm; // handle scope
169 COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact); 174 COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
170 Universe::heap()->prepare_for_verify(); 175 Universe::heap()->prepare_for_verify();
173 // identity hash values, ages, etc) is preserved, and the mark 178 // identity hash values, ages, etc) is preserved, and the mark
174 // word is set to markOop::marked_value - effectively removing 179 // word is set to markOop::marked_value - effectively removing
175 // any hash values from the mark word. These hash values are 180 // any hash values from the mark word. These hash values are
176 // used when verifying the dictionaries and so removing them 181 // used when verifying the dictionaries and so removing them
177 // from the mark word can make verification of the dictionaries 182 // from the mark word can make verification of the dictionaries
178 // fail. At the end of the GC, the original mark word values 183 // fail. At the end of the GC, the orginal mark word values
179 // (including hash values) are restored to the appropriate 184 // (including hash values) are restored to the appropriate
180 // objects. 185 // objects.
181 if (!VerifySilently) { 186 if (!VerifySilently) {
182 gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying "); 187 gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying ");
183 } 188 }
304 309
305 // Need cleared claim bits for the strong roots processing 310 // Need cleared claim bits for the strong roots processing
306 ClassLoaderDataGraph::clear_claimed_marks(); 311 ClassLoaderDataGraph::clear_claimed_marks();
307 312
308 sh->process_strong_roots(true, // activate StrongRootsScope 313 sh->process_strong_roots(true, // activate StrongRootsScope
309 SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache, 314 false, // not scavenging.
315 SharedHeap::SO_AllClasses,
310 &GenMarkSweep::adjust_pointer_closure, 316 &GenMarkSweep::adjust_pointer_closure,
317 NULL, // do not touch code cache here
311 &GenMarkSweep::adjust_klass_closure); 318 &GenMarkSweep::adjust_klass_closure);
312 319
313 assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity"); 320 assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
314 g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure); 321 g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
315 322
316 // Now adjust pointers in remaining weak roots. (All of which should 323 // Now adjust pointers in remaining weak roots. (All of which should
317 // have been cleared if they pointed to non-surviving objects.) 324 // have been cleared if they pointed to non-surviving objects.)
318 sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure); 325 g1h->g1_process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
319 326
320 GenMarkSweep::adjust_marks(); 327 GenMarkSweep::adjust_marks();
321 328
322 G1AdjustPointersClosure blk; 329 G1AdjustPointersClosure blk;
323 g1h->heap_region_iterate(&blk); 330 g1h->heap_region_iterate(&blk);