< prev index next >

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

Print this page
*** 25,10 ***
--- 25,11 ---
  #include "precompiled.hpp"
  #include "gc/g1/g1FullCollector.inline.hpp"
  #include "gc/g1/g1FullGCCompactionPoint.hpp"
  #include "gc/g1/g1HeapRegion.hpp"
  #include "gc/shared/preservedMarks.inline.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
  #include "oops/oop.inline.hpp"
  #include "utilities/debug.hpp"
  
  G1FullGCCompactionPoint::G1FullGCCompactionPoint(G1FullCollector* collector, PreservedMarks* preserved_stack) :
      _collector(collector),

*** 104,14 ***
    // Store a forwarding pointer if the object should be moved.
    if (cast_from_oop<HeapWord*>(object) != _compaction_top) {
      if (!object->is_forwarded()) {
        preserved_stack()->push_if_necessary(object, object->mark());
      }
!     object->forward_to(cast_to_oop(_compaction_top));
!     assert(object->is_forwarded(), "must be forwarded");
    } else {
!     assert(!object->is_forwarded(), "must not be forwarded");
    }
  
    // Update compaction values.
    _compaction_top += size;
    _current_region->update_bot_for_block(_compaction_top - size, _compaction_top);
--- 105,14 ---
    // Store a forwarding pointer if the object should be moved.
    if (cast_from_oop<HeapWord*>(object) != _compaction_top) {
      if (!object->is_forwarded()) {
        preserved_stack()->push_if_necessary(object, object->mark());
      }
!     SlidingForwarding::forward_to(object, cast_to_oop(_compaction_top));
!     assert(SlidingForwarding::is_forwarded(object), "must be forwarded");
    } else {
!     assert(SlidingForwarding::is_not_forwarded(object), "must not be forwarded");
    }
  
    // Update compaction values.
    _compaction_top += size;
    _current_region->update_bot_for_block(_compaction_top - size, _compaction_top);

*** 170,12 ***
  
    // Preserve the mark for the humongous object as the region was initially not compacting.
    preserved_stack()->push_if_necessary(obj, obj->mark());
  
    G1HeapRegion* dest_hr = _compaction_regions->at(range_begin);
!   obj->forward_to(cast_to_oop(dest_hr->bottom()));
!   assert(obj->is_forwarded(), "Object must be forwarded!");
  
    // Add the humongous object regions to the compaction point.
    add_humongous(hr);
  
    // Remove covered regions from compaction target candidates.
--- 171,12 ---
  
    // Preserve the mark for the humongous object as the region was initially not compacting.
    preserved_stack()->push_if_necessary(obj, obj->mark());
  
    G1HeapRegion* dest_hr = _compaction_regions->at(range_begin);
!   SlidingForwarding::forward_to(obj, cast_to_oop(dest_hr->bottom()));
!   assert(SlidingForwarding::is_forwarded(obj), "Object must be forwarded!");
  
    // Add the humongous object regions to the compaction point.
    add_humongous(hr);
  
    // Remove covered regions from compaction target candidates.
< prev index next >