1.1 --- a/src/share/vm/gc_implementation/g1/satbQueue.cpp Fri Jul 10 16:01:20 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/satbQueue.cpp Tue Jul 14 15:40:39 2009 -0700 1.3 @@ -43,6 +43,18 @@ 1.4 } 1.5 } 1.6 } 1.7 + 1.8 +#ifdef ASSERT 1.9 +void ObjPtrQueue::verify_oops_in_buffer() { 1.10 + if (_buf == NULL) return; 1.11 + for (size_t i = _index; i < _sz; i += oopSize) { 1.12 + oop obj = (oop)_buf[byte_index_to_index((int)i)]; 1.13 + assert(obj != NULL && obj->is_oop(true /* ignore mark word */), 1.14 + "Not an oop"); 1.15 + } 1.16 +} 1.17 +#endif 1.18 + 1.19 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away 1.20 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list 1.21 #endif // _MSC_VER 1.22 @@ -66,6 +78,7 @@ 1.23 1.24 1.25 void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { 1.26 + DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();) 1.27 t->satb_mark_queue().handle_zero_index(); 1.28 } 1.29 1.30 @@ -143,7 +156,7 @@ 1.31 } 1.32 _completed_buffers_tail = NULL; 1.33 _n_completed_buffers = 0; 1.34 - debug_only(assert_completed_buffer_list_len_correct_locked()); 1.35 + DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked()); 1.36 } 1.37 while (buffers_to_delete != NULL) { 1.38 CompletedBufferNode* nd = buffers_to_delete;