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

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 class G1CollectedHeap;
  26 class CMTask;
  27 typedef GenericTaskQueue<oop>            CMTaskQueue;
  28 typedef GenericTaskQueueSet<CMTaskQueue> CMTaskQueueSet;
  29 
  30 // A generic CM bit map.  This is essentially a wrapper around the BitMap
  31 // class, with one bit per (1<<_shifter) HeapWords.
  32 
  33 class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
  34  protected:
  35   HeapWord* _bmStartWord;      // base address of range covered by map
  36   size_t    _bmWordSize;       // map size (in #HeapWords covered)
  37   const int _shifter;          // map to char or bit
  38   VirtualSpace _virtual_space; // underlying the bit map
  39   BitMap    _bm;               // the bit map itself
  40 
  41  public:
  42   // constructor
  43   CMBitMapRO(ReservedSpace rs, int shifter);
  44 


1064     assert(new_finger >= _finger && new_finger < _region_limit, "invariant");
1065     _finger = new_finger;
1066   }
1067 
1068   // moves the region finger to a new location
1069   inline void move_region_finger_to(HeapWord* new_finger) {
1070     assert(new_finger < _cm->finger(), "invariant");
1071     _region_finger = new_finger;
1072   }
1073 
1074   CMTask(int task_num, ConcurrentMark *cm,
1075          CMTaskQueue* task_queue, CMTaskQueueSet* task_queues);
1076 
1077   // it prints statistics associated with this task
1078   void print_stats();
1079 
1080 #if _MARKING_STATS_
1081   void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; }
1082 #endif // _MARKING_STATS_
1083 };




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  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 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
  27 
  28 #include "gc_implementation/g1/heapRegion.hpp"
  29 #include "utilities/taskqueue.hpp"
  30 
  31 class G1CollectedHeap;
  32 class CMTask;
  33 typedef GenericTaskQueue<oop>            CMTaskQueue;
  34 typedef GenericTaskQueueSet<CMTaskQueue> CMTaskQueueSet;
  35 
  36 // A generic CM bit map.  This is essentially a wrapper around the BitMap
  37 // class, with one bit per (1<<_shifter) HeapWords.
  38 
  39 class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
  40  protected:
  41   HeapWord* _bmStartWord;      // base address of range covered by map
  42   size_t    _bmWordSize;       // map size (in #HeapWords covered)
  43   const int _shifter;          // map to char or bit
  44   VirtualSpace _virtual_space; // underlying the bit map
  45   BitMap    _bm;               // the bit map itself
  46 
  47  public:
  48   // constructor
  49   CMBitMapRO(ReservedSpace rs, int shifter);
  50 


1070     assert(new_finger >= _finger && new_finger < _region_limit, "invariant");
1071     _finger = new_finger;
1072   }
1073 
1074   // moves the region finger to a new location
1075   inline void move_region_finger_to(HeapWord* new_finger) {
1076     assert(new_finger < _cm->finger(), "invariant");
1077     _region_finger = new_finger;
1078   }
1079 
1080   CMTask(int task_num, ConcurrentMark *cm,
1081          CMTaskQueue* task_queue, CMTaskQueueSet* task_queues);
1082 
1083   // it prints statistics associated with this task
1084   void print_stats();
1085 
1086 #if _MARKING_STATS_
1087   void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; }
1088 #endif // _MARKING_STATS_
1089 };
1090 
1091 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP