Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMark.cpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMark.cpp
↓ open down ↓ 3046 lines elided ↑ open up ↑
3047 3047  
3048 3048  void ConcurrentMark::registerCSetRegion(HeapRegion* hr) {
3049 3049    if (!concurrent_marking_in_progress())
3050 3050      return;
3051 3051  
3052 3052    HeapWord* region_end = hr->end();
3053 3053    if (region_end > _min_finger)
3054 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 3079  // abandon current marking iteration due to a Full GC
3058 3080  void ConcurrentMark::abort() {
3059 3081    // Clear all marks to force marking thread to do nothing
3060 3082    _nextMarkBitMap->clearAll();
3061 3083    // Empty mark stack
3062 3084    clear_marking_state();
3063 3085    for (int i = 0; i < (int)_max_task_num; ++i) {
3064 3086      _tasks[i]->clear_region_fields();
3065 3087    }
3066 3088    _has_aborted = true;
↓ open down ↓ 1606 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX