< prev index next >

src/hotspot/share/gc/serial/markSweep.cpp

Print this page
*** 24,10 ***
--- 24,11 ---
  
  #include "precompiled.hpp"
  #include "compiler/compileBroker.hpp"
  #include "gc/serial/markSweep.inline.hpp"
  #include "gc/shared/collectedHeap.inline.hpp"
+ #include "gc/shared/genCollectedHeap.hpp"
  #include "gc/shared/gcTimer.hpp"
  #include "gc/shared/gcTrace.hpp"
  #include "gc/shared/gc_globals.hpp"
  #include "memory/iterator.inline.hpp"
  #include "memory/universe.hpp"

*** 61,11 ***
  
  MarkSweep::FollowRootClosure  MarkSweep::follow_root_closure;
  
  MarkAndPushClosure MarkSweep::mark_and_push_closure;
  CLDToOopClosure    MarkSweep::follow_cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong);
- CLDToOopClosure    MarkSweep::adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_strong);
  
  template <class T> inline void MarkSweep::KeepAliveClosure::do_oop_work(T* p) {
    mark_and_push(p);
  }
  
--- 62,10 ---

*** 143,12 ***
  }
  
  void MarkSweep::FollowRootClosure::do_oop(oop* p)       { follow_root(p); }
  void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); }
  
! void PreservedMark::adjust_pointer() {
!   MarkSweep::adjust_pointer(&_obj);
  }
  
  void PreservedMark::restore() {
    _obj->set_mark(_mark);
  }
--- 143,12 ---
  }
  
  void MarkSweep::FollowRootClosure::do_oop(oop* p)       { follow_root(p); }
  void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); }
  
! void PreservedMark::adjust_pointer(const SlidingForwarding* const forwarding) {
!   MarkSweep::adjust_pointer(forwarding, &_obj);
  }
  
  void PreservedMark::restore() {
    _obj->set_mark(_mark);
  }

*** 171,23 ***
  void MarkSweep::set_ref_processor(ReferenceProcessor* rp) {
    _ref_processor = rp;
    mark_and_push_closure.set_ref_discoverer(_ref_processor);
  }
  
- AdjustPointerClosure MarkSweep::adjust_pointer_closure;
- 
  void MarkSweep::adjust_marks() {
    // adjust the oops we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
!     _preserved_marks[i].adjust_pointer();
    }
  
    // deal with the overflow stack
    StackIterator<PreservedMark, mtGC> iter(_preserved_overflow_stack);
    while (!iter.is_empty()) {
      PreservedMark* p = iter.next_addr();
!     p->adjust_pointer();
    }
  }
  
  void MarkSweep::restore_marks() {
    log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_overflow_stack.size());
--- 171,23 ---
  void MarkSweep::set_ref_processor(ReferenceProcessor* rp) {
    _ref_processor = rp;
    mark_and_push_closure.set_ref_discoverer(_ref_processor);
  }
  
  void MarkSweep::adjust_marks() {
+   const SlidingForwarding* const forwarding = GenCollectedHeap::heap()->forwarding();
+ 
    // adjust the oops we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
!     _preserved_marks[i].adjust_pointer(forwarding);
    }
  
    // deal with the overflow stack
    StackIterator<PreservedMark, mtGC> iter(_preserved_overflow_stack);
    while (!iter.is_empty()) {
      PreservedMark* p = iter.next_addr();
!     p->adjust_pointer(forwarding);
    }
  }
  
  void MarkSweep::restore_marks() {
    log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_overflow_stack.size());
< prev index next >