src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

changeset 6231
889068b9a088
parent 6229
5a32d2a3cc1e
child 6267
a034dc5e910b
     1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Jan 20 11:47:29 2014 +0100
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Mon Jan 20 11:47:53 2014 +0100
     1.3 @@ -50,8 +50,8 @@
     1.4  #include "gc_implementation/shared/gcTraceTime.hpp"
     1.5  #include "gc_implementation/shared/isGCActiveMark.hpp"
     1.6  #include "memory/gcLocker.inline.hpp"
     1.7 -#include "memory/genOopClosures.inline.hpp"
     1.8  #include "memory/generationSpec.hpp"
     1.9 +#include "memory/iterator.hpp"
    1.10  #include "memory/referenceProcessor.hpp"
    1.11  #include "oops/oop.inline.hpp"
    1.12  #include "oops/oop.pcgc.inline.hpp"
    1.13 @@ -3096,11 +3096,7 @@
    1.14    return NULL; // keep some compilers happy
    1.15  }
    1.16  
    1.17 -// TODO: VerifyRootsClosure extends OopsInGenClosure so that we can
    1.18 -//       pass it as the perm_blk to SharedHeap::process_strong_roots.
    1.19 -//       When process_strong_roots stop calling perm_blk->younger_refs_iterate
    1.20 -//       we can change this closure to extend the simpler OopClosure.
    1.21 -class VerifyRootsClosure: public OopsInGenClosure {
    1.22 +class VerifyRootsClosure: public OopClosure {
    1.23  private:
    1.24    G1CollectedHeap* _g1h;
    1.25    VerifyOption     _vo;
    1.26 @@ -3136,7 +3132,7 @@
    1.27    void do_oop(narrowOop* p) { do_oop_nv(p); }
    1.28  };
    1.29  
    1.30 -class G1VerifyCodeRootOopClosure: public OopsInGenClosure {
    1.31 +class G1VerifyCodeRootOopClosure: public OopClosure {
    1.32    G1CollectedHeap* _g1h;
    1.33    OopClosure* _root_cl;
    1.34    nmethod* _nm;
    1.35 @@ -4670,8 +4666,8 @@
    1.36    _during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()),
    1.37    _mark_in_progress(_g1->mark_in_progress()) { }
    1.38  
    1.39 -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
    1.40 -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>::mark_object(oop obj) {
    1.41 +template <G1Barrier barrier, bool do_mark_object>
    1.42 +void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) {
    1.43  #ifdef ASSERT
    1.44    HeapRegion* hr = _g1->heap_region_containing(obj);
    1.45    assert(hr != NULL, "sanity");
    1.46 @@ -4682,8 +4678,8 @@
    1.47    _cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
    1.48  }
    1.49  
    1.50 -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
    1.51 -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
    1.52 +template <G1Barrier barrier, bool do_mark_object>
    1.53 +void G1ParCopyClosure<barrier, do_mark_object>
    1.54    ::mark_forwarded_object(oop from_obj, oop to_obj) {
    1.55  #ifdef ASSERT
    1.56    assert(from_obj->is_forwarded(), "from obj should be forwarded");
    1.57 @@ -4706,8 +4702,8 @@
    1.58    _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);
    1.59  }
    1.60  
    1.61 -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
    1.62 -oop G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
    1.63 +template <G1Barrier barrier, bool do_mark_object>
    1.64 +oop G1ParCopyClosure<barrier, do_mark_object>
    1.65    ::copy_to_survivor_space(oop old) {
    1.66    size_t word_sz = old->size();
    1.67    HeapRegion* from_region = _g1->heap_region_containing_raw(old);
    1.68 @@ -4803,13 +4799,11 @@
    1.69    }
    1.70  }
    1.71  
    1.72 -template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
    1.73 +template <G1Barrier barrier, bool do_mark_object>
    1.74  template <class T>
    1.75 -void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
    1.76 +void G1ParCopyClosure<barrier, do_mark_object>
    1.77  ::do_oop_work(T* p) {
    1.78    oop obj = oopDesc::load_decode_heap_oop(p);
    1.79 -  assert(barrier != G1BarrierRS || obj != NULL,
    1.80 -         "Precondition: G1BarrierRS implies obj is non-NULL");
    1.81  
    1.82    assert(_worker_id == _par_scan_state->queue_num(), "sanity");
    1.83  
    1.84 @@ -4829,10 +4823,7 @@
    1.85        mark_forwarded_object(obj, forwardee);
    1.86      }
    1.87  
    1.88 -    // When scanning the RS, we only care about objs in CS.
    1.89 -    if (barrier == G1BarrierRS) {
    1.90 -      _par_scan_state->update_rs(_from, p, _worker_id);
    1.91 -    } else if (barrier == G1BarrierKlass) {
    1.92 +    if (barrier == G1BarrierKlass) {
    1.93        do_klass_barrier(p, forwardee);
    1.94      }
    1.95    } else {
    1.96 @@ -4847,14 +4838,10 @@
    1.97    if (barrier == G1BarrierEvac && obj != NULL) {
    1.98      _par_scan_state->update_rs(_from, p, _worker_id);
    1.99    }
   1.100 -
   1.101 -  if (do_gen_barrier && obj != NULL) {
   1.102 -    par_do_barrier(p);
   1.103 -  }
   1.104 -}
   1.105 -
   1.106 -template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(oop* p);
   1.107 -template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(narrowOop* p);
   1.108 +}
   1.109 +
   1.110 +template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p);
   1.111 +template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(narrowOop* p);
   1.112  
   1.113  template <class T> void G1ParScanPartialArrayClosure::do_oop_nv(T* p) {
   1.114    assert(has_partial_array_mask(p), "invariant");

mercurial