1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Apr 08 10:32:16 2015 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Apr 15 12:16:01 2015 -0400 1.3 @@ -3510,22 +3510,29 @@ 1.4 } 1.5 #endif 1.6 1.7 -void CMTask::scan_object(oop obj) { 1.8 +template<bool scan> 1.9 +inline void CMTask::process_grey_object(oop obj) { 1.10 + assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray"); 1.11 assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant"); 1.12 1.13 if (_cm->verbose_high()) { 1.14 - gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT, 1.15 + gclog_or_tty->print_cr("[%u] processing grey object " PTR_FORMAT, 1.16 _worker_id, p2i((void*) obj)); 1.17 } 1.18 1.19 size_t obj_size = obj->size(); 1.20 _words_scanned += obj_size; 1.21 1.22 - obj->oop_iterate(_cm_oop_closure); 1.23 + if (scan) { 1.24 + obj->oop_iterate(_cm_oop_closure); 1.25 + } 1.26 statsOnly( ++_objs_scanned ); 1.27 check_limits(); 1.28 } 1.29 1.30 +template void CMTask::process_grey_object<true>(oop); 1.31 +template void CMTask::process_grey_object<false>(oop); 1.32 + 1.33 // Closure for iteration over bitmaps 1.34 class CMBitMapClosure : public BitMapClosure { 1.35 private: