src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp

Print this page
rev 2652 : 7085906: Replace the permgen allocated sentinelRef with a self-looped end
Summary: Remove the sentinelRef and let the last Reference in a discovered chain point back to itself.
Reviewed-by: TBD1, TBD2


2428   SymbolTable::unlink();
2429 
2430   assert(cm->marking_stacks_empty(), "marking stacks should be empty");
2431 }
2432 
2433 // This should be moved to the shared markSweep code!
2434 class PSAlwaysTrueClosure: public BoolObjectClosure {
2435 public:
2436   void do_object(oop p) { ShouldNotReachHere(); }
2437   bool do_object_b(oop p) { return true; }
2438 };
2439 static PSAlwaysTrueClosure always_true;
2440 
2441 void PSParallelCompact::adjust_roots() {
2442   // Adjust the pointers to reflect the new locations
2443   EventMark m("3 adjust roots");
2444   TraceTime tm("adjust roots", print_phases(), true, gclog_or_tty);
2445 
2446   // General strong roots.
2447   Universe::oops_do(adjust_root_pointer_closure());
2448   ReferenceProcessor::oops_do(adjust_root_pointer_closure());
2449   JNIHandles::oops_do(adjust_root_pointer_closure());   // Global (strong) JNI handles
2450   Threads::oops_do(adjust_root_pointer_closure(), NULL);
2451   ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
2452   FlatProfiler::oops_do(adjust_root_pointer_closure());
2453   Management::oops_do(adjust_root_pointer_closure());
2454   JvmtiExport::oops_do(adjust_root_pointer_closure());
2455   // SO_AllClasses
2456   SystemDictionary::oops_do(adjust_root_pointer_closure());
2457 
2458   // Now adjust pointers in remaining weak roots.  (All of which should
2459   // have been cleared if they pointed to non-surviving objects.)
2460   // Global (weak) JNI handles
2461   JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());
2462 
2463   CodeCache::oops_do(adjust_pointer_closure());
2464   StringTable::oops_do(adjust_root_pointer_closure());
2465   ref_processor()->weak_oops_do(adjust_root_pointer_closure());
2466   // Roots were visited so references into the young gen in roots
2467   // may have been scanned.  Process them also.
2468   // Should the reference processor have a span that excludes




2428   SymbolTable::unlink();
2429 
2430   assert(cm->marking_stacks_empty(), "marking stacks should be empty");
2431 }
2432 
2433 // This should be moved to the shared markSweep code!
2434 class PSAlwaysTrueClosure: public BoolObjectClosure {
2435 public:
2436   void do_object(oop p) { ShouldNotReachHere(); }
2437   bool do_object_b(oop p) { return true; }
2438 };
2439 static PSAlwaysTrueClosure always_true;
2440 
2441 void PSParallelCompact::adjust_roots() {
2442   // Adjust the pointers to reflect the new locations
2443   EventMark m("3 adjust roots");
2444   TraceTime tm("adjust roots", print_phases(), true, gclog_or_tty);
2445 
2446   // General strong roots.
2447   Universe::oops_do(adjust_root_pointer_closure());

2448   JNIHandles::oops_do(adjust_root_pointer_closure());   // Global (strong) JNI handles
2449   Threads::oops_do(adjust_root_pointer_closure(), NULL);
2450   ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
2451   FlatProfiler::oops_do(adjust_root_pointer_closure());
2452   Management::oops_do(adjust_root_pointer_closure());
2453   JvmtiExport::oops_do(adjust_root_pointer_closure());
2454   // SO_AllClasses
2455   SystemDictionary::oops_do(adjust_root_pointer_closure());
2456 
2457   // Now adjust pointers in remaining weak roots.  (All of which should
2458   // have been cleared if they pointed to non-surviving objects.)
2459   // Global (weak) JNI handles
2460   JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());
2461 
2462   CodeCache::oops_do(adjust_pointer_closure());
2463   StringTable::oops_do(adjust_root_pointer_closure());
2464   ref_processor()->weak_oops_do(adjust_root_pointer_closure());
2465   // Roots were visited so references into the young gen in roots
2466   // may have been scanned.  Process them also.
2467   // Should the reference processor have a span that excludes