OpenJDK / jdk / jdk
changeset 57823:5da30ab42c85
8237645: Remove OopsInGenClosure::par_do_barrier
Reviewed-by: sjohanss
author | stefank |
---|---|
date | Fri, 24 Jan 2020 09:24:46 +0100 |
parents | d757771b92a4 |
children | 5a7864630f91 |
files | src/hotspot/share/gc/shared/cardTableRS.cpp src/hotspot/share/gc/shared/cardTableRS.hpp src/hotspot/share/gc/shared/genOopClosures.hpp src/hotspot/share/gc/shared/genOopClosures.inline.hpp |
diffstat | 4 files changed, 0 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/cardTableRS.cpp Fri Jan 24 09:15:08 2020 +0100 +++ b/src/hotspot/share/gc/shared/cardTableRS.cpp Fri Jan 24 09:24:46 2020 +0100 @@ -244,40 +244,6 @@ } } -// clean (by dirty->clean before) ==> cur_younger_gen -// dirty ==> cur_youngergen_and_prev_nonclean_card -// precleaned ==> cur_youngergen_and_prev_nonclean_card -// prev-younger-gen ==> cur_youngergen_and_prev_nonclean_card -// cur-younger-gen ==> cur_younger_gen -// cur_youngergen_and_prev_nonclean_card ==> no change. -void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { - volatile CardValue* entry = byte_for(field); - do { - CardValue entry_val = *entry; - // We put this first because it's probably the most common case. - if (entry_val == clean_card_val()) { - // No threat of contention with cleaning threads. - *entry = cur_youngergen_card_val(); - return; - } else if (card_is_dirty_wrt_gen_iter(entry_val) - || is_prev_youngergen_card_val(entry_val)) { - // Mark it as both cur and prev youngergen; card cleaning thread will - // eventually remove the previous stuff. - CardValue new_val = cur_youngergen_and_prev_nonclean_card; - CardValue res = Atomic::cmpxchg(entry, entry_val, new_val); - // Did the CAS succeed? - if (res == entry_val) return; - // Otherwise, retry, to see the new value. - continue; - } else { - assert(entry_val == cur_youngergen_and_prev_nonclean_card - || entry_val == cur_youngergen_card_val(), - "should be only possibilities."); - return; - } - } while (true); -} - void CardTableRS::younger_refs_in_space_iterate(Space* sp, OopsInGenClosure* cl, uint n_threads) {
--- a/src/hotspot/share/gc/shared/cardTableRS.hpp Fri Jan 24 09:15:08 2020 +0100 +++ b/src/hotspot/share/gc/shared/cardTableRS.hpp Fri Jan 24 09:24:46 2020 +0100 @@ -124,11 +124,6 @@ inline_write_ref_field_gc(field, new_val); } - // Override. Might want to devirtualize this in the same fashion as - // above. Ensures that the value of the card for field says that it's - // a younger card in the current collection. - virtual void write_ref_field_gc_par(void* field, oop new_val); - bool is_aligned(HeapWord* addr) { return is_card_aligned(addr); }
--- a/src/hotspot/share/gc/shared/genOopClosures.hpp Fri Jan 24 09:15:08 2020 +0100 +++ b/src/hotspot/share/gc/shared/genOopClosures.hpp Fri Jan 24 09:24:46 2020 +0100 @@ -57,9 +57,6 @@ // pointers must call the method below. template <class T> void do_barrier(T* p); - // Version for use by closures that may be called in parallel code. - template <class T> void par_do_barrier(T* p); - public: OopsInGenClosure() : OopIterateClosure(NULL), _orig_gen(NULL), _gen(NULL), _gen_boundary(NULL), _rs(NULL) {};
--- a/src/hotspot/share/gc/shared/genOopClosures.inline.hpp Fri Jan 24 09:15:08 2020 +0100 +++ b/src/hotspot/share/gc/shared/genOopClosures.inline.hpp Fri Jan 24 09:24:46 2020 +0100 @@ -62,17 +62,6 @@ } } -template <class T> inline void OopsInGenClosure::par_do_barrier(T* p) { - assert(generation()->is_in_reserved(p), "expected ref in generation"); - T heap_oop = RawAccess<>::oop_load(p); - assert(!CompressedOops::is_null(heap_oop), "expected non-null oop"); - oop obj = CompressedOops::decode_not_null(heap_oop); - // If p points to a younger generation, mark the card. - if ((HeapWord*)obj < gen_boundary()) { - rs()->write_ref_field_gc_par(p, obj); - } -} - inline BasicOopsInGenClosure::BasicOopsInGenClosure(Generation* gen) : OopsInGenClosure(gen) { }