8148973: Rename g1/concurrentMark.{hpp,cpp,inline.hpp} to g1/g1ConcurrentMark.{hpp,cpp,inline.hpp}

Reviewed-by: tschatzl, mgerdin
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp
index 56753b3..c41e5be 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp
+++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
 SurrogateLockerThread*
      ConcurrentMarkThread::_slt = NULL;
 
-ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
+ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
   ConcurrentGCThread(),
   _cm(cm),
   _state(Idle),
@@ -56,10 +56,10 @@
 
 class CMCheckpointRootsFinalClosure: public VoidClosure {
 
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 public:
 
-  CMCheckpointRootsFinalClosure(ConcurrentMark* cm) :
+  CMCheckpointRootsFinalClosure(G1ConcurrentMark* cm) :
     _cm(cm) {}
 
   void do_void(){
@@ -68,10 +68,10 @@
 };
 
 class CMCleanUp: public VoidClosure {
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 public:
 
-  CMCleanUp(ConcurrentMark* cm) :
+  CMCleanUp(G1ConcurrentMark* cm) :
     _cm(cm) {}
 
   void do_void(){
@@ -92,10 +92,10 @@
 }
 
 class GCConcPhaseTimer : StackObj {
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 
  public:
-  GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) {
+  GCConcPhaseTimer(G1ConcurrentMark* cm, const char* title) : _cm(cm) {
     _cm->register_concurrent_phase_start(title);
   }
 
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp
index 2dd1709..c75280b 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp
+++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,10 +27,10 @@
 
 #include "gc/shared/concurrentGCThread.hpp"
 
-// The Concurrent Mark GC Thread triggers the parallel CMConcurrentMarkingTasks
+// The Concurrent Mark GC Thread triggers the parallel G1CMConcurrentMarkingTasks
 // as well as handling various marking cleanup.
 
-class ConcurrentMark;
+class G1ConcurrentMark;
 class G1CollectorPolicy;
 
 class ConcurrentMarkThread: public ConcurrentGCThread {
@@ -45,7 +45,7 @@
   virtual void run();
 
  private:
-  ConcurrentMark*                  _cm;
+  G1ConcurrentMark*                _cm;
 
   enum State {
     Idle,
@@ -65,7 +65,7 @@
 
  public:
   // Constructor
-  ConcurrentMarkThread(ConcurrentMark* cm);
+  ConcurrentMarkThread(G1ConcurrentMark* cm);
 
   static void makeSurrogateLockerThread(TRAPS);
   static SurrogateLockerThread* slt() { return _slt; }
@@ -75,7 +75,7 @@
   // Marking virtual time so far this thread and concurrent marking tasks.
   double vtime_mark_accum();
 
-  ConcurrentMark* cm()     { return _cm; }
+  G1ConcurrentMark* cm()   { return _cm; }
 
   void set_idle()          { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
   bool idle()              { return _state == Idle; }
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp
index e31475f..bee071b 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp
+++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp
@@ -25,8 +25,8 @@
 #ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
 #define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
 
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/concurrentMarkThread.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 
   // Total virtual time so far.
 inline double ConcurrentMarkThread::vtime_accum() {
diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
index 1427582..d447e3e 100644
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
@@ -1417,13 +1417,13 @@
 
       // Clear the previous marking bitmap, if needed for bitmap verification.
       // Note we cannot do this when we clear the next marking bitmap in
-      // ConcurrentMark::abort() above since VerifyDuringGC verifies the
+      // G1ConcurrentMark::abort() above since VerifyDuringGC verifies the
       // objects marked during a full GC against the previous bitmap.
       // But we need to clear it before calling check_bitmaps below since
       // the full GC has compacted objects and updated TAMS but not updated
       // the prev bitmap.
       if (G1VerifyBitmaps) {
-        ((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
+        ((G1CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
       }
       _verifier->check_bitmaps("Full GC End");
 
@@ -1924,11 +1924,11 @@
                              G1CardCounts::compute_size(g1_rs.size() / HeapWordSize),
                              G1CardCounts::heap_map_factor());
 
-  size_t bitmap_size = CMBitMap::compute_size(g1_rs.size());
+  size_t bitmap_size = G1CMBitMap::compute_size(g1_rs.size());
   G1RegionToSpaceMapper* prev_bitmap_storage =
-    create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::heap_map_factor());
+    create_aux_memory_mapper("Prev Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
   G1RegionToSpaceMapper* next_bitmap_storage =
-    create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::heap_map_factor());
+    create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
 
   _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
   g1_barrier_set()->initialize(cardtable_storage);
@@ -1960,11 +1960,11 @@
     _humongous_reclaim_candidates.initialize(start, end, granularity);
   }
 
-  // Create the ConcurrentMark data structure and thread.
+  // Create the G1ConcurrentMark data structure and thread.
   // (Must do this late, so that "max_regions" is defined.)
-  _cm = new ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
+  _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
   if (_cm == NULL || !_cm->completed_initialization()) {
-    vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark");
+    vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
     return JNI_ENOMEM;
   }
   _cmThread = _cm->cmThread();
@@ -4992,7 +4992,7 @@
     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
     oop obj = (oop)r->bottom();
-    CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap();
+    G1CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap();
 
     // The following checks whether the humongous object is live are sufficient.
     // The main additional check (in addition to having a reference from the roots
diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
index 5e8ba97..3d8badc 100644
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,11 @@
 #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
 
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/evacuationInfo.hpp"
 #include "gc/g1/g1AllocationContext.hpp"
 #include "gc/g1/g1BiasedArray.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/g1HRPrinter.hpp"
 #include "gc/g1/g1InCSetState.hpp"
 #include "gc/g1/g1MonitoringSupport.hpp"
@@ -68,7 +68,7 @@
 class G1CollectorPolicy;
 class G1RemSet;
 class HeapRegionRemSetIterator;
-class ConcurrentMark;
+class G1ConcurrentMark;
 class ConcurrentMarkThread;
 class ConcurrentG1Refine;
 class ConcurrentGCTimer;
@@ -771,7 +771,7 @@
   void abandon_collection_set(HeapRegion* cs_head);
 
   // The concurrent marker (and the thread it runs in.)
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   ConcurrentMarkThread* _cmThread;
 
   // The concurrent refiner.
@@ -1380,7 +1380,7 @@
 
   inline bool is_obj_ill(const oop obj) const;
 
-  ConcurrentMark* concurrent_mark() const { return _cm; }
+  G1ConcurrentMark* concurrent_mark() const { return _cm; }
 
   // Refinement
 
diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp
index 0614380..eaf329b 100644
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,10 @@
 #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
 
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
 #include "gc/g1/g1CollectorPolicy.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
index c66db5e..a2b949c 100644
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp
@@ -24,10 +24,10 @@
 
 #include "precompiled.hpp"
 #include "gc/g1/concurrentG1Refine.hpp"
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/concurrentMarkThread.inline.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorPolicy.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/g1IHOPControl.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp
similarity index 92%
rename from hotspot/src/share/vm/gc/g1/concurrentMark.cpp
rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp
index a7c70b9..4d4ce49 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp
@@ -26,11 +26,11 @@
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/symbolTable.hpp"
 #include "code/codeCache.hpp"
-#include "gc/g1/concurrentMark.inline.hpp"
 #include "gc/g1/concurrentMarkThread.inline.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorPolicy.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1ConcurrentMark.inline.hpp"
 #include "gc/g1/g1HeapVerifier.hpp"
 #include "gc/g1/g1OopClosures.inline.hpp"
 #include "gc/g1/g1StringDedup.hpp"
@@ -59,15 +59,15 @@
 
 // Concurrent marking bit map wrapper
 
-CMBitMapRO::CMBitMapRO(int shifter) :
+G1CMBitMapRO::G1CMBitMapRO(int shifter) :
   _bm(),
   _shifter(shifter) {
   _bmStartWord = 0;
   _bmWordSize = 0;
 }
 
-HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
-                                               const HeapWord* limit) const {
+HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
+                                                 const HeapWord* limit) const {
   // First we must round addr *up* to a possible object boundary.
   addr = (HeapWord*)align_size_up((intptr_t)addr,
                                   HeapWordSize << _shifter);
@@ -83,7 +83,7 @@
 }
 
 #ifndef PRODUCT
-bool CMBitMapRO::covers(MemRegion heap_rs) const {
+bool G1CMBitMapRO::covers(MemRegion heap_rs) const {
   // assert(_bm.map() == _virtual_space.low(), "map inconsistency");
   assert(((size_t)_bm.size() * ((size_t)1 << _shifter)) == _bmWordSize,
          "size inconsistency");
@@ -92,19 +92,19 @@
 }
 #endif
 
-void CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const {
+void G1CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const {
   _bm.print_on_error(st, prefix);
 }
 
-size_t CMBitMap::compute_size(size_t heap_size) {
+size_t G1CMBitMap::compute_size(size_t heap_size) {
   return ReservedSpace::allocation_align_size_up(heap_size / mark_distance());
 }
 
-size_t CMBitMap::mark_distance() {
+size_t G1CMBitMap::mark_distance() {
   return MinObjAlignmentInBytes * BitsPerByte;
 }
 
-void CMBitMap::initialize(MemRegion heap, G1RegionToSpaceMapper* storage) {
+void G1CMBitMap::initialize(MemRegion heap, G1RegionToSpaceMapper* storage) {
   _bmStartWord = heap.start();
   _bmWordSize = heap.word_size();
 
@@ -114,7 +114,7 @@
   storage->set_mapping_changed_listener(&_listener);
 }
 
-void CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions, bool zero_filled) {
+void G1CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions, bool zero_filled) {
   if (zero_filled) {
     return;
   }
@@ -126,11 +126,11 @@
 // Closure used for clearing the given mark bitmap.
 class ClearBitmapHRClosure : public HeapRegionClosure {
  private:
-  ConcurrentMark* _cm;
-  CMBitMap* _bitmap;
+  G1ConcurrentMark* _cm;
+  G1CMBitMap* _bitmap;
   bool _may_yield;      // The closure may yield during iteration. If yielded, abort the iteration.
  public:
-  ClearBitmapHRClosure(ConcurrentMark* cm, CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) {
+  ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) {
     assert(!may_yield || cm != NULL, "CM must be non-NULL if this closure is expected to yield.");
   }
 
@@ -177,7 +177,7 @@
   }
 };
 
-void CMBitMap::clearAll() {
+void G1CMBitMap::clearAll() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
   ClearBitmapHRClosure cl(NULL, this, false /* may_yield */);
   uint n_workers = g1h->workers()->active_workers();
@@ -187,7 +187,7 @@
   return;
 }
 
-void CMBitMap::clearRange(MemRegion mr) {
+void G1CMBitMap::clearRange(MemRegion mr) {
   mr.intersection(MemRegion(_bmStartWord, _bmWordSize));
   assert(!mr.is_empty(), "unexpected empty region");
   // convert address range into offset range
@@ -195,11 +195,11 @@
                    heapWordToOffset(mr.end()), false);
 }
 
-CMMarkStack::CMMarkStack(ConcurrentMark* cm) :
+G1CMMarkStack::G1CMMarkStack(G1ConcurrentMark* cm) :
   _base(NULL), _cm(cm)
 {}
 
-bool CMMarkStack::allocate(size_t capacity) {
+bool G1CMMarkStack::allocate(size_t capacity) {
   // allocate a stack of the requisite depth
   ReservedSpace rs(ReservedSpace::allocation_align_size_up(capacity * sizeof(oop)));
   if (!rs.is_reserved()) {
@@ -214,7 +214,7 @@
     return false;
   }
   assert(_virtual_space.committed_size() == rs.size(),
-         "Didn't reserve backing store for all of ConcurrentMark stack?");
+         "Didn't reserve backing store for all of G1ConcurrentMark stack?");
   _base = (oop*) _virtual_space.low();
   setEmpty();
   _capacity = (jint) capacity;
@@ -223,7 +223,7 @@
   return true;
 }
 
-void CMMarkStack::expand() {
+void G1CMMarkStack::expand() {
   // Called, during remark, if we've overflown the marking stack during marking.
   assert(isEmpty(), "stack should been emptied while handling overflow");
   assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted");
@@ -256,21 +256,21 @@
   }
 }
 
-void CMMarkStack::set_should_expand() {
+void G1CMMarkStack::set_should_expand() {
   // If we're resetting the marking state because of an
   // marking stack overflow, record that we should, if
   // possible, expand the stack.
   _should_expand = _cm->has_overflown();
 }
 
-CMMarkStack::~CMMarkStack() {
+G1CMMarkStack::~G1CMMarkStack() {
   if (_base != NULL) {
     _base = NULL;
     _virtual_space.release();
   }
 }
 
-void CMMarkStack::par_push_arr(oop* ptr_arr, int n) {
+void G1CMMarkStack::par_push_arr(oop* ptr_arr, int n) {
   MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
   jint start = _index;
   jint next_index = start + n;
@@ -287,7 +287,7 @@
   }
 }
 
-bool CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) {
+bool G1CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) {
   MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
   jint index = _index;
   if (index == 0) {
@@ -305,13 +305,13 @@
   }
 }
 
-void CMMarkStack::note_start_of_gc() {
+void G1CMMarkStack::note_start_of_gc() {
   assert(_saved_index == -1,
          "note_start_of_gc()/end_of_gc() bracketed incorrectly");
   _saved_index = _index;
 }
 
-void CMMarkStack::note_end_of_gc() {
+void G1CMMarkStack::note_end_of_gc() {
   // This is intentionally a guarantee, instead of an assert. If we
   // accidentally add something to the mark stack during GC, it
   // will be a correctness issue so it's better if we crash. we'll
@@ -322,16 +322,16 @@
   _saved_index = -1;
 }
 
-CMRootRegions::CMRootRegions() :
+G1CMRootRegions::G1CMRootRegions() :
   _young_list(NULL), _cm(NULL), _scan_in_progress(false),
   _should_abort(false),  _next_survivor(NULL) { }
 
-void CMRootRegions::init(G1CollectedHeap* g1h, ConcurrentMark* cm) {
+void G1CMRootRegions::init(G1CollectedHeap* g1h, G1ConcurrentMark* cm) {
   _young_list = g1h->young_list();
   _cm = cm;
 }
 
-void CMRootRegions::prepare_for_scan() {
+void G1CMRootRegions::prepare_for_scan() {
   assert(!scan_in_progress(), "pre-condition");
 
   // Currently, only survivors can be root regions.
@@ -341,7 +341,7 @@
   _should_abort = false;
 }
 
-HeapRegion* CMRootRegions::claim_next() {
+HeapRegion* G1CMRootRegions::claim_next() {
   if (_should_abort) {
     // If someone has set the should_abort flag, we return NULL to
     // force the caller to bail out of their loop.
@@ -372,7 +372,7 @@
   return res;
 }
 
-void CMRootRegions::scan_finished() {
+void G1CMRootRegions::scan_finished() {
   assert(scan_in_progress(), "pre-condition");
 
   // Currently, only survivors can be root regions.
@@ -388,7 +388,7 @@
   }
 }
 
-bool CMRootRegions::wait_until_scan_finished() {
+bool G1CMRootRegions::wait_until_scan_finished() {
   if (!scan_in_progress()) return false;
 
   {
@@ -400,11 +400,11 @@
   return true;
 }
 
-uint ConcurrentMark::scale_parallel_threads(uint n_par_threads) {
+uint G1ConcurrentMark::scale_parallel_threads(uint n_par_threads) {
   return MAX2((n_par_threads + 2) / 4, 1U);
 }
 
-ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) :
+G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) :
   _g1h(g1h),
   _markBitMap1(),
   _markBitMap2(),
@@ -427,7 +427,7 @@
   _max_worker_id(ParallelGCThreads),
   // _active_tasks set in set_non_marking_state
   // _tasks set inside the constructor
-  _task_queues(new CMTaskQueueSet((int) _max_worker_id)),
+  _task_queues(new G1CMTaskQueueSet((int) _max_worker_id)),
   _terminator(ParallelTaskTerminator((int) _max_worker_id, _task_queues)),
 
   _has_overflown(false),
@@ -560,7 +560,7 @@
     return;
   }
 
-  _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC);
+  _tasks = NEW_C_HEAP_ARRAY(G1CMTask*, _max_worker_id, mtGC);
   _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC);
 
   _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap,  _max_worker_id, mtGC);
@@ -573,17 +573,17 @@
 
   uint max_regions = _g1h->max_regions();
   for (uint i = 0; i < _max_worker_id; ++i) {
-    CMTaskQueue* task_queue = new CMTaskQueue();
+    G1CMTaskQueue* task_queue = new G1CMTaskQueue();
     task_queue->initialize();
     _task_queues->register_queue(i, task_queue);
 
     _count_card_bitmaps[i] = BitMap(card_bm_size, false);
     _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, max_regions, mtGC);
 
-    _tasks[i] = new CMTask(i, this,
-                           _count_marked_bytes[i],
-                           &_count_card_bitmaps[i],
-                           task_queue, _task_queues);
+    _tasks[i] = new G1CMTask(i, this,
+                             _count_marked_bytes[i],
+                             &_count_card_bitmaps[i],
+                             task_queue, _task_queues);
 
     _accum_task_vtime[i] = 0.0;
   }
@@ -603,7 +603,7 @@
   _completed_initialization = true;
 }
 
-void ConcurrentMark::reset() {
+void G1ConcurrentMark::reset() {
   // Starting values for these two. This should be called in a STW
   // phase.
   MemRegion reserved = _g1h->g1_reserved();
@@ -631,7 +631,7 @@
 }
 
 
-void ConcurrentMark::reset_marking_state(bool clear_overflow) {
+void G1ConcurrentMark::reset_marking_state(bool clear_overflow) {
   _markStack.set_should_expand();
   _markStack.setEmpty();        // Also clears the _markStack overflow flag
   if (clear_overflow) {
@@ -642,12 +642,12 @@
   _finger = _heap_start;
 
   for (uint i = 0; i < _max_worker_id; ++i) {
-    CMTaskQueue* queue = _task_queues->queue(i);
+    G1CMTaskQueue* queue = _task_queues->queue(i);
     queue->set_empty();
   }
 }
 
-void ConcurrentMark::set_concurrency(uint active_tasks) {
+void G1ConcurrentMark::set_concurrency(uint active_tasks) {
   assert(active_tasks <= _max_worker_id, "we should not have more");
 
   _active_tasks = active_tasks;
@@ -658,7 +658,7 @@
   _second_overflow_barrier_sync.set_n_workers((int) active_tasks);
 }
 
-void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {
+void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {
   set_concurrency(active_tasks);
 
   _concurrent = concurrent;
@@ -679,7 +679,7 @@
   }
 }
 
-void ConcurrentMark::set_non_marking_state() {
+void G1ConcurrentMark::set_non_marking_state() {
   // We set the global marking state to some default values when we're
   // not doing marking.
   reset_marking_state();
@@ -687,12 +687,12 @@
   clear_concurrent_marking_in_progress();
 }
 
-ConcurrentMark::~ConcurrentMark() {
-  // The ConcurrentMark instance is never freed.
+G1ConcurrentMark::~G1ConcurrentMark() {
+  // The G1ConcurrentMark instance is never freed.
   ShouldNotReachHere();
 }
 
-void ConcurrentMark::clearNextBitmap() {
+void G1ConcurrentMark::clearNextBitmap() {
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
 
   // Make sure that the concurrent mark thread looks to still be in
@@ -721,10 +721,10 @@
 }
 
 class CheckBitmapClearHRClosure : public HeapRegionClosure {
-  CMBitMap* _bitmap;
+  G1CMBitMap* _bitmap;
   bool _error;
  public:
-  CheckBitmapClearHRClosure(CMBitMap* bitmap) : _bitmap(bitmap) {
+  CheckBitmapClearHRClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) {
   }
 
   virtual bool doHeapRegion(HeapRegion* r) {
@@ -737,7 +737,7 @@
   }
 };
 
-bool ConcurrentMark::nextMarkBitmapIsClear() {
+bool G1ConcurrentMark::nextMarkBitmapIsClear() {
   CheckBitmapClearHRClosure cl(_nextMarkBitMap);
   _g1h->heap_region_iterate(&cl);
   return cl.complete();
@@ -751,7 +751,7 @@
   }
 };
 
-void ConcurrentMark::checkpointRootsInitialPre() {
+void G1ConcurrentMark::checkpointRootsInitialPre() {
   G1CollectedHeap*   g1h = G1CollectedHeap::heap();
   G1CollectorPolicy* g1p = g1h->g1_policy();
 
@@ -766,7 +766,7 @@
 }
 
 
-void ConcurrentMark::checkpointRootsInitialPost() {
+void G1ConcurrentMark::checkpointRootsInitialPost() {
   G1CollectedHeap*   g1h = G1CollectedHeap::heap();
 
   // Start Concurrent Marking weak-reference discovery.
@@ -810,7 +810,7 @@
  * doesn't manipulate any data structures afterwards.
  */
 
-void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
+void G1ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
   bool barrier_aborted;
   {
     SuspendibleThreadSetLeaver sts_leave(concurrent());
@@ -850,16 +850,16 @@
   // then go into the second barrier
 }
 
-void ConcurrentMark::enter_second_sync_barrier(uint worker_id) {
+void G1ConcurrentMark::enter_second_sync_barrier(uint worker_id) {
   SuspendibleThreadSetLeaver sts_leave(concurrent());
   _second_overflow_barrier_sync.enter();
 
   // at this point everything should be re-initialized and ready to go
 }
 
-class CMConcurrentMarkingTask: public AbstractGangTask {
+class G1CMConcurrentMarkingTask: public AbstractGangTask {
 private:
-  ConcurrentMark*       _cm;
+  G1ConcurrentMark*     _cm;
   ConcurrentMarkThread* _cmt;
 
 public:
@@ -874,7 +874,7 @@
       SuspendibleThreadSetJoiner sts_join;
 
       assert(worker_id < _cm->active_tasks(), "invariant");
-      CMTask* the_task = _cm->task(worker_id);
+      G1CMTask* the_task = _cm->task(worker_id);
       the_task->record_start_time();
       if (!_cm->has_aborted()) {
         do {
@@ -910,16 +910,16 @@
     _cm->update_accum_task_vtime(worker_id, end_vtime - start_vtime);
   }
 
-  CMConcurrentMarkingTask(ConcurrentMark* cm,
-                          ConcurrentMarkThread* cmt) :
+  G1CMConcurrentMarkingTask(G1ConcurrentMark* cm,
+                            ConcurrentMarkThread* cmt) :
       AbstractGangTask("Concurrent Mark"), _cm(cm), _cmt(cmt) { }
 
-  ~CMConcurrentMarkingTask() { }
+  ~G1CMConcurrentMarkingTask() { }
 };
 
 // Calculates the number of active workers for a concurrent
 // phase.
-uint ConcurrentMark::calc_parallel_marking_threads() {
+uint G1ConcurrentMark::calc_parallel_marking_threads() {
   uint n_conc_workers = 0;
   if (!UseDynamicNumberOfGCThreads ||
       (!FLAG_IS_DEFAULT(ConcGCThreads) &&
@@ -939,7 +939,7 @@
   return n_conc_workers;
 }
 
-void ConcurrentMark::scanRootRegion(HeapRegion* hr, uint worker_id) {
+void G1ConcurrentMark::scanRootRegion(HeapRegion* hr, uint worker_id) {
   // Currently, only survivors can be root regions.
   assert(hr->next_top_at_mark_start() == hr->bottom(), "invariant");
   G1RootRegionScanClosure cl(_g1h, this, worker_id);
@@ -956,19 +956,19 @@
   }
 }
 
-class CMRootRegionScanTask : public AbstractGangTask {
+class G1CMRootRegionScanTask : public AbstractGangTask {
 private:
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 
 public:
-  CMRootRegionScanTask(ConcurrentMark* cm) :
+  G1CMRootRegionScanTask(G1ConcurrentMark* cm) :
     AbstractGangTask("Root Region Scan"), _cm(cm) { }
 
   void work(uint worker_id) {
     assert(Thread::current()->is_ConcurrentGC_thread(),
            "this should only be done by a conc GC thread");
 
-    CMRootRegions* root_regions = _cm->root_regions();
+    G1CMRootRegions* root_regions = _cm->root_regions();
     HeapRegion* hr = root_regions->claim_next();
     while (hr != NULL) {
       _cm->scanRootRegion(hr, worker_id);
@@ -977,7 +977,7 @@
   }
 };
 
-void ConcurrentMark::scanRootRegions() {
+void G1ConcurrentMark::scanRootRegions() {
   // Start of concurrent marking.
   ClassLoaderDataGraph::clear_claimed_marks();
 
@@ -992,7 +992,7 @@
            "Maximum number of marking threads exceeded");
     uint active_workers = MAX2(1U, parallel_marking_threads());
 
-    CMRootRegionScanTask task(this);
+    G1CMRootRegionScanTask task(this);
     _parallel_workers->set_active_workers(active_workers);
     _parallel_workers->run_task(&task);
 
@@ -1003,20 +1003,20 @@
   }
 }
 
-void ConcurrentMark::register_concurrent_phase_start(const char* title) {
+void G1ConcurrentMark::register_concurrent_phase_start(const char* title) {
   assert(!_concurrent_phase_started, "Sanity");
   _concurrent_phase_started = true;
   _g1h->gc_timer_cm()->register_gc_concurrent_start(title);
 }
 
-void ConcurrentMark::register_concurrent_phase_end() {
+void G1ConcurrentMark::register_concurrent_phase_end() {
   if (_concurrent_phase_started) {
     _concurrent_phase_started = false;
     _g1h->gc_timer_cm()->register_gc_concurrent_end();
   }
 }
 
-void ConcurrentMark::markFromRoots() {
+void G1ConcurrentMark::markFromRoots() {
   // we might be tempted to assert that:
   // assert(asynch == !SafepointSynchronize::is_at_safepoint(),
   //        "inconsistent argument?");
@@ -1037,13 +1037,13 @@
   // Parallel task terminator is set in "set_concurrency_and_phase()"
   set_concurrency_and_phase(active_workers, true /* concurrent */);
 
-  CMConcurrentMarkingTask markingTask(this, cmThread());
+  G1CMConcurrentMarkingTask markingTask(this, cmThread());
   _parallel_workers->set_active_workers(active_workers);
   _parallel_workers->run_task(&markingTask);
   print_stats();
 }
 
-void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
+void G1ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
   // world is stopped at this checkpoint
   assert(SafepointSynchronize::is_at_safepoint(),
          "world should be stopped");
@@ -1137,10 +1137,10 @@
 
 // Base class of the closures that finalize and verify the
 // liveness counting data.
-class CMCountDataClosureBase: public HeapRegionClosure {
+class G1CMCountDataClosureBase: public HeapRegionClosure {
 protected:
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   CardTableModRefBS* _ct_bs;
 
   BitMap* _region_bm;
@@ -1155,8 +1155,8 @@
   }
 
 public:
-  CMCountDataClosureBase(G1CollectedHeap* g1h,
-                         BitMap* region_bm, BitMap* card_bm):
+  G1CMCountDataClosureBase(G1CollectedHeap* g1h,
+                           BitMap* region_bm, BitMap* card_bm):
     _g1h(g1h), _cm(g1h->concurrent_mark()),
     _ct_bs(barrier_set_cast<CardTableModRefBS>(g1h->barrier_set())),
     _region_bm(region_bm), _card_bm(card_bm) { }
@@ -1164,14 +1164,14 @@
 
 // Closure that calculates the # live objects per region. Used
 // for verification purposes during the cleanup pause.
-class CalcLiveObjectsClosure: public CMCountDataClosureBase {
-  CMBitMapRO* _bm;
+class CalcLiveObjectsClosure: public G1CMCountDataClosureBase {
+  G1CMBitMapRO* _bm;
   size_t _region_marked_bytes;
 
 public:
-  CalcLiveObjectsClosure(CMBitMapRO *bm, G1CollectedHeap* g1h,
+  CalcLiveObjectsClosure(G1CMBitMapRO *bm, G1CollectedHeap* g1h,
                          BitMap* region_bm, BitMap* card_bm) :
-    CMCountDataClosureBase(g1h, region_bm, card_bm),
+    G1CMCountDataClosureBase(g1h, region_bm, card_bm),
     _bm(bm), _region_marked_bytes(0) { }
 
   bool doHeapRegion(HeapRegion* hr) {
@@ -1264,7 +1264,7 @@
 
 class VerifyLiveObjectDataHRClosure: public HeapRegionClosure {
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   CalcLiveObjectsClosure _calc_cl;
   BitMap* _region_bm;   // Region BM to be verified
   BitMap* _card_bm;     // Card BM to be verified
@@ -1361,7 +1361,7 @@
 class G1ParVerifyFinalCountTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   BitMap* _actual_region_bm;
   BitMap* _actual_card_bm;
 
@@ -1412,12 +1412,12 @@
 // card liveness bitmap. Also sets the bit for each region,
 // containing live data, in the region liveness bitmap.
 
-class FinalCountDataUpdateClosure: public CMCountDataClosureBase {
+class FinalCountDataUpdateClosure: public G1CMCountDataClosureBase {
  public:
   FinalCountDataUpdateClosure(G1CollectedHeap* g1h,
                               BitMap* region_bm,
                               BitMap* card_bm) :
-    CMCountDataClosureBase(g1h, region_bm, card_bm) { }
+    G1CMCountDataClosureBase(g1h, region_bm, card_bm) { }
 
   bool doHeapRegion(HeapRegion* hr) {
     HeapWord* ntams = hr->next_top_at_mark_start();
@@ -1466,7 +1466,7 @@
 class G1ParFinalCountTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   BitMap* _actual_region_bm;
   BitMap* _actual_card_bm;
 
@@ -1594,7 +1594,7 @@
   }
 };
 
-void ConcurrentMark::cleanup() {
+void G1ConcurrentMark::cleanup() {
   // world is stopped at this checkpoint
   assert(SafepointSynchronize::is_at_safepoint(),
          "world should be stopped");
@@ -1725,7 +1725,7 @@
   g1h->trace_heap_after_concurrent_cycle();
 }
 
-void ConcurrentMark::completeCleanup() {
+void G1ConcurrentMark::completeCleanup() {
   if (has_aborted()) return;
 
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
@@ -1786,11 +1786,11 @@
 }
 
 // 'Keep Alive' oop closure used by both serial parallel reference processing.
-// Uses the CMTask associated with a worker thread (for serial reference
-// processing the CMTask for worker 0 is used) to preserve (mark) and
+// Uses the G1CMTask associated with a worker thread (for serial reference
+// processing the G1CMTask for worker 0 is used) to preserve (mark) and
 // trace referent objects.
 //
-// Using the CMTask and embedded local queues avoids having the worker
+// Using the G1CMTask and embedded local queues avoids having the worker
 // threads operating on the global mark stack. This reduces the risk
 // of overflowing the stack - which we would rather avoid at this late
 // state. Also using the tasks' local queues removes the potential
@@ -1798,13 +1798,13 @@
 // operating on the global stack.
 
 class G1CMKeepAliveAndDrainClosure: public OopClosure {
-  ConcurrentMark* _cm;
-  CMTask*         _task;
-  int             _ref_counter_limit;
-  int             _ref_counter;
-  bool            _is_serial;
+  G1ConcurrentMark* _cm;
+  G1CMTask*         _task;
+  int               _ref_counter_limit;
+  int               _ref_counter;
+  bool              _is_serial;
  public:
-  G1CMKeepAliveAndDrainClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) :
+  G1CMKeepAliveAndDrainClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) :
     _cm(cm), _task(task), _is_serial(is_serial),
     _ref_counter_limit(G1RefProcDrainInterval) {
     assert(_ref_counter_limit > 0, "sanity");
@@ -1824,19 +1824,19 @@
       if (_ref_counter == 0) {
         // We have dealt with _ref_counter_limit references, pushing them
         // and objects reachable from them on to the local stack (and
-        // possibly the global stack). Call CMTask::do_marking_step() to
+        // possibly the global stack). Call G1CMTask::do_marking_step() to
         // process these entries.
         //
-        // We call CMTask::do_marking_step() in a loop, which we'll exit if
+        // We call G1CMTask::do_marking_step() in a loop, which we'll exit if
         // there's nothing more to do (i.e. we're done with the entries that
-        // were pushed as a result of the CMTask::deal_with_reference() calls
+        // were pushed as a result of the G1CMTask::deal_with_reference() calls
         // above) or we overflow.
         //
-        // Note: CMTask::do_marking_step() can set the CMTask::has_aborted()
+        // Note: G1CMTask::do_marking_step() can set the G1CMTask::has_aborted()
         // flag while there may still be some work to do. (See the comment at
-        // the beginning of CMTask::do_marking_step() for those conditions -
+        // the beginning of G1CMTask::do_marking_step() for those conditions -
         // one of which is reaching the specified time target.) It is only
-        // when CMTask::do_marking_step() returns without setting the
+        // when G1CMTask::do_marking_step() returns without setting the
         // has_aborted() flag that the marking step has completed.
         do {
           double mark_step_duration_ms = G1ConcMarkStepDurationMillis;
@@ -1851,39 +1851,39 @@
 };
 
 // 'Drain' oop closure used by both serial and parallel reference processing.
-// Uses the CMTask associated with a given worker thread (for serial
-// reference processing the CMtask for worker 0 is used). Calls the
+// Uses the G1CMTask associated with a given worker thread (for serial
+// reference processing the G1CMtask for worker 0 is used). Calls the
 // do_marking_step routine, with an unbelievably large timeout value,
 // to drain the marking data structures of the remaining entries
 // added by the 'keep alive' oop closure above.
 
 class G1CMDrainMarkingStackClosure: public VoidClosure {
-  ConcurrentMark* _cm;
-  CMTask*         _task;
-  bool            _is_serial;
+  G1ConcurrentMark* _cm;
+  G1CMTask*         _task;
+  bool              _is_serial;
  public:
-  G1CMDrainMarkingStackClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) :
+  G1CMDrainMarkingStackClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) :
     _cm(cm), _task(task), _is_serial(is_serial) {
     assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code");
   }
 
   void do_void() {
     do {
-      // We call CMTask::do_marking_step() to completely drain the local
+      // We call G1CMTask::do_marking_step() to completely drain the local
       // and global marking stacks of entries pushed by the 'keep alive'
       // oop closure (an instance of G1CMKeepAliveAndDrainClosure above).
       //
-      // CMTask::do_marking_step() is called in a loop, which we'll exit
+      // G1CMTask::do_marking_step() is called in a loop, which we'll exit
       // if there's nothing more to do (i.e. we've completely drained the
       // entries that were pushed as a a result of applying the 'keep alive'
       // closure to the entries on the discovered ref lists) or we overflow
       // the global marking stack.
       //
-      // Note: CMTask::do_marking_step() can set the CMTask::has_aborted()
+      // Note: G1CMTask::do_marking_step() can set the G1CMTask::has_aborted()
       // flag while there may still be some work to do. (See the comment at
-      // the beginning of CMTask::do_marking_step() for those conditions -
+      // the beginning of G1CMTask::do_marking_step() for those conditions -
       // one of which is reaching the specified time target.) It is only
-      // when CMTask::do_marking_step() returns without setting the
+      // when G1CMTask::do_marking_step() returns without setting the
       // has_aborted() flag that the marking step has completed.
 
       _task->do_marking_step(1000000000.0 /* something very large */,
@@ -1898,14 +1898,14 @@
 
 class G1CMRefProcTaskExecutor: public AbstractRefProcTaskExecutor {
 private:
-  G1CollectedHeap* _g1h;
-  ConcurrentMark*  _cm;
-  WorkGang*        _workers;
-  uint             _active_workers;
+  G1CollectedHeap*  _g1h;
+  G1ConcurrentMark* _cm;
+  WorkGang*         _workers;
+  uint              _active_workers;
 
 public:
   G1CMRefProcTaskExecutor(G1CollectedHeap* g1h,
-                          ConcurrentMark* cm,
+                          G1ConcurrentMark* cm,
                           WorkGang* workers,
                           uint n_workers) :
     _g1h(g1h), _cm(cm),
@@ -1918,14 +1918,14 @@
 
 class G1CMRefProcTaskProxy: public AbstractGangTask {
   typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
-  ProcessTask&     _proc_task;
-  G1CollectedHeap* _g1h;
-  ConcurrentMark*  _cm;
+  ProcessTask&      _proc_task;
+  G1CollectedHeap*  _g1h;
+  G1ConcurrentMark* _cm;
 
 public:
   G1CMRefProcTaskProxy(ProcessTask& proc_task,
-                     G1CollectedHeap* g1h,
-                     ConcurrentMark* cm) :
+                       G1CollectedHeap* g1h,
+                       G1ConcurrentMark* cm) :
     AbstractGangTask("Process reference objects in parallel"),
     _proc_task(proc_task), _g1h(g1h), _cm(cm) {
     ReferenceProcessor* rp = _g1h->ref_processor_cm();
@@ -1935,7 +1935,7 @@
   virtual void work(uint worker_id) {
     ResourceMark rm;
     HandleMark hm;
-    CMTask* task = _cm->task(worker_id);
+    G1CMTask* task = _cm->task(worker_id);
     G1CMIsAliveClosure g1_is_alive(_g1h);
     G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, task, false /* is_serial */);
     G1CMDrainMarkingStackClosure g1_par_drain(_cm, task, false /* is_serial */);
@@ -1952,7 +1952,7 @@
 
   // We need to reset the concurrency level before each
   // proxy task execution, so that the termination protocol
-  // and overflow handling in CMTask::do_marking_step() knows
+  // and overflow handling in G1CMTask::do_marking_step() knows
   // how many workers to wait for.
   _cm->set_concurrency(_active_workers);
   _workers->run_task(&proc_task_proxy);
@@ -1982,17 +1982,17 @@
   //
   // We need to reset the concurrency level before each
   // proxy task execution, so that the termination protocol
-  // and overflow handling in CMTask::do_marking_step() knows
+  // and overflow handling in G1CMTask::do_marking_step() knows
   // how many workers to wait for.
   _cm->set_concurrency(_active_workers);
   _workers->run_task(&enq_task_proxy);
 }
 
-void ConcurrentMark::weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes) {
+void G1ConcurrentMark::weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes) {
   G1CollectedHeap::heap()->parallel_cleaning(is_alive, true, true, purged_classes);
 }
 
-void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
+void G1ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
   if (has_overflown()) {
     // Skip processing the discovered references if we have
     // overflown the global marking stack. Reference objects
@@ -2127,19 +2127,19 @@
   }
 }
 
-void ConcurrentMark::swapMarkBitMaps() {
-  CMBitMapRO* temp = _prevMarkBitMap;
-  _prevMarkBitMap  = (CMBitMapRO*)_nextMarkBitMap;
-  _nextMarkBitMap  = (CMBitMap*)  temp;
+void G1ConcurrentMark::swapMarkBitMaps() {
+  G1CMBitMapRO* temp = _prevMarkBitMap;
+  _prevMarkBitMap    = (G1CMBitMapRO*)_nextMarkBitMap;
+  _nextMarkBitMap    = (G1CMBitMap*)  temp;
 }
 
 // Closure for marking entries in SATB buffers.
-class CMSATBBufferClosure : public SATBBufferClosure {
+class G1CMSATBBufferClosure : public SATBBufferClosure {
 private:
-  CMTask* _task;
+  G1CMTask* _task;
   G1CollectedHeap* _g1h;
 
-  // This is very similar to CMTask::deal_with_reference, but with
+  // This is very similar to G1CMTask::deal_with_reference, but with
   // more relaxed requirements for the argument, so this must be more
   // circumspect about treating the argument as an object.
   void do_entry(void* entry) const {
@@ -2156,7 +2156,7 @@
   }
 
 public:
-  CMSATBBufferClosure(CMTask* task, G1CollectedHeap* g1h)
+  G1CMSATBBufferClosure(G1CMTask* task, G1CollectedHeap* g1h)
     : _task(task), _g1h(g1h) { }
 
   virtual void do_buffer(void** buffer, size_t size) {
@@ -2167,13 +2167,13 @@
 };
 
 class G1RemarkThreadsClosure : public ThreadClosure {
-  CMSATBBufferClosure _cm_satb_cl;
+  G1CMSATBBufferClosure _cm_satb_cl;
   G1CMOopClosure _cm_cl;
   MarkingCodeBlobClosure _code_cl;
   int _thread_parity;
 
  public:
-  G1RemarkThreadsClosure(G1CollectedHeap* g1h, CMTask* task) :
+  G1RemarkThreadsClosure(G1CollectedHeap* g1h, G1CMTask* task) :
     _cm_satb_cl(task, g1h),
     _cm_cl(g1h, g1h->concurrent_mark(), task),
     _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
@@ -2202,15 +2202,15 @@
   }
 };
 
-class CMRemarkTask: public AbstractGangTask {
+class G1CMRemarkTask: public AbstractGangTask {
 private:
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 public:
   void work(uint worker_id) {
     // Since all available tasks are actually started, we should
     // only proceed if we're supposed to be active.
     if (worker_id < _cm->active_tasks()) {
-      CMTask* task = _cm->task(worker_id);
+      G1CMTask* task = _cm->task(worker_id);
       task->record_start_time();
       {
         ResourceMark rm;
@@ -2231,13 +2231,13 @@
     }
   }
 
-  CMRemarkTask(ConcurrentMark* cm, uint active_workers) :
+  G1CMRemarkTask(G1ConcurrentMark* cm, uint active_workers) :
     AbstractGangTask("Par Remark"), _cm(cm) {
     _cm->terminator()->reset_for_reuse(active_workers);
   }
 };
 
-void ConcurrentMark::checkpointRootsFinalWork() {
+void G1ConcurrentMark::checkpointRootsFinalWork() {
   ResourceMark rm;
   HandleMark   hm;
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
@@ -2250,14 +2250,14 @@
   uint active_workers = g1h->workers()->active_workers();
   set_concurrency_and_phase(active_workers, false /* concurrent */);
   // Leave _parallel_marking_threads at it's
-  // value originally calculated in the ConcurrentMark
+  // value originally calculated in the G1ConcurrentMark
   // constructor and pass values of the active workers
   // through the gang in the task.
 
   {
     StrongRootsScope srs(active_workers);
 
-    CMRemarkTask remarkTask(this, active_workers);
+    G1CMRemarkTask remarkTask(this, active_workers);
     // We will start all available threads, even if we decide that the
     // active_workers will be fewer. The extra ones will just bail out
     // immediately.
@@ -2274,14 +2274,14 @@
   print_stats();
 }
 
-void ConcurrentMark::clearRangePrevBitmap(MemRegion mr) {
+void G1ConcurrentMark::clearRangePrevBitmap(MemRegion mr) {
   // Note we are overriding the read-only view of the prev map here, via
   // the cast.
-  ((CMBitMap*)_prevMarkBitMap)->clearRange(mr);
+  ((G1CMBitMap*)_prevMarkBitMap)->clearRange(mr);
 }
 
 HeapRegion*
-ConcurrentMark::claim_region(uint worker_id) {
+G1ConcurrentMark::claim_region(uint worker_id) {
   // "checkpoint" the finger
   HeapWord* finger = _finger;
 
@@ -2350,7 +2350,7 @@
   }
 };
 
-void ConcurrentMark::verify_no_cset_oops() {
+void G1ConcurrentMark::verify_no_cset_oops() {
   assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
   if (!G1CollectedHeap::heap()->collector_state()->mark_in_progress()) {
     return;
@@ -2361,7 +2361,7 @@
 
   // Verify entries on the task queues
   for (uint i = 0; i < _max_worker_id; ++i) {
-    CMTaskQueue* queue = _task_queues->queue(i);
+    G1CMTaskQueue* queue = _task_queues->queue(i);
     queue->iterate(VerifyNoCSetOops("Queue", i));
   }
 
@@ -2379,7 +2379,7 @@
   // Verify the task fingers
   assert(parallel_marking_threads() <= _max_worker_id, "sanity");
   for (uint i = 0; i < parallel_marking_threads(); ++i) {
-    CMTask* task = _tasks[i];
+    G1CMTask* task = _tasks[i];
     HeapWord* task_finger = task->finger();
     if (task_finger != NULL && task_finger < _heap_end) {
       // See above note on the global finger verification.
@@ -2397,7 +2397,7 @@
 // with marking.
 class AggregateCountDataHRClosure: public HeapRegionClosure {
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   CardTableModRefBS* _ct_bs;
   BitMap* _cm_card_bm;
   uint _max_worker_id;
@@ -2492,7 +2492,7 @@
 class G1AggregateCountDataTask: public AbstractGangTask {
 protected:
   G1CollectedHeap* _g1h;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   BitMap* _cm_card_bm;
   uint _max_worker_id;
   uint _active_workers;
@@ -2500,7 +2500,7 @@
 
 public:
   G1AggregateCountDataTask(G1CollectedHeap* g1h,
-                           ConcurrentMark* cm,
+                           G1ConcurrentMark* cm,
                            BitMap* cm_card_bm,
                            uint max_worker_id,
                            uint n_workers) :
@@ -2519,7 +2519,7 @@
 };
 
 
-void ConcurrentMark::aggregate_count_data() {
+void G1ConcurrentMark::aggregate_count_data() {
   uint n_workers = _g1h->workers()->active_workers();
 
   G1AggregateCountDataTask g1_par_agg_task(_g1h, this, &_card_bm,
@@ -2529,7 +2529,7 @@
 }
 
 // Clear the per-worker arrays used to store the per-region counting data
-void ConcurrentMark::clear_all_count_data() {
+void G1ConcurrentMark::clear_all_count_data() {
   // Clear the global card bitmap - it will be filled during
   // liveness count aggregation (during remark) and the
   // final counting task.
@@ -2554,7 +2554,7 @@
   }
 }
 
-void ConcurrentMark::print_stats() {
+void G1ConcurrentMark::print_stats() {
   if (!log_is_enabled(Debug, gc, stats)) {
     return;
   }
@@ -2566,7 +2566,7 @@
 }
 
 // abandon current marking iteration due to a Full GC
-void ConcurrentMark::abort() {
+void G1ConcurrentMark::abort() {
   if (!cmThread()->during_cycle() || _has_aborted) {
     // We haven't started a concurrent cycle or we have already aborted it. No need to do anything.
     return;
@@ -2617,7 +2617,7 @@
   }
 }
 
-void ConcurrentMark::print_summary_info() {
+void G1ConcurrentMark::print_summary_info() {
   LogHandle(gc, marking) log;
   if (!log.is_trace()) {
     return;
@@ -2644,11 +2644,11 @@
             cmThread()->vtime_accum(), cmThread()->vtime_mark_accum());
 }
 
-void ConcurrentMark::print_worker_threads_on(outputStream* st) const {
+void G1ConcurrentMark::print_worker_threads_on(outputStream* st) const {
   _parallel_workers->print_worker_threads_on(st);
 }
 
-void ConcurrentMark::print_on_error(outputStream* st) const {
+void G1ConcurrentMark::print_on_error(outputStream* st) const {
   st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT,
       p2i(_prevMarkBitMap), p2i(_nextMarkBitMap));
   _prevMarkBitMap->print_on_error(st, " Prev Bits: ");
@@ -2656,7 +2656,7 @@
 }
 
 // We take a break if someone is trying to stop the world.
-bool ConcurrentMark::do_yield_check(uint worker_id) {
+bool G1ConcurrentMark::do_yield_check(uint worker_id) {
   if (SuspendibleThreadSet::should_yield()) {
     if (worker_id == 0) {
       _g1h->g1_policy()->record_concurrent_pause();
@@ -2669,15 +2669,15 @@
 }
 
 // Closure for iteration over bitmaps
-class CMBitMapClosure : public BitMapClosure {
+class G1CMBitMapClosure : public BitMapClosure {
 private:
   // the bitmap that is being iterated over
-  CMBitMap*                   _nextMarkBitMap;
-  ConcurrentMark*             _cm;
-  CMTask*                     _task;
+  G1CMBitMap*                 _nextMarkBitMap;
+  G1ConcurrentMark*           _cm;
+  G1CMTask*                   _task;
 
 public:
-  CMBitMapClosure(CMTask *task, ConcurrentMark* cm, CMBitMap* nextMarkBitMap) :
+  G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm, G1CMBitMap* nextMarkBitMap) :
     _task(task), _cm(cm), _nextMarkBitMap(nextMarkBitMap) { }
 
   bool do_bit(size_t offset) {
@@ -2710,13 +2710,13 @@
 }
 
 G1CMOopClosure::G1CMOopClosure(G1CollectedHeap* g1h,
-                               ConcurrentMark* cm,
-                               CMTask* task)
+                               G1ConcurrentMark* cm,
+                               G1CMTask* task)
   : MetadataAwareOopClosure(get_cm_oop_closure_ref_processor(g1h)),
     _g1h(g1h), _cm(cm), _task(task)
 { }
 
-void CMTask::setup_for_region(HeapRegion* hr) {
+void G1CMTask::setup_for_region(HeapRegion* hr) {
   assert(hr != NULL,
         "claim_region() should have filtered out NULL regions");
   _curr_region  = hr;
@@ -2724,7 +2724,7 @@
   update_region_limit();
 }
 
-void CMTask::update_region_limit() {
+void G1CMTask::update_region_limit() {
   HeapRegion* hr            = _curr_region;
   HeapWord* bottom          = hr->bottom();
   HeapWord* limit           = hr->next_top_at_mark_start();
@@ -2756,12 +2756,12 @@
   _region_limit = limit;
 }
 
-void CMTask::giveup_current_region() {
+void G1CMTask::giveup_current_region() {
   assert(_curr_region != NULL, "invariant");
   clear_region_fields();
 }
 
-void CMTask::clear_region_fields() {
+void G1CMTask::clear_region_fields() {
   // Values for these three fields that indicate that we're not
   // holding on to a region.
   _curr_region   = NULL;
@@ -2769,7 +2769,7 @@
   _region_limit  = NULL;
 }
 
-void CMTask::set_cm_oop_closure(G1CMOopClosure* cm_oop_closure) {
+void G1CMTask::set_cm_oop_closure(G1CMOopClosure* cm_oop_closure) {
   if (cm_oop_closure == NULL) {
     assert(_cm_oop_closure != NULL, "invariant");
   } else {
@@ -2778,7 +2778,7 @@
   _cm_oop_closure = cm_oop_closure;
 }
 
-void CMTask::reset(CMBitMap* nextMarkBitMap) {
+void G1CMTask::reset(G1CMBitMap* nextMarkBitMap) {
   guarantee(nextMarkBitMap != NULL, "invariant");
   _nextMarkBitMap                = nextMarkBitMap;
   clear_region_fields();
@@ -2789,7 +2789,7 @@
   _termination_start_time_ms     = 0.0;
 }
 
-bool CMTask::should_exit_termination() {
+bool G1CMTask::should_exit_termination() {
   regular_clock_call();
   // This is called when we are in the termination protocol. We should
   // quit if, for some reason, this task wants to abort or the global
@@ -2797,14 +2797,14 @@
   return !_cm->mark_stack_empty() || has_aborted();
 }
 
-void CMTask::reached_limit() {
+void G1CMTask::reached_limit() {
   assert(_words_scanned >= _words_scanned_limit ||
          _refs_reached >= _refs_reached_limit ,
          "shouldn't have been called otherwise");
   regular_clock_call();
 }
 
-void CMTask::regular_clock_call() {
+void G1CMTask::regular_clock_call() {
   if (has_aborted()) return;
 
   // First, we need to recalculate the words scanned and refs reached
@@ -2860,7 +2860,7 @@
   }
 }
 
-void CMTask::recalculate_limits() {
+void G1CMTask::recalculate_limits() {
   _real_words_scanned_limit = _words_scanned + words_scanned_period;
   _words_scanned_limit      = _real_words_scanned_limit;
 
@@ -2868,7 +2868,7 @@
   _refs_reached_limit       = _real_refs_reached_limit;
 }
 
-void CMTask::decrease_limits() {
+void G1CMTask::decrease_limits() {
   // This is called when we believe that we're going to do an infrequent
   // operation which will increase the per byte scanned cost (i.e. move
   // entries to/from the global stack). It basically tries to decrease the
@@ -2880,7 +2880,7 @@
     3 * refs_reached_period / 4;
 }
 
-void CMTask::move_entries_to_global_stack() {
+void G1CMTask::move_entries_to_global_stack() {
   // local array where we'll store the entries that will be popped
   // from the local queue
   oop buffer[global_stack_transfer_size];
@@ -2904,7 +2904,7 @@
   decrease_limits();
 }
 
-void CMTask::get_entries_from_global_stack() {
+void G1CMTask::get_entries_from_global_stack() {
   // local array where we'll store the entries that will be popped
   // from the global stack.
   oop buffer[global_stack_transfer_size];
@@ -2926,7 +2926,7 @@
   decrease_limits();
 }
 
-void CMTask::drain_local_queue(bool partially) {
+void G1CMTask::drain_local_queue(bool partially) {
   if (has_aborted()) return;
 
   // Decide what the target size is, depending whether we're going to
@@ -2958,7 +2958,7 @@
   }
 }
 
-void CMTask::drain_global_stack(bool partially) {
+void G1CMTask::drain_global_stack(bool partially) {
   if (has_aborted()) return;
 
   // We have a policy to drain the local queue before we attempt to
@@ -2990,7 +2990,7 @@
 // non-par versions of the methods. this is why some of the code is
 // replicated. We should really get rid of the single-threaded version
 // of the code to simplify things.
-void CMTask::drain_satb_buffers() {
+void G1CMTask::drain_satb_buffers() {
   if (has_aborted()) return;
 
   // We set this so that the regular clock knows that we're in the
@@ -2999,7 +2999,7 @@
   // very counter productive if it did that. :-)
   _draining_satb_buffers = true;
 
-  CMSATBBufferClosure satb_cl(this, _g1h);
+  G1CMSATBBufferClosure satb_cl(this, _g1h);
   SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
 
   // This keeps claiming and applying the closure to completed buffers
@@ -3020,7 +3020,7 @@
   decrease_limits();
 }
 
-void CMTask::print_stats() {
+void G1CMTask::print_stats() {
   log_debug(gc, stats)("Marking Stats, task = %u, calls = %d",
                        _worker_id, _calls);
   log_debug(gc, stats)("  Elapsed time = %1.2lfms, Termination time = %1.2lfms",
@@ -3032,7 +3032,7 @@
                        _step_times_ms.maximum(), _step_times_ms.sum());
 }
 
-bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) {
+bool G1ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) {
   return _task_queues->steal(worker_id, hash_seed, obj);
 }
 
@@ -3151,9 +3151,9 @@
 
  *****************************************************************************/
 
-void CMTask::do_marking_step(double time_target_ms,
-                             bool do_termination,
-                             bool is_serial) {
+void G1CMTask::do_marking_step(double time_target_ms,
+                               bool do_termination,
+                               bool is_serial) {
   assert(time_target_ms >= 1.0, "minimum granularity is 1ms");
   assert(concurrent() == _cm->concurrent(), "they should be the same");
 
@@ -3174,7 +3174,7 @@
   _start_time_ms = os::elapsedVTime() * 1000.0;
 
   // If do_stealing is true then do_marking_step will attempt to
-  // steal work from the other CMTasks. It only makes sense to
+  // steal work from the other G1CMTasks. It only makes sense to
   // enable stealing when the termination protocol is enabled
   // and do_marking_step() is not being called serially.
   bool do_stealing = do_termination && !is_serial;
@@ -3198,8 +3198,8 @@
   // Set up the bitmap and oop closures. Anything that uses them is
   // eventually called from this method, so it is OK to allocate these
   // statically.
-  CMBitMapClosure bitmap_closure(this, _cm, _nextMarkBitMap);
-  G1CMOopClosure  cm_oop_closure(_g1h, _cm, this);
+  G1CMBitMapClosure bitmap_closure(this, _cm, _nextMarkBitMap);
+  G1CMOopClosure    cm_oop_closure(_g1h, _cm, this);
   set_cm_oop_closure(&cm_oop_closure);
 
   if (_cm->has_overflown()) {
@@ -3382,7 +3382,7 @@
     assert(_task_queue->size() == 0, "only way to reach here");
     _termination_start_time_ms = os::elapsedVTime() * 1000.0;
 
-    // The CMTask class also extends the TerminatorTerminator class,
+    // The G1CMTask class also extends the TerminatorTerminator class,
     // hence its should_exit_termination() method will also decide
     // whether to exit the termination protocol or not.
     bool finished = (is_serial ||
@@ -3475,12 +3475,12 @@
   _claimed = false;
 }
 
-CMTask::CMTask(uint worker_id,
-               ConcurrentMark* cm,
-               size_t* marked_bytes,
-               BitMap* card_bm,
-               CMTaskQueue* task_queue,
-               CMTaskQueueSet* task_queues)
+G1CMTask::G1CMTask(uint worker_id,
+                   G1ConcurrentMark* cm,
+                   size_t* marked_bytes,
+                   BitMap* card_bm,
+                   G1CMTaskQueue* task_queue,
+                   G1CMTaskQueueSet* task_queues)
   : _g1h(G1CollectedHeap::heap()),
     _worker_id(worker_id), _cm(cm),
     _claimed(false),
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp
similarity index 93%
rename from hotspot/src/share/vm/gc/g1/concurrentMark.hpp
rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp
index 5c8f81e..0cce8b7 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_HPP
-#define SHARE_VM_GC_G1_CONCURRENTMARK_HPP
+#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
+#define SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
 
 #include "classfile/javaClasses.hpp"
 #include "gc/g1/g1RegionToSpaceMapper.hpp"
@@ -31,11 +31,11 @@
 #include "gc/shared/taskqueue.hpp"
 
 class G1CollectedHeap;
-class CMBitMap;
-class CMTask;
-class ConcurrentMark;
-typedef GenericTaskQueue<oop, mtGC>            CMTaskQueue;
-typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
+class G1CMBitMap;
+class G1CMTask;
+class G1ConcurrentMark;
+typedef GenericTaskQueue<oop, mtGC>              G1CMTaskQueue;
+typedef GenericTaskQueueSet<G1CMTaskQueue, mtGC> G1CMTaskQueueSet;
 
 // Closure used by CM during concurrent reference discovery
 // and reference processing (during remarking) to determine
@@ -54,7 +54,7 @@
 // A generic CM bit map.  This is essentially a wrapper around the BitMap
 // class, with one bit per (1<<_shifter) HeapWords.
 
-class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
+class G1CMBitMapRO VALUE_OBJ_CLASS_SPEC {
  protected:
   HeapWord* _bmStartWord;      // base address of range covered by map
   size_t    _bmWordSize;       // map size (in #HeapWords covered)
@@ -63,7 +63,7 @@
 
  public:
   // constructor
-  CMBitMapRO(int shifter);
+  G1CMBitMapRO(int shifter);
 
   // inquiries
   HeapWord* startWord()   const { return _bmStartWord; }
@@ -104,20 +104,20 @@
   NOT_PRODUCT(bool covers(MemRegion rs) const;)
 };
 
-class CMBitMapMappingChangedListener : public G1MappingChangedListener {
+class G1CMBitMapMappingChangedListener : public G1MappingChangedListener {
  private:
-  CMBitMap* _bm;
+  G1CMBitMap* _bm;
  public:
-  CMBitMapMappingChangedListener() : _bm(NULL) {}
+  G1CMBitMapMappingChangedListener() : _bm(NULL) {}
 
-  void set_bitmap(CMBitMap* bm) { _bm = bm; }
+  void set_bitmap(G1CMBitMap* bm) { _bm = bm; }
 
   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 };
 
-class CMBitMap : public CMBitMapRO {
+class G1CMBitMap : public G1CMBitMapRO {
  private:
-  CMBitMapMappingChangedListener _listener;
+  G1CMBitMapMappingChangedListener _listener;
 
  public:
   static size_t compute_size(size_t heap_size);
@@ -129,7 +129,7 @@
     return mark_distance();
   }
 
-  CMBitMap() : CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
+  G1CMBitMap() : G1CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
 
   // Initializes the underlying BitMap to cover the given area.
   void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
@@ -146,9 +146,9 @@
 };
 
 // Represents a marking stack used by ConcurrentMarking in the G1 collector.
-class CMMarkStack VALUE_OBJ_CLASS_SPEC {
+class G1CMMarkStack VALUE_OBJ_CLASS_SPEC {
   VirtualSpace _virtual_space;   // Underlying backing store for actual stack
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   oop* _base;        // bottom of stack
   jint _index;       // one more than last occupied index
   jint _capacity;    // max #elements
@@ -158,8 +158,8 @@
   bool  _should_expand;
 
  public:
-  CMMarkStack(ConcurrentMark* cm);
-  ~CMMarkStack();
+  G1CMMarkStack(G1ConcurrentMark* cm);
+  ~G1CMMarkStack();
 
   bool allocate(size_t capacity);
 
@@ -220,19 +220,19 @@
 // Currently, we only support root region scanning once (at the start
 // of the marking cycle) and the root regions are all the survivor
 // regions populated during the initial-mark pause.
-class CMRootRegions VALUE_OBJ_CLASS_SPEC {
+class G1CMRootRegions VALUE_OBJ_CLASS_SPEC {
 private:
   YoungList*           _young_list;
-  ConcurrentMark*      _cm;
+  G1ConcurrentMark*    _cm;
 
   volatile bool        _scan_in_progress;
   volatile bool        _should_abort;
   HeapRegion* volatile _next_survivor;
 
 public:
-  CMRootRegions();
+  G1CMRootRegions();
   // We actually do most of the initialization in this method.
-  void init(G1CollectedHeap* g1h, ConcurrentMark* cm);
+  void init(G1CollectedHeap* g1h, G1ConcurrentMark* cm);
 
   // Reset the claiming / scanning of the root regions.
   void prepare_for_scan();
@@ -260,19 +260,19 @@
 
 class ConcurrentMarkThread;
 
-class ConcurrentMark: public CHeapObj<mtGC> {
-  friend class CMMarkStack;
+class G1ConcurrentMark: public CHeapObj<mtGC> {
   friend class ConcurrentMarkThread;
-  friend class CMTask;
-  friend class CMBitMapClosure;
-  friend class CMRemarkTask;
-  friend class CMConcurrentMarkingTask;
   friend class G1ParNoteEndTask;
   friend class CalcLiveObjectsClosure;
   friend class G1CMRefProcTaskProxy;
   friend class G1CMRefProcTaskExecutor;
   friend class G1CMKeepAliveAndDrainClosure;
   friend class G1CMDrainMarkingStackClosure;
+  friend class G1CMBitMapClosure;
+  friend class G1CMConcurrentMarkingTask;
+  friend class G1CMMarkStack;
+  friend class G1CMRemarkTask;
+  friend class G1CMTask;
 
 protected:
   ConcurrentMarkThread* _cmThread;   // The thread doing the work
@@ -290,10 +290,10 @@
   FreeRegionList        _cleanup_list;
 
   // Concurrent marking support structures
-  CMBitMap                _markBitMap1;
-  CMBitMap                _markBitMap2;
-  CMBitMapRO*             _prevMarkBitMap; // Completed mark bitmap
-  CMBitMap*               _nextMarkBitMap; // Under-construction mark bitmap
+  G1CMBitMap              _markBitMap1;
+  G1CMBitMap              _markBitMap2;
+  G1CMBitMapRO*           _prevMarkBitMap; // Completed mark bitmap
+  G1CMBitMap*             _nextMarkBitMap; // Under-construction mark bitmap
 
   BitMap                  _region_bm;
   BitMap                  _card_bm;
@@ -303,10 +303,10 @@
   HeapWord*               _heap_end;
 
   // Root region tracking and claiming
-  CMRootRegions           _root_regions;
+  G1CMRootRegions         _root_regions;
 
   // For gray objects
-  CMMarkStack             _markStack; // Grey objects behind global finger
+  G1CMMarkStack           _markStack; // Grey objects behind global finger
   HeapWord* volatile      _finger;  // The global finger, region aligned,
                                     // always points to the end of the
                                     // last claimed region
@@ -314,8 +314,8 @@
   // Marking tasks
   uint                    _max_worker_id;// Maximum worker id
   uint                    _active_tasks; // Task num currently active
-  CMTask**                _tasks;        // Task queue array (max_worker_id len)
-  CMTaskQueueSet*         _task_queues;  // Task queue set
+  G1CMTask**              _tasks;        // Task queue array (max_worker_id len)
+  G1CMTaskQueueSet*       _task_queues;  // Task queue set
   ParallelTaskTerminator  _terminator;   // For termination
 
   // Two sync barriers that are used to synchronize tasks when an
@@ -430,21 +430,21 @@
   bool        out_of_regions() { return _finger >= _heap_end; }
 
   // Returns the task with the given id
-  CMTask* task(int id) {
+  G1CMTask* task(int id) {
     assert(0 <= id && id < (int) _active_tasks,
            "task id not within active bounds");
     return _tasks[id];
   }
 
   // Returns the task queue with the given id
-  CMTaskQueue* task_queue(int id) {
+  G1CMTaskQueue* task_queue(int id) {
     assert(0 <= id && id < (int) _active_tasks,
            "task queue id not within active bounds");
-    return (CMTaskQueue*) _task_queues->queue(id);
+    return (G1CMTaskQueue*) _task_queues->queue(id);
   }
 
   // Returns the task queue set
-  CMTaskQueueSet* task_queues()  { return _task_queues; }
+  G1CMTaskQueueSet* task_queues()  { return _task_queues; }
 
   // Access / manipulation of the overflow flag which is set to
   // indicate that the global stack has overflown
@@ -502,7 +502,7 @@
   bool mark_stack_overflow()              { return _markStack.overflow(); }
   bool mark_stack_empty()                 { return _markStack.isEmpty(); }
 
-  CMRootRegions* root_regions() { return &_root_regions; }
+  G1CMRootRegions* root_regions() { return &_root_regions; }
 
   bool concurrent_marking_in_progress() {
     return _concurrent_marking_in_progress;
@@ -531,15 +531,15 @@
   // Attempts to steal an object from the task queues of other tasks
   bool try_stealing(uint worker_id, int* hash_seed, oop& obj);
 
-  ConcurrentMark(G1CollectedHeap* g1h,
-                 G1RegionToSpaceMapper* prev_bitmap_storage,
-                 G1RegionToSpaceMapper* next_bitmap_storage);
-  ~ConcurrentMark();
+  G1ConcurrentMark(G1CollectedHeap* g1h,
+                   G1RegionToSpaceMapper* prev_bitmap_storage,
+                   G1RegionToSpaceMapper* next_bitmap_storage);
+  ~G1ConcurrentMark();
 
   ConcurrentMarkThread* cmThread() { return _cmThread; }
 
-  CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
-  CMBitMap*   nextMarkBitMap() const { return _nextMarkBitMap; }
+  G1CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
+  G1CMBitMap*   nextMarkBitMap() const { return _nextMarkBitMap; }
 
   // Returns the number of GC threads to be used in a concurrent
   // phase based on the number of GC threads being used in a STW
@@ -728,7 +728,7 @@
 };
 
 // A class representing a marking task.
-class CMTask : public TerminatorTerminator {
+class G1CMTask : public TerminatorTerminator {
 private:
   enum PrivateConstants {
     // the regular clock call is called once the scanned words reaches
@@ -746,13 +746,13 @@
 
   uint                        _worker_id;
   G1CollectedHeap*            _g1h;
-  ConcurrentMark*             _cm;
-  CMBitMap*                   _nextMarkBitMap;
+  G1ConcurrentMark*           _cm;
+  G1CMBitMap*                 _nextMarkBitMap;
   // the task queue of this task
-  CMTaskQueue*                _task_queue;
+  G1CMTaskQueue*              _task_queue;
 private:
   // the task queue set---needed for stealing
-  CMTaskQueueSet*             _task_queues;
+  G1CMTaskQueueSet*           _task_queues;
   // indicates whether the task has been claimed---this is only  for
   // debugging purposes
   bool                        _claimed;
@@ -869,7 +869,7 @@
 public:
   // It resets the task; it should be called right at the beginning of
   // a marking phase.
-  void reset(CMBitMap* _nextMarkBitMap);
+  void reset(G1CMBitMap* _nextMarkBitMap);
   // it clears all the fields that correspond to a claimed region.
   void clear_region_fields();
 
@@ -956,12 +956,12 @@
     _finger = new_finger;
   }
 
-  CMTask(uint worker_id,
-         ConcurrentMark *cm,
-         size_t* marked_bytes,
-         BitMap* card_bm,
-         CMTaskQueue* task_queue,
-         CMTaskQueueSet* task_queues);
+  G1CMTask(uint worker_id,
+           G1ConcurrentMark *cm,
+           size_t* marked_bytes,
+           BitMap* card_bm,
+           G1CMTaskQueue* task_queue,
+           G1CMTaskQueueSet* task_queues);
 
   // it prints statistics associated with this task
   void print_stats();
@@ -1021,4 +1021,4 @@
   ~G1PrintRegionLivenessInfoClosure();
 };
 
-#endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP
+#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
similarity index 83%
rename from hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp
rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
index d2695f5..4a934e0 100644
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
@@ -22,19 +22,19 @@
  *
  */
 
-#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
-#define SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
+#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
+#define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
 
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/shared/taskqueue.inline.hpp"
 
 // Utility routine to set an exclusive range of cards on the given
 // card liveness bitmap
-inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
-                                                  BitMap::idx_t start_idx,
-                                                  BitMap::idx_t end_idx,
-                                                  bool is_par) {
+inline void G1ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
+                                                    BitMap::idx_t start_idx,
+                                                    BitMap::idx_t end_idx,
+                                                    bool is_par) {
 
   // Set the exclusive bit range [start_idx, end_idx).
   assert((end_idx - start_idx) > 0, "at least one card");
@@ -67,7 +67,7 @@
 
 // Returns the index in the liveness accounting card bitmap
 // for the given address
-inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
+inline BitMap::idx_t G1ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
   // Below, the term "card num" means the result of shifting an address
   // by the card shift -- address 0 corresponds to card number 0.  One
   // must subtract the card num of the bottom of the heap to obtain a
@@ -78,9 +78,9 @@
 
 // Counts the given memory region in the given task/worker
 // counting data structures.
-inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
-                                         size_t* marked_bytes_array,
-                                         BitMap* task_card_bm) {
+inline void G1ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
+                                           size_t* marked_bytes_array,
+                                           BitMap* task_card_bm) {
   G1CollectedHeap* g1h = _g1h;
   CardTableModRefBS* ct_bs = g1h->g1_barrier_set();
 
@@ -115,11 +115,11 @@
 }
 
 // Counts the given object in the given task/worker counting data structures.
-inline void ConcurrentMark::count_object(oop obj,
-                                         HeapRegion* hr,
-                                         size_t* marked_bytes_array,
-                                         BitMap* task_card_bm,
-                                         size_t word_size) {
+inline void G1ConcurrentMark::count_object(oop obj,
+                                           HeapRegion* hr,
+                                           size_t* marked_bytes_array,
+                                           BitMap* task_card_bm,
+                                           size_t word_size) {
   assert(!hr->is_continues_humongous(), "Cannot enter count_object with continues humongous");
   if (!hr->is_starts_humongous()) {
     MemRegion mr((HeapWord*)obj, word_size);
@@ -135,10 +135,10 @@
 
 // Attempts to mark the given object and, if successful, counts
 // the object in the given task/worker counting structures.
-inline bool ConcurrentMark::par_mark_and_count(oop obj,
-                                               HeapRegion* hr,
-                                               size_t* marked_bytes_array,
-                                               BitMap* task_card_bm) {
+inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
+                                                 HeapRegion* hr,
+                                                 size_t* marked_bytes_array,
+                                                 BitMap* task_card_bm) {
   if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
     // Update the task specific count data for the object.
     count_object(obj, hr, marked_bytes_array, task_card_bm, obj->size());
@@ -150,10 +150,10 @@
 // Attempts to mark the given object and, if successful, counts
 // the object in the task/worker counting structures for the
 // given worker id.
-inline bool ConcurrentMark::par_mark_and_count(oop obj,
-                                               size_t word_size,
-                                               HeapRegion* hr,
-                                               uint worker_id) {
+inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
+                                                 size_t word_size,
+                                                 HeapRegion* hr,
+                                                 uint worker_id) {
   if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
     size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
     BitMap* task_card_bm = count_card_bitmap_for(worker_id);
@@ -163,7 +163,7 @@
   return false;
 }
 
-inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
+inline bool G1CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
   HeapWord* start_addr = MAX2(startWord(), mr.start());
   HeapWord* end_addr = MIN2(endWord(), mr.end());
 
@@ -186,7 +186,7 @@
 }
 
 // The argument addr should be the start address of a valid object
-HeapWord* CMBitMapRO::nextObject(HeapWord* addr) {
+HeapWord* G1CMBitMapRO::nextObject(HeapWord* addr) {
   oop obj = (oop) addr;
   HeapWord* res =  addr + obj->size();
   assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
@@ -201,17 +201,17 @@
          " corresponding to " PTR_FORMAT " (%u)",                              \
          p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr));
 
-inline void CMBitMap::mark(HeapWord* addr) {
+inline void G1CMBitMap::mark(HeapWord* addr) {
   check_mark(addr);
   _bm.set_bit(heapWordToOffset(addr));
 }
 
-inline void CMBitMap::clear(HeapWord* addr) {
+inline void G1CMBitMap::clear(HeapWord* addr) {
   check_mark(addr);
   _bm.clear_bit(heapWordToOffset(addr));
 }
 
-inline bool CMBitMap::parMark(HeapWord* addr) {
+inline bool G1CMBitMap::parMark(HeapWord* addr) {
   check_mark(addr);
   return _bm.par_set_bit(heapWordToOffset(addr));
 }
@@ -219,7 +219,7 @@
 #undef check_mark
 
 template<typename Fn>
-inline void CMMarkStack::iterate(Fn fn) {
+inline void G1CMMarkStack::iterate(Fn fn) {
   assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
   for (int i = 0; i < _index; ++i) {
     fn(_base[i]);
@@ -227,9 +227,9 @@
 }
 
 // It scans an object and visits its children.
-inline void CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
+inline void G1CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
 
-inline void CMTask::push(oop obj) {
+inline void G1CMTask::push(oop obj) {
   HeapWord* objAddr = (HeapWord*) obj;
   assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
   assert(!_g1h->is_on_master_free_list(
@@ -250,7 +250,7 @@
   }
 }
 
-inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
+inline bool G1CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
   // If obj is above the global finger, then the mark bitmap scan
   // will find it later, and no push is needed.  Similarly, if we have
   // a current region and obj is between the local finger and the
@@ -281,7 +281,7 @@
 }
 
 template<bool scan>
-inline void CMTask::process_grey_object(oop obj) {
+inline void G1CMTask::process_grey_object(oop obj) {
   assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
   assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
 
@@ -296,10 +296,10 @@
 
 
 
-inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
+inline void G1CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
   if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
     // No OrderAccess:store_load() is needed. It is implicit in the
-    // CAS done in CMBitMap::parMark() call in the routine above.
+    // CAS done in G1CMBitMap::parMark() call in the routine above.
     HeapWord* global_finger = _cm->finger();
 
     // We only need to push a newly grey object on the mark
@@ -335,7 +335,7 @@
   }
 }
 
-inline void CMTask::deal_with_reference(oop obj) {
+inline void G1CMTask::deal_with_reference(oop obj) {
   increment_refs_reached();
 
   HeapWord* objAddr = (HeapWord*) obj;
@@ -354,14 +354,14 @@
   }
 }
 
-inline void ConcurrentMark::markPrev(oop p) {
+inline void G1ConcurrentMark::markPrev(oop p) {
   assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity");
   // Note we are overriding the read-only view of the prev map here, via
   // the cast.
-  ((CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p);
+  ((G1CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p);
 }
 
-bool ConcurrentMark::isPrevMarked(oop p) const {
+bool G1ConcurrentMark::isPrevMarked(oop p) const {
   assert(p != NULL && p->is_oop(), "expected an oop");
   HeapWord* addr = (HeapWord*)p;
   assert(addr >= _prevMarkBitMap->startWord() ||
@@ -370,8 +370,8 @@
   return _prevMarkBitMap->isMarked(addr);
 }
 
-inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
-                                     uint worker_id, HeapRegion* hr) {
+inline void G1ConcurrentMark::grayRoot(oop obj, size_t word_size,
+                                       uint worker_id, HeapRegion* hr) {
   assert(obj != NULL, "pre-condition");
   HeapWord* addr = (HeapWord*) obj;
   if (hr == NULL) {
@@ -391,4 +391,4 @@
   }
 }
 
-#endif // SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
+#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
diff --git a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp
index d34f9d7..06721ee 100644
--- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp
+++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,10 @@
  */
 
 #include "precompiled.hpp"
-#include "gc/g1/concurrentMark.inline.hpp"
 #include "gc/g1/dirtyCardQueue.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1ConcurrentMark.inline.hpp"
 #include "gc/g1/g1EvacFailure.hpp"
 #include "gc/g1/g1HeapVerifier.hpp"
 #include "gc/g1/g1OopClosures.inline.hpp"
@@ -62,7 +62,7 @@
 class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
 private:
   G1CollectedHeap* _g1;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
   HeapRegion* _hr;
   size_t _marked_bytes;
   OopsInHeapRegionClosure *_update_rset_cl;
diff --git a/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp
index 1db22eb..ca7643f 100644
--- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp
index ce3c830..8b89558 100644
--- a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp
+++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp
@@ -591,7 +591,7 @@
   verify_dirty_young_list(_g1h->young_list()->first_region());
 }
 
-bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
+bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap,
                                                HeapWord* tams, HeapWord* end) {
   guarantee(tams <= end,
             "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end));
@@ -605,8 +605,8 @@
 }
 
 bool G1HeapVerifier::verify_bitmaps(const char* caller, HeapRegion* hr) {
-  CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
-  CMBitMapRO* next_bitmap = (CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
+  G1CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
+  G1CMBitMapRO* next_bitmap = (G1CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
 
   HeapWord* bottom = hr->bottom();
   HeapWord* ptams  = hr->prev_top_at_mark_start();
diff --git a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp
index c4fdb0d..4d6aa68 100644
--- a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp
@@ -82,7 +82,7 @@
   // range [from,limit). If it does, print an error message and return
   // false. Otherwise, just return true. bitmap_name should be "prev"
   // or "next".
-  bool verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
+  bool verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap,
                                 HeapWord* from, HeapWord* limit);
 
   // Verify that the prev / next bitmap range [tams,end) for the given
diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
index d8c449f..05f90f7 100644
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp
@@ -31,12 +31,12 @@
 class HeapRegion;
 class G1CollectedHeap;
 class G1RemSet;
-class ConcurrentMark;
+class G1ConcurrentMark;
 class DirtyCardToOopClosure;
-class CMBitMap;
-class CMMarkStack;
+class G1CMBitMap;
+class G1CMMarkStack;
 class G1ParScanThreadState;
-class CMTask;
+class G1CMTask;
 class ReferenceProcessor;
 
 // A class that scans oops in a given heap region (much as OopsInGenClosure
@@ -92,7 +92,7 @@
   G1ParScanThreadState* _par_scan_state;
   uint _worker_id;              // Cache value from par_scan_state.
   Klass* _scanned_klass;
-  ConcurrentMark* _cm;
+  G1ConcurrentMark* _cm;
 
   // Mark the object if it's not already marked. This is used to mark
   // objects pointed to by roots that are guaranteed not to move
@@ -170,12 +170,12 @@
 // Closure for iterating over object fields during concurrent marking
 class G1CMOopClosure : public MetadataAwareOopClosure {
 protected:
-  ConcurrentMark*    _cm;
+  G1ConcurrentMark*  _cm;
 private:
   G1CollectedHeap*   _g1h;
-  CMTask*            _task;
+  G1CMTask*          _task;
 public:
-  G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task);
+  G1CMOopClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1CMTask* task);
   template <class T> void do_oop_nv(T* p);
   virtual void do_oop(      oop* p) { do_oop_nv(p); }
   virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
@@ -185,10 +185,10 @@
 class G1RootRegionScanClosure : public MetadataAwareOopClosure {
 private:
   G1CollectedHeap* _g1h;
-  ConcurrentMark*  _cm;
+  G1ConcurrentMark* _cm;
   uint _worker_id;
 public:
-  G1RootRegionScanClosure(G1CollectedHeap* g1h, ConcurrentMark* cm,
+  G1RootRegionScanClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm,
                           uint worker_id) :
     _g1h(g1h), _cm(cm), _worker_id(worker_id) { }
   template <class T> void do_oop_nv(T* p);
diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp
index bdc18c6..0628968 100644
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp
@@ -25,8 +25,8 @@
 #ifndef SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
 #define SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
 
-#include "gc/g1/concurrentMark.inline.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
+#include "gc/g1/g1ConcurrentMark.inline.hpp"
 #include "gc/g1/g1OopClosures.hpp"
 #include "gc/g1/g1ParScanThreadState.inline.hpp"
 #include "gc/g1/g1RemSet.hpp"
diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
index 52594f9..51750b8 100644
--- a/hotspot/src/share/vm/prims/whitebox.cpp
+++ b/hotspot/src/share/vm/prims/whitebox.cpp
@@ -51,9 +51,9 @@
 #include "utilities/exceptions.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/concurrentMark.hpp"
 #include "gc/g1/concurrentMarkThread.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1ConcurrentMark.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
 #include "gc/parallel/adjoiningGenerations.hpp"