5247 }
5248
5249 {
5250 GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", _gc_timer_cm);
5251 // Clean up unreferenced symbols in symbol table.
5252 SymbolTable::unlink();
5253 }
5254
5255 {
5256 GCTraceTime(Debug, gc, phases) t("Scrub String Table", _gc_timer_cm);
5257 // Delete entries for dead interned strings.
5258 StringTable::unlink(&_is_alive_closure);
5259 }
5260 }
5261
5262 // Restore any preserved marks as a result of mark stack or
5263 // work queue overflow
5264 restore_preserved_marks_if_any(); // done single-threaded for now
5265
5266 rp->set_enqueuing_is_done(true);
5267 if (rp->processing_is_mt()) {
5268 rp->balance_all_queues();
5269 CMSRefProcTaskExecutor task_executor(*this);
5270 rp->enqueue_discovered_references(&task_executor, &pt);
5271 } else {
5272 rp->enqueue_discovered_references(NULL, &pt);
5273 }
5274 rp->verify_no_references_recorded();
5275 pt.print_enqueue_phase();
5276 assert(!rp->discovery_enabled(), "should have been disabled");
5277 }
5278
5279 #ifndef PRODUCT
5280 void CMSCollector::check_correct_thread_executing() {
5281 Thread* t = Thread::current();
5282 // Only the VM thread or the CMS thread should be here.
5283 assert(t->is_ConcurrentGC_thread() || t->is_VM_thread(),
5284 "Unexpected thread type");
5285 // If this is the vm thread, the foreground process
5286 // should not be waiting. Note that _foregroundGCIsActive is
5287 // true while the foreground collector is waiting.
5288 if (_foregroundGCShouldWait) {
5289 // We cannot be the VM thread
5290 assert(t->is_ConcurrentGC_thread(),
5291 "Should be CMS thread");
5292 } else {
5293 // We can be the CMS thread only if we are in a stop-world
5294 // phase of CMS collection.
5295 if (t->is_ConcurrentGC_thread()) {
5296 assert(_collectorState == InitialMarking ||
|
5247 }
5248
5249 {
5250 GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", _gc_timer_cm);
5251 // Clean up unreferenced symbols in symbol table.
5252 SymbolTable::unlink();
5253 }
5254
5255 {
5256 GCTraceTime(Debug, gc, phases) t("Scrub String Table", _gc_timer_cm);
5257 // Delete entries for dead interned strings.
5258 StringTable::unlink(&_is_alive_closure);
5259 }
5260 }
5261
5262 // Restore any preserved marks as a result of mark stack or
5263 // work queue overflow
5264 restore_preserved_marks_if_any(); // done single-threaded for now
5265
5266 rp->set_enqueuing_is_done(true);
5267 rp->verify_no_references_recorded();
5268 }
5269
5270 #ifndef PRODUCT
5271 void CMSCollector::check_correct_thread_executing() {
5272 Thread* t = Thread::current();
5273 // Only the VM thread or the CMS thread should be here.
5274 assert(t->is_ConcurrentGC_thread() || t->is_VM_thread(),
5275 "Unexpected thread type");
5276 // If this is the vm thread, the foreground process
5277 // should not be waiting. Note that _foregroundGCIsActive is
5278 // true while the foreground collector is waiting.
5279 if (_foregroundGCShouldWait) {
5280 // We cannot be the VM thread
5281 assert(t->is_ConcurrentGC_thread(),
5282 "Should be CMS thread");
5283 } else {
5284 // We can be the CMS thread only if we are in a stop-world
5285 // phase of CMS collection.
5286 if (t->is_ConcurrentGC_thread()) {
5287 assert(_collectorState == InitialMarking ||
|