changeset 57568:5bc878966264

8237369: Shenandoah: failed vmTestbase/nsk/jvmti/AttachOnDemand/attach021/TestDescription.java test Reviewed-by: rkennke
author zgu
date Thu, 16 Jan 2020 14:22:35 -0500
parents b4ccf83030cf
children cf3ce4ee50bf
files src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Jan 16 17:25:04 2020 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Thu Jan 16 14:22:35 2020 -0500
@@ -1330,7 +1330,12 @@
 
 // Keep alive an object that was loaded with AS_NO_KEEPALIVE.
 void ShenandoahHeap::keep_alive(oop obj) {
-  ShenandoahBarrierSet::barrier_set()->enqueue(obj);
+  if (is_concurrent_mark_in_progress()) {
+    ShenandoahBarrierSet::barrier_set()->enqueue(obj);
+  } else {
+    // Otherwise, it must be live, guaranteed by LRB
+    shenandoah_assert_marked_if(NULL, obj, has_forwarded_objects());
+  }
 }
 
 void ShenandoahHeap::heap_region_iterate(ShenandoahHeapRegionClosure* blk) const {