hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
changeset 39966 43c7f35b800e
parent 37414 2672ba9af0dc
child 41176 ff9f64534cff
--- a/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp	Tue Jul 12 15:06:18 2016 +0300
+++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp	Fri Jul 15 13:33:44 2016 +0200
@@ -91,8 +91,9 @@
 
 template<typename Fn>
 inline void G1CMMarkStack::iterate(Fn fn) {
-  assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
-  for (int i = 0; i < _index; ++i) {
+  assert_at_safepoint(true);
+  assert(!stack_modified(), "Saved index " SIZE_FORMAT " must be the same as " SIZE_FORMAT, _saved_index, _index);
+  for (size_t i = 0; i < _index; ++i) {
     fn(_base[i]);
   }
 }