src/share/vm/gc_implementation/g1/concurrentMark.cpp

changeset 7833
0f8f1250fed5
parent 7832
b5d14ef905b5
child 7834
399885e13e90
     1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Fri Apr 17 13:49:04 2015 -0400
     1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Wed Apr 22 14:06:49 2015 -0400
     1.3 @@ -3059,9 +3059,7 @@
     1.4  #ifndef PRODUCT
     1.5  enum VerifyNoCSetOopsPhase {
     1.6    VerifyNoCSetOopsStack,
     1.7 -  VerifyNoCSetOopsQueues,
     1.8 -  VerifyNoCSetOopsSATBCompleted,
     1.9 -  VerifyNoCSetOopsSATBThread
    1.10 +  VerifyNoCSetOopsQueues
    1.11  };
    1.12  
    1.13  class VerifyNoCSetOopsClosure : public OopClosure, public ObjectClosure  {
    1.14 @@ -3074,8 +3072,6 @@
    1.15      switch (_phase) {
    1.16      case VerifyNoCSetOopsStack:         return "Stack";
    1.17      case VerifyNoCSetOopsQueues:        return "Queue";
    1.18 -    case VerifyNoCSetOopsSATBCompleted: return "Completed SATB Buffers";
    1.19 -    case VerifyNoCSetOopsSATBThread:    return "Thread SATB Buffers";
    1.20      default:                            ShouldNotReachHere();
    1.21      }
    1.22      return NULL;
    1.23 @@ -3102,7 +3098,7 @@
    1.24  
    1.25    virtual void do_oop(narrowOop* p) {
    1.26      // We should not come across narrow oops while scanning marking
    1.27 -    // stacks and SATB buffers.
    1.28 +    // stacks
    1.29      ShouldNotReachHere();
    1.30    }
    1.31  
    1.32 @@ -3111,10 +3107,7 @@
    1.33    }
    1.34  };
    1.35  
    1.36 -void ConcurrentMark::verify_no_cset_oops(bool verify_stacks,
    1.37 -                                         bool verify_enqueued_buffers,
    1.38 -                                         bool verify_thread_buffers,
    1.39 -                                         bool verify_fingers) {
    1.40 +void ConcurrentMark::verify_no_cset_oops() {
    1.41    assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
    1.42    if (!G1CollectedHeap::heap()->mark_in_progress()) {
    1.43      return;
    1.44 @@ -3122,65 +3115,47 @@
    1.45  
    1.46    VerifyNoCSetOopsClosure cl;
    1.47  
    1.48 -  if (verify_stacks) {
    1.49 -    // Verify entries on the global mark stack
    1.50 -    cl.set_phase(VerifyNoCSetOopsStack);
    1.51 -    _markStack.oops_do(&cl);
    1.52 -
    1.53 -    // Verify entries on the task queues
    1.54 -    for (uint i = 0; i < _max_worker_id; i += 1) {
    1.55 -      cl.set_phase(VerifyNoCSetOopsQueues, i);
    1.56 -      CMTaskQueue* queue = _task_queues->queue(i);
    1.57 -      queue->oops_do(&cl);
    1.58 -    }
    1.59 +  // Verify entries on the global mark stack
    1.60 +  cl.set_phase(VerifyNoCSetOopsStack);
    1.61 +  _markStack.oops_do(&cl);
    1.62 +
    1.63 +  // Verify entries on the task queues
    1.64 +  for (uint i = 0; i < _max_worker_id; i += 1) {
    1.65 +    cl.set_phase(VerifyNoCSetOopsQueues, i);
    1.66 +    CMTaskQueue* queue = _task_queues->queue(i);
    1.67 +    queue->oops_do(&cl);
    1.68    }
    1.69  
    1.70 -  SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set();
    1.71 -
    1.72 -  // Verify entries on the enqueued SATB buffers
    1.73 -  if (verify_enqueued_buffers) {
    1.74 -    cl.set_phase(VerifyNoCSetOopsSATBCompleted);
    1.75 -    satb_qs.iterate_completed_buffers_read_only(&cl);
    1.76 +  // Verify the global finger
    1.77 +  HeapWord* global_finger = finger();
    1.78 +  if (global_finger != NULL && global_finger < _heap_end) {
    1.79 +    // The global finger always points to a heap region boundary. We
    1.80 +    // use heap_region_containing_raw() to get the containing region
    1.81 +    // given that the global finger could be pointing to a free region
    1.82 +    // which subsequently becomes continues humongous. If that
    1.83 +    // happens, heap_region_containing() will return the bottom of the
    1.84 +    // corresponding starts humongous region and the check below will
    1.85 +    // not hold any more.
    1.86 +    // Since we always iterate over all regions, we might get a NULL HeapRegion
    1.87 +    // here.
    1.88 +    HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
    1.89 +    guarantee(global_hr == NULL || global_finger == global_hr->bottom(),
    1.90 +              err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
    1.91 +                      p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
    1.92    }
    1.93  
    1.94 -  // Verify entries on the per-thread SATB buffers
    1.95 -  if (verify_thread_buffers) {
    1.96 -    cl.set_phase(VerifyNoCSetOopsSATBThread);
    1.97 -    satb_qs.iterate_thread_buffers_read_only(&cl);
    1.98 -  }
    1.99 -
   1.100 -  if (verify_fingers) {
   1.101 -    // Verify the global finger
   1.102 -    HeapWord* global_finger = finger();
   1.103 -    if (global_finger != NULL && global_finger < _heap_end) {
   1.104 -      // The global finger always points to a heap region boundary. We
   1.105 -      // use heap_region_containing_raw() to get the containing region
   1.106 -      // given that the global finger could be pointing to a free region
   1.107 -      // which subsequently becomes continues humongous. If that
   1.108 -      // happens, heap_region_containing() will return the bottom of the
   1.109 -      // corresponding starts humongous region and the check below will
   1.110 -      // not hold any more.
   1.111 -      // Since we always iterate over all regions, we might get a NULL HeapRegion
   1.112 -      // here.
   1.113 -      HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger);
   1.114 -      guarantee(global_hr == NULL || global_finger == global_hr->bottom(),
   1.115 -                err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT,
   1.116 -                        p2i(global_finger), HR_FORMAT_PARAMS(global_hr)));
   1.117 -    }
   1.118 -
   1.119 -    // Verify the task fingers
   1.120 -    assert(parallel_marking_threads() <= _max_worker_id, "sanity");
   1.121 -    for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
   1.122 -      CMTask* task = _tasks[i];
   1.123 -      HeapWord* task_finger = task->finger();
   1.124 -      if (task_finger != NULL && task_finger < _heap_end) {
   1.125 -        // See above note on the global finger verification.
   1.126 -        HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger);
   1.127 -        guarantee(task_hr == NULL || task_finger == task_hr->bottom() ||
   1.128 -                  !task_hr->in_collection_set(),
   1.129 -                  err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
   1.130 -                          p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
   1.131 -      }
   1.132 +  // Verify the task fingers
   1.133 +  assert(parallel_marking_threads() <= _max_worker_id, "sanity");
   1.134 +  for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
   1.135 +    CMTask* task = _tasks[i];
   1.136 +    HeapWord* task_finger = task->finger();
   1.137 +    if (task_finger != NULL && task_finger < _heap_end) {
   1.138 +      // See above note on the global finger verification.
   1.139 +      HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger);
   1.140 +      guarantee(task_hr == NULL || task_finger == task_hr->bottom() ||
   1.141 +                !task_hr->in_collection_set(),
   1.142 +                err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT,
   1.143 +                        p2i(task_finger), HR_FORMAT_PARAMS(task_hr)));
   1.144      }
   1.145    }
   1.146  }

mercurial