8047819: G1 HeapRegionDCTOC does not need to inherit ContiguousSpaceDCTOC

Wed, 25 Jun 2014 10:55:10 +0200

author
mgerdin
date
Wed, 25 Jun 2014 10:55:10 +0200
changeset 6986
e635a728f9da
parent 6985
c64b6b0c40c8
child 6987
9441d22e429a

8047819: G1 HeapRegionDCTOC does not need to inherit ContiguousSpaceDCTOC
Reviewed-by: stefank, tschatzl

src/share/vm/gc_implementation/g1/heapRegion.cpp file | annotate | diff | comparison | revisions
src/share/vm/gc_implementation/g1/heapRegion.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Jun 25 08:56:57 2014 +0200
     1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Jun 25 10:55:10 2014 +0200
     1.3 @@ -48,7 +48,7 @@
     1.4                                   HeapRegion* hr, ExtendedOopClosure* cl,
     1.5                                   CardTableModRefBS::PrecisionStyle precision,
     1.6                                   FilterKind fk) :
     1.7 -  ContiguousSpaceDCTOC(hr, cl, precision, NULL),
     1.8 +  DirtyCardToOopClosure(hr, cl, precision, NULL),
     1.9    _hr(hr), _fk(fk), _g1(g1) { }
    1.10  
    1.11  FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r,
    1.12 @@ -77,19 +77,18 @@
    1.13    return cur;
    1.14  }
    1.15  
    1.16 -void HeapRegionDCTOC::walk_mem_region_with_cl(MemRegion mr,
    1.17 -                                              HeapWord* bottom,
    1.18 -                                              HeapWord* top,
    1.19 -                                              ExtendedOopClosure* cl) {
    1.20 +void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
    1.21 +                                      HeapWord* bottom,
    1.22 +                                      HeapWord* top) {
    1.23    G1CollectedHeap* g1h = _g1;
    1.24    int oop_size;
    1.25    ExtendedOopClosure* cl2 = NULL;
    1.26  
    1.27 -  FilterIntoCSClosure intoCSFilt(this, g1h, cl);
    1.28 -  FilterOutOfRegionClosure outOfRegionFilt(_hr, cl);
    1.29 +  FilterIntoCSClosure intoCSFilt(this, g1h, _cl);
    1.30 +  FilterOutOfRegionClosure outOfRegionFilt(_hr, _cl);
    1.31  
    1.32    switch (_fk) {
    1.33 -  case NoFilterKind:          cl2 = cl; break;
    1.34 +  case NoFilterKind:          cl2 = _cl; break;
    1.35    case IntoCSFilterKind:      cl2 = &intoCSFilt; break;
    1.36    case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break;
    1.37    default:                    ShouldNotReachHere();
    1.38 @@ -111,17 +110,17 @@
    1.39      // We replicate the loop below for several kinds of possible filters.
    1.40      switch (_fk) {
    1.41      case NoFilterKind:
    1.42 -      bottom = walk_mem_region_loop(cl, g1h, _hr, bottom, top);
    1.43 +      bottom = walk_mem_region_loop(_cl, g1h, _hr, bottom, top);
    1.44        break;
    1.45  
    1.46      case IntoCSFilterKind: {
    1.47 -      FilterIntoCSClosure filt(this, g1h, cl);
    1.48 +      FilterIntoCSClosure filt(this, g1h, _cl);
    1.49        bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
    1.50        break;
    1.51      }
    1.52  
    1.53      case OutOfRegionFilterKind: {
    1.54 -      FilterOutOfRegionClosure filt(_hr, cl);
    1.55 +      FilterOutOfRegionClosure filt(_hr, _cl);
    1.56        bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
    1.57        break;
    1.58      }
     2.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Jun 25 08:56:57 2014 +0200
     2.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Jun 25 10:55:10 2014 +0200
     2.3 @@ -71,7 +71,7 @@
     2.4  // in the concurrent marker used by G1 to filter remembered
     2.5  // sets.
     2.6  
     2.7 -class HeapRegionDCTOC : public ContiguousSpaceDCTOC {
     2.8 +class HeapRegionDCTOC : public DirtyCardToOopClosure {
     2.9  public:
    2.10    // Specification of possible DirtyCardToOopClosure filtering.
    2.11    enum FilterKind {
    2.12 @@ -85,39 +85,13 @@
    2.13    FilterKind _fk;
    2.14    G1CollectedHeap* _g1;
    2.15  
    2.16 -  void walk_mem_region_with_cl(MemRegion mr,
    2.17 -                               HeapWord* bottom, HeapWord* top,
    2.18 -                               ExtendedOopClosure* cl);
    2.19 -
    2.20 -  // We don't specialize this for FilteringClosure; filtering is handled by
    2.21 -  // the "FilterKind" mechanism.  But we provide this to avoid a compiler
    2.22 -  // warning.
    2.23 -  void walk_mem_region_with_cl(MemRegion mr,
    2.24 -                               HeapWord* bottom, HeapWord* top,
    2.25 -                               FilteringClosure* cl) {
    2.26 -    HeapRegionDCTOC::walk_mem_region_with_cl(mr, bottom, top,
    2.27 -                                             (ExtendedOopClosure*)cl);
    2.28 -  }
    2.29 -
    2.30 -  // Get the actual top of the area on which the closure will
    2.31 -  // operate, given where the top is assumed to be (the end of the
    2.32 -  // memory region passed to do_MemRegion) and where the object
    2.33 -  // at the top is assumed to start. For example, an object may
    2.34 -  // start at the top but actually extend past the assumed top,
    2.35 -  // in which case the top becomes the end of the object.
    2.36 -  HeapWord* get_actual_top(HeapWord* top, HeapWord* top_obj) {
    2.37 -    return ContiguousSpaceDCTOC::get_actual_top(top, top_obj);
    2.38 -  }
    2.39 -
    2.40    // Walk the given memory region from bottom to (actual) top
    2.41    // looking for objects and applying the oop closure (_cl) to
    2.42    // them. The base implementation of this treats the area as
    2.43    // blocks, where a block may or may not be an object. Sub-
    2.44    // classes should override this to provide more accurate
    2.45    // or possibly more efficient walking.
    2.46 -  void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top) {
    2.47 -    Filtering_DCTOC::walk_mem_region(mr, bottom, top);
    2.48 -  }
    2.49 +  void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top);
    2.50  
    2.51  public:
    2.52    HeapRegionDCTOC(G1CollectedHeap* g1,

mercurial