comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 3378:69293e516993

7041440: G1: assert(obj->is_oop_or_null(true )) failed: Error # Summary: During an evacuation pause clear the region fields of any concurrent marking task whose local finger points into the collection set as the values in the region fields will become stale. Clearing these fields causes the concurrent mark task to claim a new region when marking restarts after the pause. Reviewed-by: tonyp, iveresov
author johnc
date Tue, 17 May 2011 00:56:01 -0700
parents 063382f9b575
children 842b840e67db
comparison
equal deleted inserted replaced
3377:2aa9ddbb9e60 3378:69293e516993
3052 HeapWord* region_end = hr->end(); 3052 HeapWord* region_end = hr->end();
3053 if (region_end > _min_finger) 3053 if (region_end > _min_finger)
3054 _should_gray_objects = true; 3054 _should_gray_objects = true;
3055 } 3055 }
3056 3056
3057 // Resets the region fields of active CMTasks whose values point
3058 // into the collection set.
3059 void ConcurrentMark::reset_active_task_region_fields_in_cset() {
3060 assert(SafepointSynchronize::is_at_safepoint(), "should be in STW");
3061 assert(parallel_marking_threads() <= _max_task_num, "sanity");
3062
3063 for (int i = 0; i < (int)parallel_marking_threads(); i += 1) {
3064 CMTask* task = _tasks[i];
3065 HeapWord* task_finger = task->finger();
3066 if (task_finger != NULL) {
3067 assert(_g1h->is_in_g1_reserved(task_finger), "not in heap");
3068 HeapRegion* finger_region = _g1h->heap_region_containing(task_finger);
3069 if (finger_region->in_collection_set()) {
3070 // The task's current region is in the collection set.
3071 // This region will be evacuated in the current GC and
3072 // the region fields in the task will be stale.
3073 task->giveup_current_region();
3074 }
3075 }
3076 }
3077 }
3078
3057 // abandon current marking iteration due to a Full GC 3079 // abandon current marking iteration due to a Full GC
3058 void ConcurrentMark::abort() { 3080 void ConcurrentMark::abort() {
3059 // Clear all marks to force marking thread to do nothing 3081 // Clear all marks to force marking thread to do nothing
3060 _nextMarkBitMap->clearAll(); 3082 _nextMarkBitMap->clearAll();
3061 // Empty mark stack 3083 // Empty mark stack