< prev index next >

src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp

Print this page
*** 30,10 ***
--- 30,11 ---
  #include "gc/g1/g1Allocator.inline.hpp"
  #include "gc/g1/g1FullCollector.inline.hpp"
  #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  #include "gc/g1/g1FullGCMarker.inline.hpp"
  #include "gc/g1/heapRegionRemSet.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
  #include "memory/iterator.inline.hpp"
  #include "memory/universe.hpp"
  #include "oops/access.inline.hpp"
  #include "oops/compressedOops.inline.hpp"
  #include "oops/oop.inline.hpp"

*** 75,22 ***
      // We never forward objects in non-compacting regions so there is no need to
      // process them further.
      return;
    }
  
!   oop forwardee = obj->forwardee();
-   if (forwardee == NULL) {
      // Not forwarded, return current reference.
      assert(obj->mark() == markWord::prototype_for_klass(obj->klass()) || // Correct mark
             obj->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
             (UseBiasedLocking && obj->has_bias_pattern()), // Will be restored by BiasedLocking
             "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
             p2i(obj), obj->mark().value(), markWord::prototype_for_klass(obj->klass()).value());
      return;
    }
  
    // Forwarded, just update.
    assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
    RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
  }
  
  inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
--- 76,24 ---
      // We never forward objects in non-compacting regions so there is no need to
      // process them further.
      return;
    }
  
!   if (!obj->is_forwarded()) {
      // Not forwarded, return current reference.
+     /*
      assert(obj->mark() == markWord::prototype_for_klass(obj->klass()) || // Correct mark
             obj->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
             (UseBiasedLocking && obj->has_bias_pattern()), // Will be restored by BiasedLocking
             "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
             p2i(obj), obj->mark().value(), markWord::prototype_for_klass(obj->klass()).value());
+     */
      return;
    }
  
    // Forwarded, just update.
+   oop forwardee = _forwarding->forwardee(obj);
    assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
    RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
  }
  
  inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
< prev index next >