65 // knows how to get the G1 heap and how to use the bitmap
66 // in the concurrent marker used by G1 to filter remembered
67 // sets.
68
69 class HeapRegionDCTOC : public DirtyCardToOopClosure {
70 private:
71 HeapRegion* _hr;
72 G1ParPushHeapRSClosure* _rs_scan;
73 G1CollectedHeap* _g1;
74
75 // Walk the given memory region from bottom to (actual) top
76 // looking for objects and applying the oop closure (_cl) to
77 // them. The base implementation of this treats the area as
78 // blocks, where a block may or may not be an object. Sub-
79 // classes should override this to provide more accurate
80 // or possibly more efficient walking.
81 void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top);
82
83 public:
84 HeapRegionDCTOC(G1CollectedHeap* g1,
85 HeapRegion* hr, G1ParPushHeapRSClosure* cl,
86 CardTableModRefBS::PrecisionStyle precision);
87 };
88
89 // The complicating factor is that BlockOffsetTable diverged
90 // significantly, and we need functionality that is only in the G1 version.
91 // So I copied that code, which led to an alternate G1 version of
92 // OffsetTableContigSpace. If the two versions of BlockOffsetTable could
93 // be reconciled, then G1OffsetTableContigSpace could go away.
94
95 // The idea behind time stamps is the following. We want to keep track of
96 // the highest address where it's safe to scan objects for each region.
97 // This is only relevant for current GC alloc regions so we keep a time stamp
98 // per region to determine if the region has been allocated during the current
99 // GC or not. If the time stamp is current we report a scan_top value which
100 // was saved at the end of the previous GC for retained alloc regions and which is
101 // equal to the bottom for all other regions.
102 // There is a race between card scanners and allocating gc workers where we must ensure
103 // that card scanners do not read the memory allocated by the gc workers.
104 // In order to enforce that, we must not return a value of _top which is more recent than the
105 // time stamp. This is due to the fact that a region may become a gc alloc region at
|
65 // knows how to get the G1 heap and how to use the bitmap
66 // in the concurrent marker used by G1 to filter remembered
67 // sets.
68
69 class HeapRegionDCTOC : public DirtyCardToOopClosure {
70 private:
71 HeapRegion* _hr;
72 G1ParPushHeapRSClosure* _rs_scan;
73 G1CollectedHeap* _g1;
74
75 // Walk the given memory region from bottom to (actual) top
76 // looking for objects and applying the oop closure (_cl) to
77 // them. The base implementation of this treats the area as
78 // blocks, where a block may or may not be an object. Sub-
79 // classes should override this to provide more accurate
80 // or possibly more efficient walking.
81 void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top);
82
83 public:
84 HeapRegionDCTOC(G1CollectedHeap* g1,
85 HeapRegion* hr,
86 G1ParPushHeapRSClosure* cl,
87 CardTableModRefBS::PrecisionStyle precision);
88 };
89
90 // The complicating factor is that BlockOffsetTable diverged
91 // significantly, and we need functionality that is only in the G1 version.
92 // So I copied that code, which led to an alternate G1 version of
93 // OffsetTableContigSpace. If the two versions of BlockOffsetTable could
94 // be reconciled, then G1OffsetTableContigSpace could go away.
95
96 // The idea behind time stamps is the following. We want to keep track of
97 // the highest address where it's safe to scan objects for each region.
98 // This is only relevant for current GC alloc regions so we keep a time stamp
99 // per region to determine if the region has been allocated during the current
100 // GC or not. If the time stamp is current we report a scan_top value which
101 // was saved at the end of the previous GC for retained alloc regions and which is
102 // equal to the bottom for all other regions.
103 // There is a race between card scanners and allocating gc workers where we must ensure
104 // that card scanners do not read the memory allocated by the gc workers.
105 // In order to enforce that, we must not return a value of _top which is more recent than the
106 // time stamp. This is due to the fact that a region may become a gc alloc region at
|