889 |
889 |
890 // Temporarily clear _is_alive_non_header |
890 // Temporarily clear _is_alive_non_header |
891 ReferenceProcessorIsAliveMutator rp_is_alive_null(ref_processor(), NULL); |
891 ReferenceProcessorIsAliveMutator rp_is_alive_null(ref_processor(), NULL); |
892 |
892 |
893 ref_processor()->enable_discovery(); |
893 ref_processor()->enable_discovery(); |
|
894 ref_processor()->snap_policy(clear_all_soft_refs); |
894 |
895 |
895 // Do collection work |
896 // Do collection work |
896 { |
897 { |
897 HandleMark hm; // Discard invalid handles created during gc |
898 HandleMark hm; // Discard invalid handles created during gc |
898 G1MarkSweep::invoke_at_safepoint(ref_processor(), clear_all_soft_refs); |
899 G1MarkSweep::invoke_at_safepoint(ref_processor(), clear_all_soft_refs); |
2461 Universe::verify(false); |
2462 Universe::verify(false); |
2462 } |
2463 } |
2463 |
2464 |
2464 COMPILER2_PRESENT(DerivedPointerTable::clear()); |
2465 COMPILER2_PRESENT(DerivedPointerTable::clear()); |
2465 |
2466 |
2466 // We want to turn off ref discovere, if necessary, and turn it back on |
2467 // We want to turn off ref discovery, if necessary, and turn it back on |
2467 // on again later if we do. |
2468 // on again later if we do. |
2468 bool was_enabled = ref_processor()->discovery_enabled(); |
2469 bool was_enabled = ref_processor()->discovery_enabled(); |
2469 if (was_enabled) ref_processor()->disable_discovery(); |
2470 if (was_enabled) ref_processor()->disable_discovery(); |
2470 |
2471 |
2471 // Forget the current alloc region (we might even choose it to be part |
2472 // Forget the current alloc region (we might even choose it to be part |