< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp

Print this page
rev 57589 : 8237632: Shenandoah fails some vmTestbase_nsk_jvmti tests with "Forwardee must point to a heap address"

@@ -174,11 +174,14 @@
       // beats us with an arraycopy, which first copies the array, which potentially contains
       // from-space refs, and only afterwards updates all from-space refs to to-space refs,
       // which leaves a short window where the new array elements can be from-space.
       // In this case, we can just resolve the result again. As we resolve, we need to consider
       // the contended write might have been NULL.
-      oop result = ShenandoahBarrierSet::resolve_forwarded(witness);
+      oop result = witness;
+      if (!CompressedOops::is_null(witness) && in_collection_set(witness)) {
+        result = ShenandoahBarrierSet::resolve_forwarded(witness);
+      }
       shenandoah_assert_not_forwarded_except(p, result, (result == NULL));
       shenandoah_assert_not_in_cset_except(p, result, (result == NULL) || cancelled_gc());
       return result;
     } else {
       // Success! We have updated with known to-space copy. We have already asserted it is sane.

@@ -315,11 +318,11 @@
 }
 
 template<bool RESOLVE>
 inline bool ShenandoahHeap::requires_marking(const void* entry) const {
   oop obj = oop(entry);
-  if (RESOLVE) {
+  if (RESOLVE && in_collection_set(obj)) {
     obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
   }
   return !_marking_context->is_marked(obj);
 }
 
< prev index next >