< prev index next >

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

Print this page
*** 58,11 ***
  
  MarkSweep::FollowRootClosure  MarkSweep::follow_root_closure;
  
  MarkAndPushClosure MarkSweep::mark_and_push_closure(ClassLoaderData::_claim_stw_fullgc_mark);
  CLDToOopClosure    MarkSweep::follow_cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_stw_fullgc_mark);
- CLDToOopClosure    MarkSweep::adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_stw_fullgc_adjust);
  
  template <class T> void MarkSweep::KeepAliveClosure::do_oop_work(T* p) {
    mark_and_push(p);
  }
  
--- 58,10 ---

*** 162,16 ***
        java_lang_String::is_instance(obj) &&
        SerialStringDedup::is_candidate_from_mark(obj)) {
      _string_dedup_requests->add(obj);
    }
  
    // some marks may contain information we need to preserve so we store them away
    // and overwrite the mark.  We'll restore it at the end of markSweep.
    markWord mark = obj->mark();
!   obj->set_mark(markWord::prototype().set_marked());
- 
-   ContinuationGCSupport::transform_stack_chunk(obj);
  
    if (obj->mark_must_be_preserved(mark)) {
      preserve_mark(obj, mark);
    }
  }
--- 161,18 ---
        java_lang_String::is_instance(obj) &&
        SerialStringDedup::is_candidate_from_mark(obj)) {
      _string_dedup_requests->add(obj);
    }
  
+   // Do the transform while we still have the header intact,
+   // which might include important class information.
+   ContinuationGCSupport::transform_stack_chunk(obj);
+ 
    // some marks may contain information we need to preserve so we store them away
    // and overwrite the mark.  We'll restore it at the end of markSweep.
    markWord mark = obj->mark();
!   obj->set_mark(obj->prototype_mark().set_marked());
  
    if (obj->mark_must_be_preserved(mark)) {
      preserve_mark(obj, mark);
    }
  }

*** 190,22 ***
  template <typename T>
  void MarkAndPushClosure::do_oop_work(T* p)            { MarkSweep::mark_and_push(p); }
  void MarkAndPushClosure::do_oop(      oop* p)         { do_oop_work(p); }
  void MarkAndPushClosure::do_oop(narrowOop* p)         { do_oop_work(p); }
  
! AdjustPointerClosure MarkSweep::adjust_pointer_closure;
! 
- void MarkSweep::adjust_marks() {
    // adjust the oops we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
!     PreservedMarks::adjust_preserved_mark(_preserved_marks + i);
    }
  
    // deal with the overflow stack
    _preserved_overflow_stack_set.get()->adjust_during_full_gc();
  }
  
  void MarkSweep::restore_marks() {
    log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_overflow_stack_set.get()->size());
  
    // restore the marks we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
--- 191,29 ---
  template <typename T>
  void MarkAndPushClosure::do_oop_work(T* p)            { MarkSweep::mark_and_push(p); }
  void MarkAndPushClosure::do_oop(      oop* p)         { do_oop_work(p); }
  void MarkAndPushClosure::do_oop(narrowOop* p)         { do_oop_work(p); }
  
! template <bool ALT_FWD>
! void MarkSweep::adjust_marks_impl() {
    // adjust the oops we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
!     PreservedMarks::adjust_preserved_mark<ALT_FWD>(_preserved_marks + i);
    }
  
    // deal with the overflow stack
    _preserved_overflow_stack_set.get()->adjust_during_full_gc();
  }
  
+ void MarkSweep::adjust_marks() {
+   if (UseAltGCForwarding) {
+     adjust_marks_impl<true>();
+   } else {
+     adjust_marks_impl<false>();
+   }
+ }
+ 
  void MarkSweep::restore_marks() {
    log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_overflow_stack_set.get()->size());
  
    // restore the marks we saved earlier
    for (size_t i = 0; i < _preserved_count; i++) {
< prev index next >