src/share/vm/gc/g1/g1ConcurrentMark.hpp

Print this page

        

@@ -190,10 +190,12 @@
 
   // Allocate a new chunk from the reserved memory, using the high water mark. Returns
   // NULL if out of memory.
   OopChunk* allocate_new_chunk();
 
+  // This is set by any task, when an overflow on the global data
+  // structures is detected
   volatile bool _out_of_memory;
 
   // Atomically add the given chunk to the list.
   void add_chunk_to_list(OopChunk* volatile* list, OopChunk* elem);
   // Atomically remove and return a chunk from the given list. Returns NULL if the

@@ -384,13 +386,10 @@
   // structures (local and global) have been re-initialized. When they
   // exit it, they are free to start working again.
   WorkGangBarrierSync     _first_overflow_barrier_sync;
   WorkGangBarrierSync     _second_overflow_barrier_sync;
 
-  // This is set by any task, when an overflow on the global data
-  // structures is detected
-  volatile bool           _has_overflown;
   // True: marking is concurrent, false: we're in remark
   volatile bool           _concurrent;
   // Set at the end of a Full GC so that marking aborts
   volatile bool           _has_aborted;
 

@@ -430,11 +429,11 @@
   // task local ones; should be called during initial mark.
   void reset();
 
   // Resets all the marking data structures. Called when we have to restart
   // marking or when marking completes (via set_non_marking_state below).
-  void reset_marking_state(bool clear_overflow = true);
+  void reset_marking_state();
 
   // We do this after we're done with marking so that the marking data
   // structures are initialized to a sensible and predictable state.
   void set_non_marking_state();
 

@@ -503,13 +502,12 @@
   // Returns the task queue set
   G1CMTaskQueueSet* task_queues()  { return _task_queues; }
 
   // Access / manipulation of the overflow flag which is set to
   // indicate that the global stack has overflown
-  bool has_overflown()           { return _has_overflown; }
-  void set_has_overflown()       { _has_overflown = true; }
-  void clear_has_overflown()     { _has_overflown = false; }
+  bool has_overflown()           { return _global_mark_stack.is_out_of_memory(); }
+  void clear_has_overflown()     { _global_mark_stack.clear_out_of_memory(); }
   bool restart_for_overflow()    { return _restart_for_overflow; }
 
   // Methods to enter the two overflow sync barriers
   void enter_first_sync_barrier(uint worker_id);
   void enter_second_sync_barrier(uint worker_id);

@@ -530,22 +528,17 @@
 public:
   // Manipulation of the global mark stack.
   // The push and pop operations are used by tasks for transfers
   // between task-local queues and the global mark stack.
   bool mark_stack_push(oop* arr) {
-    if (!_global_mark_stack.par_push_chunk(arr)) {
-      set_has_overflown();
-      return false;
-    }
-    return true;
+    return _global_mark_stack.par_push_chunk(arr);
   }
   bool mark_stack_pop(oop* arr) {
     return _global_mark_stack.par_pop_chunk(arr);
   }
   size_t mark_stack_size()                { return _global_mark_stack.size(); }
   size_t partial_mark_stack_size_target() { return _global_mark_stack.capacity()/3; }
-  bool mark_stack_overflow()              { return _global_mark_stack.is_out_of_memory(); }
   bool mark_stack_empty()                 { return _global_mark_stack.is_empty(); }
 
   G1CMRootRegions* root_regions() { return &_root_regions; }
 
   bool concurrent_marking_in_progress() {