equal
deleted
inserted
replaced
26 #define SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP |
26 #define SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP |
27 |
27 |
28 #include "gc/g1/g1RegionToSpaceMapper.hpp" |
28 #include "gc/g1/g1RegionToSpaceMapper.hpp" |
29 #include "memory/allocation.hpp" |
29 #include "memory/allocation.hpp" |
30 #include "memory/memRegion.hpp" |
30 #include "memory/memRegion.hpp" |
|
31 #include "oops/oopsHierarchy.hpp" |
31 #include "utilities/bitMap.hpp" |
32 #include "utilities/bitMap.hpp" |
32 #include "utilities/globalDefinitions.hpp" |
33 #include "utilities/globalDefinitions.hpp" |
33 #include "utilities/macros.hpp" |
34 #include "utilities/macros.hpp" |
34 |
35 |
35 class G1CMBitMap; |
36 class G1CMBitMap; |
36 class G1CMTask; |
37 class G1CMTask; |
37 class G1ConcurrentMark; |
38 class G1ConcurrentMark; |
|
39 class HeapRegion; |
38 |
40 |
39 // Closure for iteration over bitmaps |
41 // Closure for iteration over bitmaps |
40 class G1CMBitMapClosure VALUE_OBJ_CLASS_SPEC { |
42 class G1CMBitMapClosure VALUE_OBJ_CLASS_SPEC { |
41 private: |
43 private: |
42 G1ConcurrentMark* const _cm; |
44 G1ConcurrentMark* const _cm; |
94 |
96 |
95 // Initializes the underlying BitMap to cover the given area. |
97 // Initializes the underlying BitMap to cover the given area. |
96 void initialize(MemRegion heap, G1RegionToSpaceMapper* storage); |
98 void initialize(MemRegion heap, G1RegionToSpaceMapper* storage); |
97 |
99 |
98 // Read marks |
100 // Read marks |
|
101 bool is_marked(oop obj) const; |
99 bool is_marked(HeapWord* addr) const { |
102 bool is_marked(HeapWord* addr) const { |
100 assert(_covered.contains(addr), |
103 assert(_covered.contains(addr), |
101 "Address " PTR_FORMAT " is outside underlying space from " PTR_FORMAT " to " PTR_FORMAT, |
104 "Address " PTR_FORMAT " is outside underlying space from " PTR_FORMAT " to " PTR_FORMAT, |
102 p2i(addr), p2i(_covered.start()), p2i(_covered.end())); |
105 p2i(addr), p2i(_covered.start()), p2i(_covered.end())); |
103 return _bm.at(addr_to_offset(addr)); |
106 return _bm.at(addr_to_offset(addr)); |
118 void print_on_error(outputStream* st, const char* prefix) const; |
121 void print_on_error(outputStream* st, const char* prefix) const; |
119 |
122 |
120 // Write marks. |
123 // Write marks. |
121 inline void mark(HeapWord* addr); |
124 inline void mark(HeapWord* addr); |
122 inline void clear(HeapWord* addr); |
125 inline void clear(HeapWord* addr); |
|
126 inline void clear(oop obj); |
123 inline bool par_mark(HeapWord* addr); |
127 inline bool par_mark(HeapWord* addr); |
|
128 inline bool par_mark(oop obj); |
124 |
129 |
125 void clear_range(MemRegion mr); |
130 void clear_range(MemRegion mr); |
|
131 void clear_region(HeapRegion* hr); |
126 }; |
132 }; |
127 |
133 |
128 #endif // SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP |
134 #endif // SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP |