1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Jun 14 10:33:43 2011 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Tue Jun 14 11:01:10 2011 -0700 1.3 @@ -1347,14 +1347,20 @@ 1.4 1.5 // Perform verification. 1.6 1.7 - // use_prev_marking == true -> use "prev" marking information, 1.8 - // use_prev_marking == false -> use "next" marking information 1.9 + // vo == UsePrevMarking -> use "prev" marking information, 1.10 + // vo == UseNextMarking -> use "next" marking information 1.11 + // vo == UseMarkWord -> use the mark word in the object header 1.12 + // 1.13 // NOTE: Only the "prev" marking information is guaranteed to be 1.14 // consistent most of the time, so most calls to this should use 1.15 - // use_prev_marking == true. Currently, there is only one case where 1.16 - // this is called with use_prev_marking == false, which is to verify 1.17 - // the "next" marking information at the end of remark. 1.18 - void verify(bool allow_dirty, bool silent, bool use_prev_marking); 1.19 + // vo == UsePrevMarking. 1.20 + // Currently, there is only one case where this is called with 1.21 + // vo == UseNextMarking, which is to verify the "next" marking 1.22 + // information at the end of remark. 1.23 + // Currently there is only one place where this is called with 1.24 + // vo == UseMarkWord, which is to verify the marking during a 1.25 + // full GC. 1.26 + void verify(bool allow_dirty, bool silent, VerifyOption vo); 1.27 1.28 // Override; it uses the "prev" marking information 1.29 virtual void verify(bool allow_dirty, bool silent); 1.30 @@ -1402,24 +1408,27 @@ 1.31 // bitmap off to the side. 1.32 void doConcurrentMark(); 1.33 1.34 - // This is called from the marksweep collector which then does 1.35 - // a concurrent mark and verifies that the results agree with 1.36 - // the stop the world marking. 1.37 - void checkConcurrentMark(); 1.38 + // Do a full concurrent marking, synchronously. 1.39 void do_sync_mark(); 1.40 1.41 bool isMarkedPrev(oop obj) const; 1.42 bool isMarkedNext(oop obj) const; 1.43 1.44 - // use_prev_marking == true -> use "prev" marking information, 1.45 - // use_prev_marking == false -> use "next" marking information 1.46 + // vo == UsePrevMarking -> use "prev" marking information, 1.47 + // vo == UseNextMarking -> use "next" marking information, 1.48 + // vo == UseMarkWord -> use mark word from object header 1.49 bool is_obj_dead_cond(const oop obj, 1.50 const HeapRegion* hr, 1.51 - const bool use_prev_marking) const { 1.52 - if (use_prev_marking) { 1.53 - return is_obj_dead(obj, hr); 1.54 - } else { 1.55 - return is_obj_ill(obj, hr); 1.56 + const VerifyOption vo) const { 1.57 + 1.58 + switch (vo) { 1.59 + case VerifyOption_G1UsePrevMarking: 1.60 + return is_obj_dead(obj, hr); 1.61 + case VerifyOption_G1UseNextMarking: 1.62 + return is_obj_ill(obj, hr); 1.63 + default: 1.64 + assert(vo == VerifyOption_G1UseMarkWord, "must be"); 1.65 + return !obj->is_gc_marked(); 1.66 } 1.67 } 1.68 1.69 @@ -1460,18 +1469,24 @@ 1.70 // Added if it is in permanent gen it isn't dead. 1.71 // Added if it is NULL it isn't dead. 1.72 1.73 - // use_prev_marking == true -> use "prev" marking information, 1.74 - // use_prev_marking == false -> use "next" marking information 1.75 + // vo == UsePrevMarking -> use "prev" marking information, 1.76 + // vo == UseNextMarking -> use "next" marking information, 1.77 + // vo == UseMarkWord -> use mark word from object header 1.78 bool is_obj_dead_cond(const oop obj, 1.79 - const bool use_prev_marking) { 1.80 - if (use_prev_marking) { 1.81 - return is_obj_dead(obj); 1.82 - } else { 1.83 - return is_obj_ill(obj); 1.84 + const VerifyOption vo) const { 1.85 + 1.86 + switch (vo) { 1.87 + case VerifyOption_G1UsePrevMarking: 1.88 + return is_obj_dead(obj); 1.89 + case VerifyOption_G1UseNextMarking: 1.90 + return is_obj_ill(obj); 1.91 + default: 1.92 + assert(vo == VerifyOption_G1UseMarkWord, "must be"); 1.93 + return !obj->is_gc_marked(); 1.94 } 1.95 } 1.96 1.97 - bool is_obj_dead(const oop obj) { 1.98 + bool is_obj_dead(const oop obj) const { 1.99 const HeapRegion* hr = heap_region_containing(obj); 1.100 if (hr == NULL) { 1.101 if (Universe::heap()->is_in_permanent(obj)) 1.102 @@ -1482,7 +1497,7 @@ 1.103 else return is_obj_dead(obj, hr); 1.104 } 1.105 1.106 - bool is_obj_ill(const oop obj) { 1.107 + bool is_obj_ill(const oop obj) const { 1.108 const HeapRegion* hr = heap_region_containing(obj); 1.109 if (hr == NULL) { 1.110 if (Universe::heap()->is_in_permanent(obj))