88 // Return the address corresponding to the next marked bit at or after 89 // "addr", and before "limit", if "limit" is non-NULL. If there is no 90 // such bit, returns "limit" if that is non-NULL, or else "endWord()". 91 HeapWord* getNextMarkedWordAddress(HeapWord* addr, 92 HeapWord* limit = NULL) const; 93 // Return the address corresponding to the next unmarked bit at or after 94 // "addr", and before "limit", if "limit" is non-NULL. If there is no 95 // such bit, returns "limit" if that is non-NULL, or else "endWord()". 96 HeapWord* getNextUnmarkedWordAddress(HeapWord* addr, 97 HeapWord* limit = NULL) const; 98 99 // conversion utilities 100 // XXX Fix these so that offsets are size_t's... 101 HeapWord* offsetToHeapWord(size_t offset) const { 102 return _bmStartWord + (offset << _shifter); 103 } 104 size_t heapWordToOffset(HeapWord* addr) const { 105 return pointer_delta(addr, _bmStartWord) >> _shifter; 106 } 107 int heapWordDiffToOffsetDiff(size_t diff) const; 108 HeapWord* nextWord(HeapWord* addr) { 109 return offsetToHeapWord(heapWordToOffset(addr) + 1); 110 } 111 112 // debugging 113 NOT_PRODUCT(bool covers(ReservedSpace rs) const;) 114 }; 115 116 class CMBitMap : public CMBitMapRO { 117 118 public: 119 // constructor 120 CMBitMap(int shifter) : 121 CMBitMapRO(shifter) {} 122 123 // Allocates the back store for the marking bitmap 124 bool allocate(ReservedSpace heap_rs); 125 126 // write marks 127 void mark(HeapWord* addr) { 128 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 129 "outside underlying space?"); | 88 // Return the address corresponding to the next marked bit at or after 89 // "addr", and before "limit", if "limit" is non-NULL. If there is no 90 // such bit, returns "limit" if that is non-NULL, or else "endWord()". 91 HeapWord* getNextMarkedWordAddress(HeapWord* addr, 92 HeapWord* limit = NULL) const; 93 // Return the address corresponding to the next unmarked bit at or after 94 // "addr", and before "limit", if "limit" is non-NULL. If there is no 95 // such bit, returns "limit" if that is non-NULL, or else "endWord()". 96 HeapWord* getNextUnmarkedWordAddress(HeapWord* addr, 97 HeapWord* limit = NULL) const; 98 99 // conversion utilities 100 // XXX Fix these so that offsets are size_t's... 101 HeapWord* offsetToHeapWord(size_t offset) const { 102 return _bmStartWord + (offset << _shifter); 103 } 104 size_t heapWordToOffset(HeapWord* addr) const { 105 return pointer_delta(addr, _bmStartWord) >> _shifter; 106 } 107 int heapWordDiffToOffsetDiff(size_t diff) const; 108 109 HeapWord* nextObject(HeapWord* addr) { 110 oop obj = (oop) addr; 111 return addr + obj->size(); 112 } 113 114 // debugging 115 NOT_PRODUCT(bool covers(ReservedSpace rs) const;) 116 }; 117 118 class CMBitMap : public CMBitMapRO { 119 120 public: 121 // constructor 122 CMBitMap(int shifter) : 123 CMBitMapRO(shifter) {} 124 125 // Allocates the back store for the marking bitmap 126 bool allocate(ReservedSpace heap_rs); 127 128 // write marks 129 void mark(HeapWord* addr) { 130 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 131 "outside underlying space?"); |