--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Thu Apr 28 15:29:18 2011 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Fri Apr 29 12:40:49 2011 -0400
@@ -316,6 +316,19 @@
void setEmpty() { _index = 0; clear_overflow(); }
};
+class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC {
+private:
+#ifndef PRODUCT
+ uintx _num_remaining;
+ bool _force;
+#endif // !defined(PRODUCT)
+
+public:
+ void init() PRODUCT_RETURN;
+ void update() PRODUCT_RETURN;
+ bool should_force() PRODUCT_RETURN_( return false; );
+};
+
// this will enable a variety of different statistics per GC task
#define _MARKING_STATS_ 0
// this will enable the higher verbose levels
@@ -462,6 +475,9 @@
WorkGang* _parallel_workers;
+ ForceOverflowSettings _force_overflow_conc;
+ ForceOverflowSettings _force_overflow_stw;
+
void weakRefsWork(bool clear_all_soft_refs);
void swapMarkBitMaps();
@@ -470,7 +486,7 @@
// task local ones; should be called during initial mark.
void reset();
// It resets all the marking data structures.
- void clear_marking_state();
+ void clear_marking_state(bool clear_overflow = true);
// It should be called to indicate which phase we're in (concurrent
// mark or remark) and how many threads are currently active.
@@ -547,6 +563,22 @@
void enter_first_sync_barrier(int task_num);
void enter_second_sync_barrier(int task_num);
+ ForceOverflowSettings* force_overflow_conc() {
+ return &_force_overflow_conc;
+ }
+
+ ForceOverflowSettings* force_overflow_stw() {
+ return &_force_overflow_stw;
+ }
+
+ ForceOverflowSettings* force_overflow() {
+ if (concurrent()) {
+ return force_overflow_conc();
+ } else {
+ return force_overflow_stw();
+ }
+ }
+
public:
// Manipulation of the global mark stack.
// Notice that the first mark_stack_push is CAS-based, whereas the