< 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"

*** 61,11 ***
  
  inline void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) {
    _marker->follow_cld(cld);
  }
  
! template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
    T heap_oop = RawAccess<>::oop_load(p);
    if (CompressedOops::is_null(heap_oop)) {
      return;
    }
  
--- 62,12 ---
  
  inline void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) {
    _marker->follow_cld(cld);
  }
  
! template <bool ALT_FWD>
+ template <class T> inline void G1AdjustClosure<ALT_FWD>::adjust_pointer(T* p) {
    T heap_oop = RawAccess<>::oop_load(p);
    if (CompressedOops::is_null(heap_oop)) {
      return;
    }
  

*** 75,28 ***
      // 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); }
! inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
  
  inline bool G1IsAliveClosure::do_object_b(oop p) {
    return _bitmap->is_marked(p) || _collector->is_skip_marking(p);
  }
  
--- 77,32 ---
      // We never forward objects in non-compacting regions so there is no need to
      // process them further.
      return;
    }
  
!   if (!SlidingForwarding::is_forwarded(obj)) {
      // 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 = SlidingForwarding::forwardee<ALT_FWD>(obj);
    assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
    RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
  }
  
! template <bool ALT_FWD>
! inline void G1AdjustClosure<ALT_FWD>::do_oop(oop* p)       { do_oop_work(p); }
+ template <bool ALT_FWD>
+ inline void G1AdjustClosure<ALT_FWD>::do_oop(narrowOop* p) { do_oop_work(p); }
  
  inline bool G1IsAliveClosure::do_object_b(oop p) {
    return _bitmap->is_marked(p) || _collector->is_skip_marking(p);
  }
  
< prev index next >