1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Dec 14 12:15:26 2011 +0100 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Dec 14 17:43:55 2011 -0800 1.3 @@ -943,6 +943,16 @@ 1.4 // discovery. 1.5 G1CMIsAliveClosure _is_alive_closure_cm; 1.6 1.7 + // Cache used by G1CollectedHeap::start_cset_region_for_worker(). 1.8 + HeapRegion** _worker_cset_start_region; 1.9 + 1.10 + // Time stamp to validate the regions recorded in the cache 1.11 + // used by G1CollectedHeap::start_cset_region_for_worker(). 1.12 + // The heap region entry for a given worker is valid iff 1.13 + // the associated time stamp value matches the current value 1.14 + // of G1CollectedHeap::_gc_time_stamp. 1.15 + unsigned int* _worker_cset_start_region_time_stamp; 1.16 + 1.17 enum G1H_process_strong_roots_tasks { 1.18 G1H_PS_mark_stack_oops_do, 1.19 G1H_PS_refProcessor_oops_do, 1.20 @@ -1030,6 +1040,9 @@ 1.21 void reset_gc_time_stamp() { 1.22 _gc_time_stamp = 0; 1.23 OrderAccess::fence(); 1.24 + // Clear the cached CSet starting regions and time stamps. 1.25 + // Their validity is dependent on the GC timestamp. 1.26 + clear_cset_start_regions(); 1.27 } 1.28 1.29 void increment_gc_time_stamp() { 1.30 @@ -1300,9 +1313,12 @@ 1.31 bool check_cset_heap_region_claim_values(jint claim_value); 1.32 #endif // ASSERT 1.33 1.34 - // Given the id of a worker, calculate a suitable 1.35 - // starting region for iterating over the current 1.36 - // collection set. 1.37 + // Clear the cached cset start regions and (more importantly) 1.38 + // the time stamps. Called when we reset the GC time stamp. 1.39 + void clear_cset_start_regions(); 1.40 + 1.41 + // Given the id of a worker, obtain or calculate a suitable 1.42 + // starting region for iterating over the current collection set. 1.43 HeapRegion* start_cset_region_for_worker(int worker_i); 1.44 1.45 // Iterate over the regions (if any) in the current collection set.