< prev index next >

src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp

Print this page
@@ -32,10 +32,11 @@
  #include "gc/g1/g1FullGCPrepareTask.hpp"
  #include "gc/g1/g1HotCardCache.hpp"
  #include "gc/g1/heapRegion.inline.hpp"
  #include "gc/shared/gcTraceTime.inline.hpp"
  #include "gc/shared/referenceProcessor.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
  #include "logging/log.hpp"
  #include "memory/iterator.inline.hpp"
  #include "oops/oop.inline.hpp"
  #include "utilities/ticks.hpp"
  

@@ -155,28 +156,31 @@
      hcc->reset_card_counts(hr);
    }
  }
  
  G1FullGCPrepareTask::G1PrepareCompactLiveClosure::G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp) :
-     _cp(cp) { }
+     _cp(cp), _forwarding(G1CollectedHeap::heap()->forwarding()) { }
  
  size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosure::apply(oop object) {
    size_t size = object->size();
-   _cp->forward(object, size);
+   _cp->forward(_forwarding, object, size);
    return size;
  }
  
  size_t G1FullGCPrepareTask::G1RePrepareClosure::apply(oop obj) {
    // We only re-prepare objects forwarded within the current region, so
    // skip objects that are already forwarded to another region.
-   if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) {
-     return obj->size();
+   if (obj->is_forwarded()) {
+     oop forwarded_to = _forwarding->forwardee(obj);
+     if (!_current->is_in(forwarded_to)) {
+       return obj->size();
+     }
    }
  
    // Get size and forward.
    size_t size = obj->size();
-   _cp->forward(obj, size);
+   _cp->forward(_forwarding, obj, size);
  
    return size;
  }
  
  void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction_work(G1FullGCCompactionPoint* cp,
< prev index next >