1.1 --- a/src/share/vm/gc_implementation/g1/concurrentMark.hpp Thu Apr 28 15:29:18 2011 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/concurrentMark.hpp Fri Apr 29 12:40:49 2011 -0400 1.3 @@ -316,6 +316,19 @@ 1.4 void setEmpty() { _index = 0; clear_overflow(); } 1.5 }; 1.6 1.7 +class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC { 1.8 +private: 1.9 +#ifndef PRODUCT 1.10 + uintx _num_remaining; 1.11 + bool _force; 1.12 +#endif // !defined(PRODUCT) 1.13 + 1.14 +public: 1.15 + void init() PRODUCT_RETURN; 1.16 + void update() PRODUCT_RETURN; 1.17 + bool should_force() PRODUCT_RETURN_( return false; ); 1.18 +}; 1.19 + 1.20 // this will enable a variety of different statistics per GC task 1.21 #define _MARKING_STATS_ 0 1.22 // this will enable the higher verbose levels 1.23 @@ -462,6 +475,9 @@ 1.24 1.25 WorkGang* _parallel_workers; 1.26 1.27 + ForceOverflowSettings _force_overflow_conc; 1.28 + ForceOverflowSettings _force_overflow_stw; 1.29 + 1.30 void weakRefsWork(bool clear_all_soft_refs); 1.31 1.32 void swapMarkBitMaps(); 1.33 @@ -470,7 +486,7 @@ 1.34 // task local ones; should be called during initial mark. 1.35 void reset(); 1.36 // It resets all the marking data structures. 1.37 - void clear_marking_state(); 1.38 + void clear_marking_state(bool clear_overflow = true); 1.39 1.40 // It should be called to indicate which phase we're in (concurrent 1.41 // mark or remark) and how many threads are currently active. 1.42 @@ -547,6 +563,22 @@ 1.43 void enter_first_sync_barrier(int task_num); 1.44 void enter_second_sync_barrier(int task_num); 1.45 1.46 + ForceOverflowSettings* force_overflow_conc() { 1.47 + return &_force_overflow_conc; 1.48 + } 1.49 + 1.50 + ForceOverflowSettings* force_overflow_stw() { 1.51 + return &_force_overflow_stw; 1.52 + } 1.53 + 1.54 + ForceOverflowSettings* force_overflow() { 1.55 + if (concurrent()) { 1.56 + return force_overflow_conc(); 1.57 + } else { 1.58 + return force_overflow_stw(); 1.59 + } 1.60 + } 1.61 + 1.62 public: 1.63 // Manipulation of the global mark stack. 1.64 // Notice that the first mark_stack_push is CAS-based, whereas the