hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
changeset 15949 a55dea304e8c
parent 15495 d791a8e8cf6b
child 16388 60de0264afe8
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Mon Mar 04 22:39:00 2013 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Tue Mar 05 15:36:56 2013 -0800
@@ -97,7 +97,6 @@
                                        HeapWord* limit = NULL) const;
 
   // conversion utilities
-  // XXX Fix these so that offsets are size_t's...
   HeapWord* offsetToHeapWord(size_t offset) const {
     return _bmStartWord + (offset << _shifter);
   }
@@ -105,8 +104,13 @@
     return pointer_delta(addr, _bmStartWord) >> _shifter;
   }
   int heapWordDiffToOffsetDiff(size_t diff) const;
-  HeapWord* nextWord(HeapWord* addr) {
-    return offsetToHeapWord(heapWordToOffset(addr) + 1);
+
+  // The argument addr should be the start address of a valid object
+  HeapWord* nextObject(HeapWord* addr) {
+    oop obj = (oop) addr;
+    HeapWord* res =  addr + obj->size();
+    assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
+    return res;
   }
 
   // debugging