2419 }
2420
2421 // This should be moved to the shared markSweep code!
2422 class PSAlwaysTrueClosure: public BoolObjectClosure {
2423 public:
2424 void do_object(oop p) { ShouldNotReachHere(); }
2425 bool do_object_b(oop p) { return true; }
2426 };
2427 static PSAlwaysTrueClosure always_true;
2428
2429 void PSParallelCompact::adjust_roots() {
2430 // Adjust the pointers to reflect the new locations
2431 TraceTime tm("adjust roots", print_phases(), true, gclog_or_tty);
2432
2433 // Need new claim bits when tracing through and adjusting pointers.
2434 ClassLoaderDataGraph::clear_claimed_marks();
2435
2436 // General strong roots.
2437 Universe::oops_do(adjust_root_pointer_closure());
2438 JNIHandles::oops_do(adjust_root_pointer_closure()); // Global (strong) JNI handles
2439 Threads::oops_do(adjust_root_pointer_closure(), NULL);
2440 ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
2441 FlatProfiler::oops_do(adjust_root_pointer_closure());
2442 Management::oops_do(adjust_root_pointer_closure());
2443 JvmtiExport::oops_do(adjust_root_pointer_closure());
2444 // SO_AllClasses
2445 SystemDictionary::oops_do(adjust_root_pointer_closure());
2446 ClassLoaderDataGraph::oops_do(adjust_root_pointer_closure(), adjust_klass_closure(), true);
2447
2448 // Now adjust pointers in remaining weak roots. (All of which should
2449 // have been cleared if they pointed to non-surviving objects.)
2450 // Global (weak) JNI handles
2451 JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());
2452
2453 CodeCache::oops_do(adjust_pointer_closure());
2454 StringTable::oops_do(adjust_root_pointer_closure());
2455 ref_processor()->weak_oops_do(adjust_root_pointer_closure());
2456 // Roots were visited so references into the young gen in roots
2457 // may have been scanned. Process them also.
2458 // Should the reference processor have a span that excludes
2459 // young gen objects?
|
2419 }
2420
2421 // This should be moved to the shared markSweep code!
2422 class PSAlwaysTrueClosure: public BoolObjectClosure {
2423 public:
2424 void do_object(oop p) { ShouldNotReachHere(); }
2425 bool do_object_b(oop p) { return true; }
2426 };
2427 static PSAlwaysTrueClosure always_true;
2428
2429 void PSParallelCompact::adjust_roots() {
2430 // Adjust the pointers to reflect the new locations
2431 TraceTime tm("adjust roots", print_phases(), true, gclog_or_tty);
2432
2433 // Need new claim bits when tracing through and adjusting pointers.
2434 ClassLoaderDataGraph::clear_claimed_marks();
2435
2436 // General strong roots.
2437 Universe::oops_do(adjust_root_pointer_closure());
2438 JNIHandles::oops_do(adjust_root_pointer_closure()); // Global (strong) JNI handles
2439 CLDToOopClosure adjust_from_cld(adjust_root_pointer_closure());
2440 Threads::oops_do(adjust_root_pointer_closure(), &adjust_from_cld, NULL);
2441 ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
2442 FlatProfiler::oops_do(adjust_root_pointer_closure());
2443 Management::oops_do(adjust_root_pointer_closure());
2444 JvmtiExport::oops_do(adjust_root_pointer_closure());
2445 // SO_AllClasses
2446 SystemDictionary::oops_do(adjust_root_pointer_closure());
2447 ClassLoaderDataGraph::oops_do(adjust_root_pointer_closure(), adjust_klass_closure(), true);
2448
2449 // Now adjust pointers in remaining weak roots. (All of which should
2450 // have been cleared if they pointed to non-surviving objects.)
2451 // Global (weak) JNI handles
2452 JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());
2453
2454 CodeCache::oops_do(adjust_pointer_closure());
2455 StringTable::oops_do(adjust_root_pointer_closure());
2456 ref_processor()->weak_oops_do(adjust_root_pointer_closure());
2457 // Roots were visited so references into the young gen in roots
2458 // may have been scanned. Process them also.
2459 // Should the reference processor have a span that excludes
2460 // young gen objects?
|