diff -r 5955109add86 -r 43c7f35b800e hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp --- 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 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]); } }