412 GCTraceTime(Debug, gc, phases) tm("Reference Processing", &_gc_timer);
413
414 reference_processor()->setup_policy(false); // not always_clear
415 reference_processor()->set_active_mt_degree(active_workers);
416 PSKeepAliveClosure keep_alive(promotion_manager);
417 PSEvacuateFollowersClosure evac_followers(promotion_manager);
418 ReferenceProcessorStats stats;
419 ReferenceProcessorPhaseTimes pt(&_gc_timer, reference_processor()->num_queues());
420 if (reference_processor()->processing_is_mt()) {
421 PSRefProcTaskExecutor task_executor;
422 stats = reference_processor()->process_discovered_references(
423 &_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
424 &pt);
425 } else {
426 stats = reference_processor()->process_discovered_references(
427 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &pt);
428 }
429
430 _gc_tracer.report_gc_reference_stats(stats);
431 pt.print_all_references();
432
433 // Enqueue reference objects discovered during scavenge.
434 if (reference_processor()->processing_is_mt()) {
435 PSRefProcTaskExecutor task_executor;
436 reference_processor()->enqueue_discovered_references(&task_executor, &pt);
437 } else {
438 reference_processor()->enqueue_discovered_references(NULL, &pt);
439 }
440
441 pt.print_enqueue_phase();
442 }
443
444 assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
445
446 PSScavengeRootsClosure root_closure(promotion_manager);
447
448 {
449 GCTraceTime(Debug, gc, phases) tm("Weak Processing", &_gc_timer);
450 WeakProcessor::weak_oops_do(&_is_alive_closure, &root_closure);
451 }
452
453 {
454 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
455 // Unlink any dead interned Strings and process the remaining live ones.
456 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
457 }
458
459 // Verify that usage of root_closure didn't copy any objects.
460 assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
461
|
412 GCTraceTime(Debug, gc, phases) tm("Reference Processing", &_gc_timer);
413
414 reference_processor()->setup_policy(false); // not always_clear
415 reference_processor()->set_active_mt_degree(active_workers);
416 PSKeepAliveClosure keep_alive(promotion_manager);
417 PSEvacuateFollowersClosure evac_followers(promotion_manager);
418 ReferenceProcessorStats stats;
419 ReferenceProcessorPhaseTimes pt(&_gc_timer, reference_processor()->num_queues());
420 if (reference_processor()->processing_is_mt()) {
421 PSRefProcTaskExecutor task_executor;
422 stats = reference_processor()->process_discovered_references(
423 &_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
424 &pt);
425 } else {
426 stats = reference_processor()->process_discovered_references(
427 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &pt);
428 }
429
430 _gc_tracer.report_gc_reference_stats(stats);
431 pt.print_all_references();
432 }
433
434 assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
435
436 PSScavengeRootsClosure root_closure(promotion_manager);
437
438 {
439 GCTraceTime(Debug, gc, phases) tm("Weak Processing", &_gc_timer);
440 WeakProcessor::weak_oops_do(&_is_alive_closure, &root_closure);
441 }
442
443 {
444 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
445 // Unlink any dead interned Strings and process the remaining live ones.
446 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
447 }
448
449 // Verify that usage of root_closure didn't copy any objects.
450 assert(promotion_manager->stacks_empty(),"stacks should be empty at this point");
451
|