< 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,31 +156,35 @@
      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) {
+   ShouldNotReachHere();
    // We only re-prepare objects forwarded within the current region, so
    // skip objects that are already forwarded to another region.
+   /*
    oop forwarded_to = obj->forwardee();
    if (forwarded_to != NULL && !_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;
+   */
+   return 0;
  }
  
  void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction_work(G1FullGCCompactionPoint* cp,
                                                                                    HeapRegion* hr) {
    G1PrepareCompactLiveClosure prepare_compact(cp);

@@ -196,24 +201,28 @@
    _cp->add(hr);
    prepare_for_compaction_work(_cp, hr);
  }
  
  void G1FullGCPrepareTask::prepare_serial_compaction() {
-   GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare Serial Compaction", collector()->scope()->timer());
+   ShouldNotReachHere(); // Disabled in Lilliput.
+   // GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare Serial Compaction", collector()->scope()->timer());
    // At this point we know that no regions were completely freed by
    // the parallel compaction. That means that the last region of
    // all compaction queues still have data in them. We try to compact
    // these regions in serial to avoid a premature OOM.
+   /*
    for (uint i = 0; i < collector()->workers(); i++) {
      G1FullGCCompactionPoint* cp = collector()->compaction_point(i);
      if (cp->has_regions()) {
        collector()->serial_compaction_point()->add(cp->remove_last());
      }
    }
+   */
  
    // Update the forwarding information for the regions in the serial
    // compaction point.
+   /*
    G1FullGCCompactionPoint* cp = collector()->serial_compaction_point();
    for (GrowableArrayIterator<HeapRegion*> it = cp->regions()->begin(); it != cp->regions()->end(); ++it) {
      HeapRegion* current = *it;
      if (!cp->is_initialized()) {
        // Initialize the compaction point. Nothing more is needed for the first heap region

@@ -225,10 +234,11 @@
        current->set_compaction_top(current->bottom());
        current->apply_to_marked_objects(collector()->mark_bitmap(), &re_prepare);
      }
    }
    cp->update();
+   */
  }
  
  bool G1FullGCPrepareTask::G1CalculatePointersClosure::freed_regions() {
    if (_regions_freed) {
      return true;
< prev index next >