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 1103 assert(new_finger >= _finger && new_finger < _region_limit, "invariant"); 1104 _finger = new_finger; 1105 } 1106 1107 // moves the region finger to a new location 1108 inline void move_region_finger_to(HeapWord* new_finger) { 1109 assert(new_finger < _cm->finger(), "invariant"); 1110 _region_finger = new_finger; 1111 } 1112 1113 CMTask(int task_num, ConcurrentMark *cm, 1114 CMTaskQueue* task_queue, CMTaskQueueSet* task_queues); 1115 1116 // it prints statistics associated with this task 1117 void print_stats(); 1118 1119 #if _MARKING_STATS_ 1120 void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; } 1121 #endif // _MARKING_STATS_ 1122 }; | 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 1109 assert(new_finger >= _finger && new_finger < _region_limit, "invariant"); 1110 _finger = new_finger; 1111 } 1112 1113 // moves the region finger to a new location 1114 inline void move_region_finger_to(HeapWord* new_finger) { 1115 assert(new_finger < _cm->finger(), "invariant"); 1116 _region_finger = new_finger; 1117 } 1118 1119 CMTask(int task_num, ConcurrentMark *cm, 1120 CMTaskQueue* task_queue, CMTaskQueueSet* task_queues); 1121 1122 // it prints statistics associated with this task 1123 void print_stats(); 1124 1125 #if _MARKING_STATS_ 1126 void increase_objs_found_on_bitmap() { ++_objs_found_on_bitmap; } 1127 #endif // _MARKING_STATS_ 1128 }; 1129 1130 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP |