2976 assert(task_card_bm->size() == _card_bm.size(), "size mismatch"); 2977 assert(marked_bytes_array != NULL, "uninitialized"); 2978 2979 memset(marked_bytes_array, 0, (size_t) max_regions * sizeof(size_t)); 2980 task_card_bm->clear(); 2981 } 2982 } 2983 2984 void ConcurrentMark::print_stats() { 2985 if (verbose_stats()) { 2986 gclog_or_tty->print_cr("---------------------------------------------------------------------"); 2987 for (size_t i = 0; i < _active_tasks; ++i) { 2988 _tasks[i]->print_stats(); 2989 gclog_or_tty->print_cr("---------------------------------------------------------------------"); 2990 } 2991 } 2992 } 2993 2994 // abandon current marking iteration due to a Full GC 2995 void ConcurrentMark::abort() { 2996 // Clear all marks in the next bitmap for the next marking cycle. This will allow us to skip the next 2997 // concurrent bitmap clearing. 2998 _nextMarkBitMap->clearAll(); 2999 3000 // Note we cannot clear the previous marking bitmap here 3001 // since VerifyDuringGC verifies the objects marked during 3002 // a full GC against the previous bitmap. 3003 3004 // Clear the liveness counting data 3005 clear_all_count_data(); 3006 // Empty mark stack 3007 reset_marking_state(); 3008 for (uint i = 0; i < _max_worker_id; ++i) { 3009 _tasks[i]->clear_region_fields(); 3010 } 3011 _first_overflow_barrier_sync.abort(); 3012 _second_overflow_barrier_sync.abort(); 3013 const GCId& gc_id = _g1h->gc_tracer_cm()->gc_id(); 3014 if (!gc_id.is_undefined()) { 3015 // We can do multiple full GCs before ConcurrentMarkThread::run() gets a chance 3016 // to detect that it was aborted. Only keep track of the first GC id that we aborted. 3017 _aborted_gc_id = gc_id; 3018 } 3019 _has_aborted = true; 3020 3021 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); 3022 satb_mq_set.abandon_partial_marking(); 3023 // This can be called either during or outside marking, we'll read 3024 // the expected_active value from the SATB queue set. 3025 satb_mq_set.set_active_all_threads( 3026 false, /* new active value */ 3027 satb_mq_set.is_active() /* expected_active */); 3028 3029 _g1h->trace_heap_after_concurrent_cycle(); 3030 _g1h->register_concurrent_cycle_end(); 3031 } 3032 3033 const GCId& ConcurrentMark::concurrent_gc_id() { 3034 if (has_aborted()) { 3035 return _aborted_gc_id; 3036 } 3037 return _g1h->gc_tracer_cm()->gc_id(); 3038 } | 2976 assert(task_card_bm->size() == _card_bm.size(), "size mismatch"); 2977 assert(marked_bytes_array != NULL, "uninitialized"); 2978 2979 memset(marked_bytes_array, 0, (size_t) max_regions * sizeof(size_t)); 2980 task_card_bm->clear(); 2981 } 2982 } 2983 2984 void ConcurrentMark::print_stats() { 2985 if (verbose_stats()) { 2986 gclog_or_tty->print_cr("---------------------------------------------------------------------"); 2987 for (size_t i = 0; i < _active_tasks; ++i) { 2988 _tasks[i]->print_stats(); 2989 gclog_or_tty->print_cr("---------------------------------------------------------------------"); 2990 } 2991 } 2992 } 2993 2994 // abandon current marking iteration due to a Full GC 2995 void ConcurrentMark::abort() { 2996 if (!cmThread()->during_cycle() || _has_aborted) { 2997 // We haven't started a concurrent cycle or we have already aborted it. No need to do anything. 2998 return; 2999 } 3000 3001 // Clear all marks in the next bitmap for the next marking cycle. This will allow us to skip the next 3002 // concurrent bitmap clearing. 3003 _nextMarkBitMap->clearAll(); 3004 3005 // Note we cannot clear the previous marking bitmap here 3006 // since VerifyDuringGC verifies the objects marked during 3007 // a full GC against the previous bitmap. 3008 3009 // Clear the liveness counting data 3010 clear_all_count_data(); 3011 // Empty mark stack 3012 reset_marking_state(); 3013 for (uint i = 0; i < _max_worker_id; ++i) { 3014 _tasks[i]->clear_region_fields(); 3015 } 3016 _first_overflow_barrier_sync.abort(); 3017 _second_overflow_barrier_sync.abort(); 3018 _aborted_gc_id = _g1h->gc_tracer_cm()->gc_id(); 3019 assert(!_aborted_gc_id.is_undefined(), "abort() executed more than once?"); 3020 _has_aborted = true; 3021 3022 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); 3023 satb_mq_set.abandon_partial_marking(); 3024 // This can be called either during or outside marking, we'll read 3025 // the expected_active value from the SATB queue set. 3026 satb_mq_set.set_active_all_threads( 3027 false, /* new active value */ 3028 satb_mq_set.is_active() /* expected_active */); 3029 3030 _g1h->trace_heap_after_concurrent_cycle(); 3031 _g1h->register_concurrent_cycle_end(); 3032 } 3033 3034 const GCId& ConcurrentMark::concurrent_gc_id() { 3035 if (has_aborted()) { 3036 return _aborted_gc_id; 3037 } 3038 return _g1h->gc_tracer_cm()->gc_id(); 3039 } |