1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.hpp Mon Mar 04 22:39:00 2013 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.hpp Tue Mar 05 15:36:56 2013 -0800 1.3 @@ -97,7 +97,6 @@ 1.4 HeapWord* limit = NULL) const; 1.5 1.6 // conversion utilities 1.7 - // XXX Fix these so that offsets are size_t's... 1.8 HeapWord* offsetToHeapWord(size_t offset) const { 1.9 return _bmStartWord + (offset << _shifter); 1.10 } 1.11 @@ -105,8 +104,13 @@ 1.12 return pointer_delta(addr, _bmStartWord) >> _shifter; 1.13 } 1.14 int heapWordDiffToOffsetDiff(size_t diff) const; 1.15 - HeapWord* nextWord(HeapWord* addr) { 1.16 - return offsetToHeapWord(heapWordToOffset(addr) + 1); 1.17 + 1.18 + // The argument addr should be the start address of a valid object 1.19 + HeapWord* nextObject(HeapWord* addr) { 1.20 + oop obj = (oop) addr; 1.21 + HeapWord* res = addr + obj->size(); 1.22 + assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity"); 1.23 + return res; 1.24 } 1.25 1.26 // debugging