< prev index next >

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

Print this page




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/metadataOnStackMark.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "gc_implementation/g1/concurrentMark.inline.hpp"
  30 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
  31 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  32 #include "gc_implementation/g1/g1CollectorPolicy.hpp"

  33 #include "gc_implementation/g1/g1ErgoVerbose.hpp"
  34 #include "gc_implementation/g1/g1Log.hpp"
  35 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  36 #include "gc_implementation/g1/g1RemSet.hpp"
  37 #include "gc_implementation/g1/g1StringDedup.hpp"
  38 #include "gc_implementation/g1/heapRegion.inline.hpp"
  39 #include "gc_implementation/g1/heapRegionManager.inline.hpp"
  40 #include "gc_implementation/g1/heapRegionRemSet.hpp"
  41 #include "gc_implementation/g1/heapRegionSet.inline.hpp"
  42 #include "gc_implementation/shared/vmGCOperations.hpp"
  43 #include "gc_implementation/shared/gcTimer.hpp"
  44 #include "gc_implementation/shared/gcTrace.hpp"
  45 #include "gc_implementation/shared/gcTraceTime.hpp"
  46 #include "memory/allocation.hpp"
  47 #include "memory/genOopClosures.inline.hpp"
  48 #include "memory/referencePolicy.hpp"
  49 #include "memory/resourceArea.hpp"
  50 #include "memory/strongRootsScope.hpp"
  51 #include "oops/oop.inline.hpp"
  52 #include "runtime/handles.inline.hpp"


 159     size_t const chunk_size_in_words = M / HeapWordSize;
 160 
 161     HeapWord* cur = r->bottom();
 162     HeapWord* const end = r->end();
 163 
 164     while (cur < end) {
 165       MemRegion mr(cur, MIN2(cur + chunk_size_in_words, end));
 166       _bitmap->clearRange(mr);
 167 
 168       cur += chunk_size_in_words;
 169 
 170       // Abort iteration if after yielding the marking has been aborted.
 171       if (_may_yield && _cm->do_yield_check() && _cm->has_aborted()) {
 172         return true;
 173       }
 174       // Repeat the asserts from before the start of the closure. We will do them
 175       // as asserts here to minimize their overhead on the product. However, we
 176       // will have them as guarantees at the beginning / end of the bitmap
 177       // clearing to get some checking in the product.
 178       assert(!_may_yield || _cm->cmThread()->during_cycle(), "invariant");
 179       assert(!_may_yield || !G1CollectedHeap::heap()->mark_in_progress(), "invariant");
 180     }
 181 
 182     return false;
 183   }
 184 };
 185 
 186 class ParClearNextMarkBitmapTask : public AbstractGangTask {
 187   ClearBitmapHRClosure* _cl;
 188   HeapRegionClaimer     _hrclaimer;
 189   bool                  _suspendible; // If the task is suspendible, workers must join the STS.
 190 
 191 public:
 192   ParClearNextMarkBitmapTask(ClearBitmapHRClosure *cl, uint n_workers, bool suspendible) :
 193       _cl(cl), _suspendible(suspendible), AbstractGangTask("Parallel Clear Bitmap Task"), _hrclaimer(n_workers) {}
 194 
 195   void work(uint worker_id) {
 196     SuspendibleThreadSetJoiner sts_join(_suspendible);
 197     G1CollectedHeap::heap()->heap_region_par_iterate(_cl, worker_id, &_hrclaimer, true);
 198   }
 199 };


 812   _active_tasks = 0;
 813   clear_concurrent_marking_in_progress();
 814 }
 815 
 816 ConcurrentMark::~ConcurrentMark() {
 817   // The ConcurrentMark instance is never freed.
 818   ShouldNotReachHere();
 819 }
 820 
 821 void ConcurrentMark::clearNextBitmap() {
 822   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 823 
 824   // Make sure that the concurrent mark thread looks to still be in
 825   // the current cycle.
 826   guarantee(cmThread()->during_cycle(), "invariant");
 827 
 828   // We are finishing up the current cycle by clearing the next
 829   // marking bitmap and getting it ready for the next cycle. During
 830   // this time no other cycle can start. So, let's make sure that this
 831   // is the case.
 832   guarantee(!g1h->mark_in_progress(), "invariant");
 833 
 834   ClearBitmapHRClosure cl(this, _nextMarkBitMap, true /* may_yield */);
 835   ParClearNextMarkBitmapTask task(&cl, parallel_marking_threads(), true);
 836   _parallel_workers->run_task(&task);
 837 
 838   // Clear the liveness counting data. If the marking has been aborted, the abort()
 839   // call already did that.
 840   if (cl.complete()) {
 841     clear_all_count_data();
 842   }
 843 
 844   // Repeat the asserts from above.
 845   guarantee(cmThread()->during_cycle(), "invariant");
 846   guarantee(!g1h->mark_in_progress(), "invariant");
 847 }
 848 
 849 class CheckBitmapClearHRClosure : public HeapRegionClosure {
 850   CMBitMap* _bitmap;
 851   bool _error;
 852  public:
 853   CheckBitmapClearHRClosure(CMBitMap* bitmap) : _bitmap(bitmap) {
 854   }
 855 
 856   virtual bool doHeapRegion(HeapRegion* r) {
 857     // This closure can be called concurrently to the mutator, so we must make sure
 858     // that the result of the getNextMarkedWordAddress() call is compared to the
 859     // value passed to it as limit to detect any found bits.
 860     // We can use the region's orig_end() for the limit and the comparison value
 861     // as it always contains the "real" end of the region that never changes and
 862     // has no side effects.
 863     // Due to the latter, there can also be no problem with the compiler generating
 864     // reloads of the orig_end() call.
 865     HeapWord* end = r->orig_end();
 866     return _bitmap->getNextMarkedWordAddress(r->bottom(), end) != end;


1238     }
1239     return doit;
1240   }
1241 
1242  public:
1243   G1CMTraceTime(const char* title, bool doit)
1244     : GCTraceTime(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm(),
1245         G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()) {
1246   }
1247 };
1248 
1249 void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1250   // world is stopped at this checkpoint
1251   assert(SafepointSynchronize::is_at_safepoint(),
1252          "world should be stopped");
1253 
1254   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1255 
1256   // If a full collection has happened, we shouldn't do this.
1257   if (has_aborted()) {
1258     g1h->set_marking_complete(); // So bitmap clearing isn't confused
1259     return;
1260   }
1261 
1262   SvcGCMarker sgcm(SvcGCMarker::OTHER);
1263 
1264   if (VerifyDuringGC) {
1265     HandleMark hm;  // handle scope
1266     g1h->prepare_for_verify();
1267     Universe::verify(VerifyOption_G1UsePrevMarking,
1268                      " VerifyDuringGC:(before)");
1269   }
1270   g1h->check_bitmaps("Remark Start");
1271 
1272   G1CollectorPolicy* g1p = g1h->g1_policy();
1273   g1p->record_concurrent_mark_remark_start();
1274 
1275   double start = os::elapsedTime();
1276 
1277   checkpointRootsFinalWork();
1278 


1899 
1900 public:
1901   G1ParScrubRemSetTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm, uint n_workers) :
1902       AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()), _region_bm(region_bm), _card_bm(card_bm), _hrclaimer(n_workers) {
1903   }
1904 
1905   void work(uint worker_id) {
1906     _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer);
1907   }
1908 
1909 };
1910 
1911 void ConcurrentMark::cleanup() {
1912   // world is stopped at this checkpoint
1913   assert(SafepointSynchronize::is_at_safepoint(),
1914          "world should be stopped");
1915   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1916 
1917   // If a full collection has happened, we shouldn't do this.
1918   if (has_aborted()) {
1919     g1h->set_marking_complete(); // So bitmap clearing isn't confused
1920     return;
1921   }
1922 
1923   g1h->verify_region_sets_optional();
1924 
1925   if (VerifyDuringGC) {
1926     HandleMark hm;  // handle scope
1927     g1h->prepare_for_verify();
1928     Universe::verify(VerifyOption_G1UsePrevMarking,
1929                      " VerifyDuringGC:(before)");
1930   }
1931   g1h->check_bitmaps("Cleanup Start");
1932 
1933   G1CollectorPolicy* g1p = g1h->g1_policy();
1934   g1p->record_concurrent_mark_cleanup_start();
1935 
1936   double start = os::elapsedTime();
1937 
1938   HeapRegionRemSet::reset_for_cleanup_tasks();
1939 


1956 
1957     // Bitmaps to hold expected values
1958     BitMap expected_region_bm(_region_bm.size(), true);
1959     BitMap expected_card_bm(_card_bm.size(), true);
1960 
1961     G1ParVerifyFinalCountTask g1_par_verify_task(g1h,
1962                                                  &_region_bm,
1963                                                  &_card_bm,
1964                                                  &expected_region_bm,
1965                                                  &expected_card_bm);
1966 
1967     g1h->set_par_threads((int)n_workers);
1968     g1h->workers()->run_task(&g1_par_verify_task);
1969     // Done with the parallel phase so reset to 0.
1970     g1h->set_par_threads(0);
1971 
1972     guarantee(g1_par_verify_task.failures() == 0, "Unexpected accounting failures");
1973   }
1974 
1975   size_t start_used_bytes = g1h->used();
1976   g1h->set_marking_complete();
1977 
1978   double count_end = os::elapsedTime();
1979   double this_final_counting_time = (count_end - start);
1980   _total_counting_time += this_final_counting_time;
1981 
1982   if (G1PrintRegionLivenessInfo) {
1983     G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Marking");
1984     _g1h->heap_region_iterate(&cl);
1985   }
1986 
1987   // Install newly created mark bitMap as "prev".
1988   swapMarkBitMaps();
1989 
1990   g1h->reset_gc_time_stamp();
1991 
1992   // Note end of marking in all heap regions.
1993   G1ParNoteEndTask g1_par_note_end_task(g1h, &_cleanup_list, n_workers);
1994   g1h->set_par_threads((int)n_workers);
1995   g1h->workers()->run_task(&g1_par_note_end_task);
1996   g1h->set_par_threads(0);


2788   }
2789 
2790   virtual void do_oop(oop* p) {
2791     oop obj = oopDesc::load_decode_heap_oop(p);
2792     do_object_work(obj);
2793   }
2794 
2795   virtual void do_oop(narrowOop* p) {
2796     // We should not come across narrow oops while scanning marking
2797     // stacks
2798     ShouldNotReachHere();
2799   }
2800 
2801   virtual void do_object(oop obj) {
2802     do_object_work(obj);
2803   }
2804 };
2805 
2806 void ConcurrentMark::verify_no_cset_oops() {
2807   assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
2808   if (!G1CollectedHeap::heap()->mark_in_progress()) {
2809     return;
2810   }
2811 
2812   VerifyNoCSetOopsClosure cl;
2813 
2814   // Verify entries on the global mark stack
2815   cl.set_phase(VerifyNoCSetOopsStack);
2816   _markStack.oops_do(&cl);
2817 
2818   // Verify entries on the task queues
2819   for (uint i = 0; i < _max_worker_id; i += 1) {
2820     cl.set_phase(VerifyNoCSetOopsQueues, i);
2821     CMTaskQueue* queue = _task_queues->queue(i);
2822     queue->oops_do(&cl);
2823   }
2824 
2825   // Verify the global finger
2826   HeapWord* global_finger = finger();
2827   if (global_finger != NULL && global_finger < _heap_end) {
2828     // The global finger always points to a heap region boundary. We




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/metadataOnStackMark.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "gc_implementation/g1/concurrentMark.inline.hpp"
  30 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
  31 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  32 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  33 #include "gc_implementation/g1/g1CollectorState.hpp"
  34 #include "gc_implementation/g1/g1ErgoVerbose.hpp"
  35 #include "gc_implementation/g1/g1Log.hpp"
  36 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  37 #include "gc_implementation/g1/g1RemSet.hpp"
  38 #include "gc_implementation/g1/g1StringDedup.hpp"
  39 #include "gc_implementation/g1/heapRegion.inline.hpp"
  40 #include "gc_implementation/g1/heapRegionManager.inline.hpp"
  41 #include "gc_implementation/g1/heapRegionRemSet.hpp"
  42 #include "gc_implementation/g1/heapRegionSet.inline.hpp"
  43 #include "gc_implementation/shared/vmGCOperations.hpp"
  44 #include "gc_implementation/shared/gcTimer.hpp"
  45 #include "gc_implementation/shared/gcTrace.hpp"
  46 #include "gc_implementation/shared/gcTraceTime.hpp"
  47 #include "memory/allocation.hpp"
  48 #include "memory/genOopClosures.inline.hpp"
  49 #include "memory/referencePolicy.hpp"
  50 #include "memory/resourceArea.hpp"
  51 #include "memory/strongRootsScope.hpp"
  52 #include "oops/oop.inline.hpp"
  53 #include "runtime/handles.inline.hpp"


 160     size_t const chunk_size_in_words = M / HeapWordSize;
 161 
 162     HeapWord* cur = r->bottom();
 163     HeapWord* const end = r->end();
 164 
 165     while (cur < end) {
 166       MemRegion mr(cur, MIN2(cur + chunk_size_in_words, end));
 167       _bitmap->clearRange(mr);
 168 
 169       cur += chunk_size_in_words;
 170 
 171       // Abort iteration if after yielding the marking has been aborted.
 172       if (_may_yield && _cm->do_yield_check() && _cm->has_aborted()) {
 173         return true;
 174       }
 175       // Repeat the asserts from before the start of the closure. We will do them
 176       // as asserts here to minimize their overhead on the product. However, we
 177       // will have them as guarantees at the beginning / end of the bitmap
 178       // clearing to get some checking in the product.
 179       assert(!_may_yield || _cm->cmThread()->during_cycle(), "invariant");
 180       assert(!_may_yield || !G1CollectedHeap::heap()->collector_state()->mark_in_progress(), "invariant");
 181     }
 182 
 183     return false;
 184   }
 185 };
 186 
 187 class ParClearNextMarkBitmapTask : public AbstractGangTask {
 188   ClearBitmapHRClosure* _cl;
 189   HeapRegionClaimer     _hrclaimer;
 190   bool                  _suspendible; // If the task is suspendible, workers must join the STS.
 191 
 192 public:
 193   ParClearNextMarkBitmapTask(ClearBitmapHRClosure *cl, uint n_workers, bool suspendible) :
 194       _cl(cl), _suspendible(suspendible), AbstractGangTask("Parallel Clear Bitmap Task"), _hrclaimer(n_workers) {}
 195 
 196   void work(uint worker_id) {
 197     SuspendibleThreadSetJoiner sts_join(_suspendible);
 198     G1CollectedHeap::heap()->heap_region_par_iterate(_cl, worker_id, &_hrclaimer, true);
 199   }
 200 };


 813   _active_tasks = 0;
 814   clear_concurrent_marking_in_progress();
 815 }
 816 
 817 ConcurrentMark::~ConcurrentMark() {
 818   // The ConcurrentMark instance is never freed.
 819   ShouldNotReachHere();
 820 }
 821 
 822 void ConcurrentMark::clearNextBitmap() {
 823   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 824 
 825   // Make sure that the concurrent mark thread looks to still be in
 826   // the current cycle.
 827   guarantee(cmThread()->during_cycle(), "invariant");
 828 
 829   // We are finishing up the current cycle by clearing the next
 830   // marking bitmap and getting it ready for the next cycle. During
 831   // this time no other cycle can start. So, let's make sure that this
 832   // is the case.
 833   guarantee(!g1h->collector_state()->mark_in_progress(), "invariant");
 834 
 835   ClearBitmapHRClosure cl(this, _nextMarkBitMap, true /* may_yield */);
 836   ParClearNextMarkBitmapTask task(&cl, parallel_marking_threads(), true);
 837   _parallel_workers->run_task(&task);
 838 
 839   // Clear the liveness counting data. If the marking has been aborted, the abort()
 840   // call already did that.
 841   if (cl.complete()) {
 842     clear_all_count_data();
 843   }
 844 
 845   // Repeat the asserts from above.
 846   guarantee(cmThread()->during_cycle(), "invariant");
 847   guarantee(!g1h->collector_state()->mark_in_progress(), "invariant");
 848 }
 849 
 850 class CheckBitmapClearHRClosure : public HeapRegionClosure {
 851   CMBitMap* _bitmap;
 852   bool _error;
 853  public:
 854   CheckBitmapClearHRClosure(CMBitMap* bitmap) : _bitmap(bitmap) {
 855   }
 856 
 857   virtual bool doHeapRegion(HeapRegion* r) {
 858     // This closure can be called concurrently to the mutator, so we must make sure
 859     // that the result of the getNextMarkedWordAddress() call is compared to the
 860     // value passed to it as limit to detect any found bits.
 861     // We can use the region's orig_end() for the limit and the comparison value
 862     // as it always contains the "real" end of the region that never changes and
 863     // has no side effects.
 864     // Due to the latter, there can also be no problem with the compiler generating
 865     // reloads of the orig_end() call.
 866     HeapWord* end = r->orig_end();
 867     return _bitmap->getNextMarkedWordAddress(r->bottom(), end) != end;


1239     }
1240     return doit;
1241   }
1242 
1243  public:
1244   G1CMTraceTime(const char* title, bool doit)
1245     : GCTraceTime(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm(),
1246         G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()) {
1247   }
1248 };
1249 
1250 void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1251   // world is stopped at this checkpoint
1252   assert(SafepointSynchronize::is_at_safepoint(),
1253          "world should be stopped");
1254 
1255   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1256 
1257   // If a full collection has happened, we shouldn't do this.
1258   if (has_aborted()) {
1259     g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1260     return;
1261   }
1262 
1263   SvcGCMarker sgcm(SvcGCMarker::OTHER);
1264 
1265   if (VerifyDuringGC) {
1266     HandleMark hm;  // handle scope
1267     g1h->prepare_for_verify();
1268     Universe::verify(VerifyOption_G1UsePrevMarking,
1269                      " VerifyDuringGC:(before)");
1270   }
1271   g1h->check_bitmaps("Remark Start");
1272 
1273   G1CollectorPolicy* g1p = g1h->g1_policy();
1274   g1p->record_concurrent_mark_remark_start();
1275 
1276   double start = os::elapsedTime();
1277 
1278   checkpointRootsFinalWork();
1279 


1900 
1901 public:
1902   G1ParScrubRemSetTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm, uint n_workers) :
1903       AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()), _region_bm(region_bm), _card_bm(card_bm), _hrclaimer(n_workers) {
1904   }
1905 
1906   void work(uint worker_id) {
1907     _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer);
1908   }
1909 
1910 };
1911 
1912 void ConcurrentMark::cleanup() {
1913   // world is stopped at this checkpoint
1914   assert(SafepointSynchronize::is_at_safepoint(),
1915          "world should be stopped");
1916   G1CollectedHeap* g1h = G1CollectedHeap::heap();
1917 
1918   // If a full collection has happened, we shouldn't do this.
1919   if (has_aborted()) {
1920     g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1921     return;
1922   }
1923 
1924   g1h->verify_region_sets_optional();
1925 
1926   if (VerifyDuringGC) {
1927     HandleMark hm;  // handle scope
1928     g1h->prepare_for_verify();
1929     Universe::verify(VerifyOption_G1UsePrevMarking,
1930                      " VerifyDuringGC:(before)");
1931   }
1932   g1h->check_bitmaps("Cleanup Start");
1933 
1934   G1CollectorPolicy* g1p = g1h->g1_policy();
1935   g1p->record_concurrent_mark_cleanup_start();
1936 
1937   double start = os::elapsedTime();
1938 
1939   HeapRegionRemSet::reset_for_cleanup_tasks();
1940 


1957 
1958     // Bitmaps to hold expected values
1959     BitMap expected_region_bm(_region_bm.size(), true);
1960     BitMap expected_card_bm(_card_bm.size(), true);
1961 
1962     G1ParVerifyFinalCountTask g1_par_verify_task(g1h,
1963                                                  &_region_bm,
1964                                                  &_card_bm,
1965                                                  &expected_region_bm,
1966                                                  &expected_card_bm);
1967 
1968     g1h->set_par_threads((int)n_workers);
1969     g1h->workers()->run_task(&g1_par_verify_task);
1970     // Done with the parallel phase so reset to 0.
1971     g1h->set_par_threads(0);
1972 
1973     guarantee(g1_par_verify_task.failures() == 0, "Unexpected accounting failures");
1974   }
1975 
1976   size_t start_used_bytes = g1h->used();
1977   g1h->collector_state()->set_mark_in_progress(false);
1978 
1979   double count_end = os::elapsedTime();
1980   double this_final_counting_time = (count_end - start);
1981   _total_counting_time += this_final_counting_time;
1982 
1983   if (G1PrintRegionLivenessInfo) {
1984     G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Marking");
1985     _g1h->heap_region_iterate(&cl);
1986   }
1987 
1988   // Install newly created mark bitMap as "prev".
1989   swapMarkBitMaps();
1990 
1991   g1h->reset_gc_time_stamp();
1992 
1993   // Note end of marking in all heap regions.
1994   G1ParNoteEndTask g1_par_note_end_task(g1h, &_cleanup_list, n_workers);
1995   g1h->set_par_threads((int)n_workers);
1996   g1h->workers()->run_task(&g1_par_note_end_task);
1997   g1h->set_par_threads(0);


2789   }
2790 
2791   virtual void do_oop(oop* p) {
2792     oop obj = oopDesc::load_decode_heap_oop(p);
2793     do_object_work(obj);
2794   }
2795 
2796   virtual void do_oop(narrowOop* p) {
2797     // We should not come across narrow oops while scanning marking
2798     // stacks
2799     ShouldNotReachHere();
2800   }
2801 
2802   virtual void do_object(oop obj) {
2803     do_object_work(obj);
2804   }
2805 };
2806 
2807 void ConcurrentMark::verify_no_cset_oops() {
2808   assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
2809   if (!G1CollectedHeap::heap()->collector_state()->mark_in_progress()) {
2810     return;
2811   }
2812 
2813   VerifyNoCSetOopsClosure cl;
2814 
2815   // Verify entries on the global mark stack
2816   cl.set_phase(VerifyNoCSetOopsStack);
2817   _markStack.oops_do(&cl);
2818 
2819   // Verify entries on the task queues
2820   for (uint i = 0; i < _max_worker_id; i += 1) {
2821     cl.set_phase(VerifyNoCSetOopsQueues, i);
2822     CMTaskQueue* queue = _task_queues->queue(i);
2823     queue->oops_do(&cl);
2824   }
2825 
2826   // Verify the global finger
2827   HeapWord* global_finger = finger();
2828   if (global_finger != NULL && global_finger < _heap_end) {
2829     // The global finger always points to a heap region boundary. We


< prev index next >