comparison src/share/vm/gc_implementation/g1/concurrentMark.hpp @ 3771:842b840e67db

7046558: G1: concurrent marking optimizations Summary: Some optimizations to improve the concurrent marking phase: specialize the main oop closure, make sure a few methods in the fast path are properly inlined, a few more bits and pieces, and some cosmetic fixes. Reviewed-by: stefank, johnc
author tonyp
date Tue, 14 Jun 2011 10:33:43 -0400
parents 69293e516993
children 6747fd0512e0
comparison
equal deleted inserted replaced
3770:74cd10898bea 3771:842b840e67db
129 129
130 // write marks 130 // write marks
131 void mark(HeapWord* addr) { 131 void mark(HeapWord* addr) {
132 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 132 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize),
133 "outside underlying space?"); 133 "outside underlying space?");
134 _bm.at_put(heapWordToOffset(addr), true); 134 _bm.set_bit(heapWordToOffset(addr));
135 } 135 }
136 void clear(HeapWord* addr) { 136 void clear(HeapWord* addr) {
137 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 137 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize),
138 "outside underlying space?"); 138 "outside underlying space?");
139 _bm.at_put(heapWordToOffset(addr), false); 139 _bm.clear_bit(heapWordToOffset(addr));
140 } 140 }
141 bool parMark(HeapWord* addr) { 141 bool parMark(HeapWord* addr) {
142 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 142 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize),
143 "outside underlying space?"); 143 "outside underlying space?");
144 return _bm.par_at_put(heapWordToOffset(addr), true); 144 return _bm.par_set_bit(heapWordToOffset(addr));
145 } 145 }
146 bool parClear(HeapWord* addr) { 146 bool parClear(HeapWord* addr) {
147 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize), 147 assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize),
148 "outside underlying space?"); 148 "outside underlying space?");
149 return _bm.par_at_put(heapWordToOffset(addr), false); 149 return _bm.par_clear_bit(heapWordToOffset(addr));
150 } 150 }
151 void markRange(MemRegion mr); 151 void markRange(MemRegion mr);
152 void clearAll(); 152 void clearAll();
153 void clearRange(MemRegion mr); 153 void clearRange(MemRegion mr);
154 154
926 double _time_target_ms; 926 double _time_target_ms;
927 // the start time of the current marking step 927 // the start time of the current marking step
928 double _start_time_ms; 928 double _start_time_ms;
929 929
930 // the oop closure used for iterations over oops 930 // the oop closure used for iterations over oops
931 OopClosure* _oop_closure; 931 G1CMOopClosure* _cm_oop_closure;
932 932
933 // the region this task is scanning, NULL if we're not scanning any 933 // the region this task is scanning, NULL if we're not scanning any
934 HeapRegion* _curr_region; 934 HeapRegion* _curr_region;
935 // the local finger of this task, NULL if we're not scanning a region 935 // the local finger of this task, NULL if we're not scanning a region
936 HeapWord* _finger; 936 HeapWord* _finger;
1120 { _aborted_region = mr; } 1120 { _aborted_region = mr; }
1121 1121
1122 // Clears any recorded partially scanned region 1122 // Clears any recorded partially scanned region
1123 void clear_aborted_region() { set_aborted_region(MemRegion()); } 1123 void clear_aborted_region() { set_aborted_region(MemRegion()); }
1124 1124
1125 void set_oop_closure(OopClosure* oop_closure) { 1125 void set_cm_oop_closure(G1CMOopClosure* cm_oop_closure);
1126 _oop_closure = oop_closure;
1127 }
1128 1126
1129 // It grays the object by marking it and, if necessary, pushing it 1127 // It grays the object by marking it and, if necessary, pushing it
1130 // on the local queue 1128 // on the local queue
1131 void deal_with_reference(oop obj); 1129 inline void deal_with_reference(oop obj);
1132 1130
1133 // It scans an object and visits its children. 1131 // It scans an object and visits its children.
1134 void scan_object(oop obj) { 1132 void scan_object(oop obj);
1135 assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
1136
1137 if (_cm->verbose_high())
1138 gclog_or_tty->print_cr("[%d] we're scanning object "PTR_FORMAT,
1139 _task_id, (void*) obj);
1140
1141 size_t obj_size = obj->size();
1142 _words_scanned += obj_size;
1143
1144 obj->oop_iterate(_oop_closure);
1145 statsOnly( ++_objs_scanned );
1146 check_limits();
1147 }
1148 1133
1149 // It pushes an object on the local queue. 1134 // It pushes an object on the local queue.
1150 void push(oop obj); 1135 inline void push(oop obj);
1151 1136
1152 // These two move entries to/from the global stack. 1137 // These two move entries to/from the global stack.
1153 void move_entries_to_global_stack(); 1138 void move_entries_to_global_stack();
1154 void get_entries_from_global_stack(); 1139 void get_entries_from_global_stack();
1155 1140