< prev index next >
src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp
Print this page
rev 50453 : imported patch 02.removeInArchiveRoot
rev 50454 : imported patch cleanups
@@ -52,19 +52,18 @@
// Take a slow path for cards in old
write_ref_field_post_slow(byte);
}
}
-inline void G1BarrierSet::enqueue_if_weak_or_archive(DecoratorSet decorators, oop value) {
+inline void G1BarrierSet::enqueue_if_weak(DecoratorSet decorators, oop value) {
assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
- // Archive roots need to be enqueued since they add subgraphs to the
- // Java heap that were not there at the snapshot when marking started.
- // Weak and phantom references also need enqueueing for similar reasons.
- const bool in_archive_root = (decorators & IN_ARCHIVE_ROOT) != 0;
+ // Loading from a weak or phantom reference needs enqueueing, as
+ // the object may not have been reachable (part of the snapshot)
+ // when marking started.
const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
const bool peek = (decorators & AS_NO_KEEPALIVE) != 0;
- const bool needs_enqueue = in_archive_root || (!peek && !on_strong_oop_ref);
+ const bool needs_enqueue = (!peek && !on_strong_oop_ref);
if (needs_enqueue && value != NULL) {
enqueue(value);
}
}
@@ -72,28 +71,28 @@
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
oop_load_not_in_heap(T* addr) {
oop value = ModRef::oop_load_not_in_heap(addr);
- enqueue_if_weak_or_archive(decorators, value);
+ enqueue_if_weak(decorators, value);
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
oop_load_in_heap(T* addr) {
oop value = ModRef::oop_load_in_heap(addr);
- enqueue_if_weak_or_archive(decorators, value);
+ enqueue_if_weak(decorators, value);
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
oop_load_in_heap_at(oop base, ptrdiff_t offset) {
oop value = ModRef::oop_load_in_heap_at(base, offset);
- enqueue_if_weak_or_archive(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
+ enqueue_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
return value;
}
template <DecoratorSet decorators, typename BarrierSetT>
template <typename T>
< prev index next >