comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @ 989:148e5441d916

6863023: need non-perm oops in code cache for JSR 292 Summary: Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
author jrose
date Tue, 15 Sep 2009 21:53:47 -0700
parents 7bb995fbd3c0
children 54b3b351d6f9
comparison
equal deleted inserted replaced
987:00977607da34 989:148e5441d916
505 505
506 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); 506 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
507 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 507 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
508 508
509 // General strong roots. 509 // General strong roots.
510 Universe::oops_do(mark_and_push_closure()); 510 {
511 ReferenceProcessor::oops_do(mark_and_push_closure()); 511 ParallelScavengeHeap::ParStrongRootsScope psrs;
512 JNIHandles::oops_do(mark_and_push_closure()); // Global (strong) JNI handles 512 Universe::oops_do(mark_and_push_closure());
513 Threads::oops_do(mark_and_push_closure()); 513 ReferenceProcessor::oops_do(mark_and_push_closure());
514 ObjectSynchronizer::oops_do(mark_and_push_closure()); 514 JNIHandles::oops_do(mark_and_push_closure()); // Global (strong) JNI handles
515 FlatProfiler::oops_do(mark_and_push_closure()); 515 CodeBlobToOopClosure each_active_code_blob(mark_and_push_closure(), /*do_marking=*/ true);
516 Management::oops_do(mark_and_push_closure()); 516 Threads::oops_do(mark_and_push_closure(), &each_active_code_blob);
517 JvmtiExport::oops_do(mark_and_push_closure()); 517 ObjectSynchronizer::oops_do(mark_and_push_closure());
518 SystemDictionary::always_strong_oops_do(mark_and_push_closure()); 518 FlatProfiler::oops_do(mark_and_push_closure());
519 vmSymbols::oops_do(mark_and_push_closure()); 519 Management::oops_do(mark_and_push_closure());
520 JvmtiExport::oops_do(mark_and_push_closure());
521 SystemDictionary::always_strong_oops_do(mark_and_push_closure());
522 vmSymbols::oops_do(mark_and_push_closure());
523 // Do not treat nmethods as strong roots for mark/sweep, since we can unload them.
524 //CodeCache::scavenge_root_nmethods_do(CodeBlobToOopClosure(mark_and_push_closure()));
525 }
520 526
521 // Flush marking stack. 527 // Flush marking stack.
522 follow_stack(); 528 follow_stack();
523 529
524 // Process reference objects found during marking 530 // Process reference objects found during marking
607 613
608 // General strong roots. 614 // General strong roots.
609 Universe::oops_do(adjust_root_pointer_closure()); 615 Universe::oops_do(adjust_root_pointer_closure());
610 ReferenceProcessor::oops_do(adjust_root_pointer_closure()); 616 ReferenceProcessor::oops_do(adjust_root_pointer_closure());
611 JNIHandles::oops_do(adjust_root_pointer_closure()); // Global (strong) JNI handles 617 JNIHandles::oops_do(adjust_root_pointer_closure()); // Global (strong) JNI handles
612 Threads::oops_do(adjust_root_pointer_closure()); 618 Threads::oops_do(adjust_root_pointer_closure(), NULL);
613 ObjectSynchronizer::oops_do(adjust_root_pointer_closure()); 619 ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
614 FlatProfiler::oops_do(adjust_root_pointer_closure()); 620 FlatProfiler::oops_do(adjust_root_pointer_closure());
615 Management::oops_do(adjust_root_pointer_closure()); 621 Management::oops_do(adjust_root_pointer_closure());
616 JvmtiExport::oops_do(adjust_root_pointer_closure()); 622 JvmtiExport::oops_do(adjust_root_pointer_closure());
617 // SO_AllClasses 623 // SO_AllClasses
618 SystemDictionary::oops_do(adjust_root_pointer_closure()); 624 SystemDictionary::oops_do(adjust_root_pointer_closure());
619 vmSymbols::oops_do(adjust_root_pointer_closure()); 625 vmSymbols::oops_do(adjust_root_pointer_closure());
626 //CodeCache::scavenge_root_nmethods_oops_do(adjust_root_pointer_closure());
620 627
621 // Now adjust pointers in remaining weak roots. (All of which should 628 // Now adjust pointers in remaining weak roots. (All of which should
622 // have been cleared if they pointed to non-surviving objects.) 629 // have been cleared if they pointed to non-surviving objects.)
623 // Global (weak) JNI handles 630 // Global (weak) JNI handles
624 JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure()); 631 JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());