comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 20272:e635a728f9da

8047819: G1 HeapRegionDCTOC does not need to inherit ContiguousSpaceDCTOC Reviewed-by: stefank, tschatzl
author mgerdin
date Wed, 25 Jun 2014 10:55:10 +0200
parents c49dcaf78a65
children a8137787acfe
comparison
equal deleted inserted replaced
20271:c64b6b0c40c8 20272:e635a728f9da
46 46
47 HeapRegionDCTOC::HeapRegionDCTOC(G1CollectedHeap* g1, 47 HeapRegionDCTOC::HeapRegionDCTOC(G1CollectedHeap* g1,
48 HeapRegion* hr, ExtendedOopClosure* cl, 48 HeapRegion* hr, ExtendedOopClosure* cl,
49 CardTableModRefBS::PrecisionStyle precision, 49 CardTableModRefBS::PrecisionStyle precision,
50 FilterKind fk) : 50 FilterKind fk) :
51 ContiguousSpaceDCTOC(hr, cl, precision, NULL), 51 DirtyCardToOopClosure(hr, cl, precision, NULL),
52 _hr(hr), _fk(fk), _g1(g1) { } 52 _hr(hr), _fk(fk), _g1(g1) { }
53 53
54 FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r, 54 FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r,
55 OopClosure* oc) : 55 OopClosure* oc) :
56 _r_bottom(r->bottom()), _r_end(r->end()), _oc(oc) { } 56 _r_bottom(r->bottom()), _r_end(r->end()), _oc(oc) { }
75 next_obj = cur + oop_size; 75 next_obj = cur + oop_size;
76 } 76 }
77 return cur; 77 return cur;
78 } 78 }
79 79
80 void HeapRegionDCTOC::walk_mem_region_with_cl(MemRegion mr, 80 void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
81 HeapWord* bottom, 81 HeapWord* bottom,
82 HeapWord* top, 82 HeapWord* top) {
83 ExtendedOopClosure* cl) {
84 G1CollectedHeap* g1h = _g1; 83 G1CollectedHeap* g1h = _g1;
85 int oop_size; 84 int oop_size;
86 ExtendedOopClosure* cl2 = NULL; 85 ExtendedOopClosure* cl2 = NULL;
87 86
88 FilterIntoCSClosure intoCSFilt(this, g1h, cl); 87 FilterIntoCSClosure intoCSFilt(this, g1h, _cl);
89 FilterOutOfRegionClosure outOfRegionFilt(_hr, cl); 88 FilterOutOfRegionClosure outOfRegionFilt(_hr, _cl);
90 89
91 switch (_fk) { 90 switch (_fk) {
92 case NoFilterKind: cl2 = cl; break; 91 case NoFilterKind: cl2 = _cl; break;
93 case IntoCSFilterKind: cl2 = &intoCSFilt; break; 92 case IntoCSFilterKind: cl2 = &intoCSFilt; break;
94 case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break; 93 case OutOfRegionFilterKind: cl2 = &outOfRegionFilt; break;
95 default: ShouldNotReachHere(); 94 default: ShouldNotReachHere();
96 } 95 }
97 96
109 108
110 if (bottom < top) { 109 if (bottom < top) {
111 // We replicate the loop below for several kinds of possible filters. 110 // We replicate the loop below for several kinds of possible filters.
112 switch (_fk) { 111 switch (_fk) {
113 case NoFilterKind: 112 case NoFilterKind:
114 bottom = walk_mem_region_loop(cl, g1h, _hr, bottom, top); 113 bottom = walk_mem_region_loop(_cl, g1h, _hr, bottom, top);
115 break; 114 break;
116 115
117 case IntoCSFilterKind: { 116 case IntoCSFilterKind: {
118 FilterIntoCSClosure filt(this, g1h, cl); 117 FilterIntoCSClosure filt(this, g1h, _cl);
119 bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top); 118 bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
120 break; 119 break;
121 } 120 }
122 121
123 case OutOfRegionFilterKind: { 122 case OutOfRegionFilterKind: {
124 FilterOutOfRegionClosure filt(_hr, cl); 123 FilterOutOfRegionClosure filt(_hr, _cl);
125 bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top); 124 bottom = walk_mem_region_loop(&filt, g1h, _hr, bottom, top);
126 break; 125 break;
127 } 126 }
128 127
129 default: 128 default: