aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Zhengyu Gu <zgu@openjdk.org> 2021-05-12 12:34:55 +0000
committerGravatar Zhengyu Gu <zgu@openjdk.org> 2021-05-12 12:34:55 +0000
commit69daedfd2316815f63d7f3c6ba79d2bb77b427ec (patch)
treebbeb74b76578e86f9dfd0ebcfd322ab5eb5edb0a
parent7433821910cc292b0022ba5ed77235b4b71d242c (diff)
downloadjdk-master.tar.gz
jdk-master.zip
8266845: Shenandoah: Simplify SBS::load_reference_barrier implementationHEADmaster
Reviewed-by: shade
-rw-r--r--src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
index cc8c8ce5f77..b15542ac3fb 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
@@ -100,9 +100,12 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
template <DecoratorSet decorators, class T>
inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj, T* load_addr) {
+ if (obj == NULL) {
+ return NULL;
+ }
// Prevent resurrection of unreachable phantom (i.e. weak-native) references.
- if (HasDecorator<decorators, ON_PHANTOM_OOP_REF>::value && obj != NULL &&
+ if (HasDecorator<decorators, ON_PHANTOM_OOP_REF>::value &&
_heap->is_concurrent_weak_root_in_progress() &&
!_heap->marking_context()->is_marked(obj)) {
return NULL;
@@ -110,14 +113,14 @@ inline oop ShenandoahBarrierSet::load_reference_barrier(oop obj, T* load_addr) {
// Prevent resurrection of unreachable weak references.
if ((HasDecorator<decorators, ON_WEAK_OOP_REF>::value || HasDecorator<decorators, ON_UNKNOWN_OOP_REF>::value) &&
- obj != NULL && _heap->is_concurrent_weak_root_in_progress() &&
+ _heap->is_concurrent_weak_root_in_progress() &&
!_heap->marking_context()->is_marked_strong(obj)) {
return NULL;
}
// Prevent resurrection of unreachable objects that are visited during
// concurrent class-unloading.
- if (HasDecorator<decorators, AS_NO_KEEPALIVE>::value && obj != NULL &&
+ if (HasDecorator<decorators, AS_NO_KEEPALIVE>::value &&
_heap->is_evacuation_in_progress() &&
!_heap->marking_context()->is_marked(obj)) {
return obj;