Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 453:c96030fff130
6684579: SoftReference processing can be made more efficient
Summary: For current soft-ref clearing policies, we can decide at marking time if a soft-reference will definitely not be cleared, postponing the decision of whether it will definitely be cleared to the final reference processing phase. This can be especially beneficial in the case of concurrent collectors where the marking is usually concurrent but reference processing is usually not.
Reviewed-by: jmasa
author | ysr |
---|---|
date | Thu, 20 Nov 2008 16:56:09 -0800 |
parents | 078b8a0d8d7c |
children | 27a80744a83b |
comparison
equal
deleted
inserted
replaced
452:00b023ae2d78 | 453:c96030fff130 |
---|---|
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 |