src/hotspot/share/gc/shared/space.inline.hpp
changeset 50034 01a88f825a84
parent 49982 9042ffe5b7fe
child 50035 af1923174c9b
--- a/src/hotspot/share/gc/shared/space.inline.hpp	Mon May 07 14:42:05 2018 +0200
+++ b/src/hotspot/share/gc/shared/space.inline.hpp	Mon May 07 14:42:08 2018 +0200
@@ -357,4 +357,24 @@
   return oop(addr)->size();
 }
 
+template <typename OopClosureType>
+void ContiguousSpace::oop_since_save_marks_iterate(OopClosureType* blk) {
+  HeapWord* t;
+  HeapWord* p = saved_mark_word();
+  assert(p != NULL, "expected saved mark");
+
+  const intx interval = PrefetchScanIntervalInBytes;
+  do {
+    t = top();
+    while (p < t) {
+      Prefetch::write(p, interval);
+      debug_only(HeapWord* prev = p);
+      oop m = oop(p);
+      p += m->oop_iterate_size(blk);
+    }
+  } while (t < top());
+
+  set_saved_mark_word(p);
+}
+
 #endif // SHARE_VM_GC_SHARED_SPACE_INLINE_HPP