comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 811:830ca2573896

6850846: G1: extend G1 marking verification Summary: extend G1 marking verification to use either the "prev" or "next" marking information, as appropriate. Reviewed-by: johnc, ysr
author tonyp
date Fri, 12 Jun 2009 16:20:16 -0400
parents d44bdab1c03d
children 0316eac49d5a
comparison
equal deleted inserted replaced
809:6e2afda171db 811:830ca2573896
1047 1047
1048 // Perform any cleanup actions necessary before allowing a verification. 1048 // Perform any cleanup actions necessary before allowing a verification.
1049 virtual void prepare_for_verify(); 1049 virtual void prepare_for_verify();
1050 1050
1051 // Perform verification. 1051 // Perform verification.
1052
1053 // use_prev_marking == true -> use "prev" marking information,
1054 // use_prev_marking == false -> use "next" marking information
1055 // NOTE: Only the "prev" marking information is guaranteed to be
1056 // consistent most of the time, so most calls to this should use
1057 // use_prev_marking == true. Currently, there is only one case where
1058 // this is called with use_prev_marking == false, which is to verify
1059 // the "next" marking information at the end of remark.
1060 void verify(bool allow_dirty, bool silent, bool use_prev_marking);
1061
1062 // Override; it uses the "prev" marking information
1052 virtual void verify(bool allow_dirty, bool silent); 1063 virtual void verify(bool allow_dirty, bool silent);
1053 virtual void print() const; 1064 virtual void print() const;
1054 virtual void print_on(outputStream* st) const; 1065 virtual void print_on(outputStream* st) const;
1055 1066
1056 virtual void print_gc_threads_on(outputStream* st) const; 1067 virtual void print_gc_threads_on(outputStream* st) const;
1122 void checkConcurrentMark(); 1133 void checkConcurrentMark();
1123 void do_sync_mark(); 1134 void do_sync_mark();
1124 1135
1125 bool isMarkedPrev(oop obj) const; 1136 bool isMarkedPrev(oop obj) const;
1126 bool isMarkedNext(oop obj) const; 1137 bool isMarkedNext(oop obj) const;
1138
1139 // use_prev_marking == true -> use "prev" marking information,
1140 // use_prev_marking == false -> use "next" marking information
1141 bool is_obj_dead_cond(const oop obj,
1142 const HeapRegion* hr,
1143 const bool use_prev_marking) const {
1144 if (use_prev_marking) {
1145 return is_obj_dead(obj, hr);
1146 } else {
1147 return is_obj_ill(obj, hr);
1148 }
1149 }
1127 1150
1128 // Determine if an object is dead, given the object and also 1151 // Determine if an object is dead, given the object and also
1129 // the region to which the object belongs. An object is dead 1152 // the region to which the object belongs. An object is dead
1130 // iff a) it was not allocated since the last mark and b) it 1153 // iff a) it was not allocated since the last mark and b) it
1131 // is not marked. 1154 // is not marked.
1160 // then call the region version of the same function. 1183 // then call the region version of the same function.
1161 1184
1162 // Added if it is in permanent gen it isn't dead. 1185 // Added if it is in permanent gen it isn't dead.
1163 // Added if it is NULL it isn't dead. 1186 // Added if it is NULL it isn't dead.
1164 1187
1165 bool is_obj_dead(oop obj) { 1188 // use_prev_marking == true -> use "prev" marking information,
1166 HeapRegion* hr = heap_region_containing(obj); 1189 // use_prev_marking == false -> use "next" marking information
1190 bool is_obj_dead_cond(const oop obj,
1191 const bool use_prev_marking) {
1192 if (use_prev_marking) {
1193 return is_obj_dead(obj);
1194 } else {
1195 return is_obj_ill(obj);
1196 }
1197 }
1198
1199 bool is_obj_dead(const oop obj) {
1200 const HeapRegion* hr = heap_region_containing(obj);
1167 if (hr == NULL) { 1201 if (hr == NULL) {
1168 if (Universe::heap()->is_in_permanent(obj)) 1202 if (Universe::heap()->is_in_permanent(obj))
1169 return false; 1203 return false;
1170 else if (obj == NULL) return false; 1204 else if (obj == NULL) return false;
1171 else return true; 1205 else return true;
1172 } 1206 }
1173 else return is_obj_dead(obj, hr); 1207 else return is_obj_dead(obj, hr);
1174 } 1208 }
1175 1209
1176 bool is_obj_ill(oop obj) { 1210 bool is_obj_ill(const oop obj) {
1177 HeapRegion* hr = heap_region_containing(obj); 1211 const HeapRegion* hr = heap_region_containing(obj);
1178 if (hr == NULL) { 1212 if (hr == NULL) {
1179 if (Universe::heap()->is_in_permanent(obj)) 1213 if (Universe::heap()->is_in_permanent(obj))
1180 return false; 1214 return false;
1181 else if (obj == NULL) return false; 1215 else if (obj == NULL) return false;
1182 else return true; 1216 else return true;