hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp
changeset 36588 263860708cc6
parent 36084 9a3bf78e9a76
child 37122 5318124fe3a8
equal deleted inserted replaced
36572:bdbf53032b6a 36588:263860708cc6
   350   // point when all the tasks complete their work. It is really used
   350   // point when all the tasks complete their work. It is really used
   351   // to determine the points between the end of concurrent marking and
   351   // to determine the points between the end of concurrent marking and
   352   // time of remark.
   352   // time of remark.
   353   volatile bool           _concurrent_marking_in_progress;
   353   volatile bool           _concurrent_marking_in_progress;
   354 
   354 
   355   // Keep track of whether we have started concurrent phase or not.
   355   // There would be a race between ConcurrentMarkThread and VMThread(ConcurrentMark::abort())
   356   bool                    _concurrent_phase_started;
   356   // to call ConcurrentGCTimer::register_gc_concurrent_end().
       
   357   // And this variable is used to keep track of concurrent phase.
       
   358   volatile uint           _concurrent_phase_status;
       
   359   // Concurrent phase is not yet started.
       
   360   static const uint       ConcPhaseNotStarted = 0;
       
   361   // Concurrent phase is started.
       
   362   static const uint       ConcPhaseStarted = 1;
       
   363   // Caller thread of ConcurrentGCTimer::register_gc_concurrent_end() is ending concurrent phase.
       
   364   // So other thread should wait until the status to be changed to ConcPhaseNotStarted.
       
   365   static const uint       ConcPhaseStopping = 2;
   357 
   366 
   358   // All of these times are in ms
   367   // All of these times are in ms
   359   NumberSeq _init_times;
   368   NumberSeq _init_times;
   360   NumberSeq _remark_times;
   369   NumberSeq _remark_times;
   361   NumberSeq _remark_mark_times;
   370   NumberSeq _remark_mark_times;
   483   intptr_t _heap_bottom_card_num;
   492   intptr_t _heap_bottom_card_num;
   484 
   493 
   485   // Set to true when initialization is complete
   494   // Set to true when initialization is complete
   486   bool _completed_initialization;
   495   bool _completed_initialization;
   487 
   496 
       
   497   // end_timer, true to end gc timer after ending concurrent phase.
       
   498   void register_concurrent_phase_end_common(bool end_timer);
       
   499 
   488 public:
   500 public:
   489   // Manipulation of the global mark stack.
   501   // Manipulation of the global mark stack.
   490   // The push and pop operations are used by tasks for transfers
   502   // The push and pop operations are used by tasks for transfers
   491   // between task-local queues and the global mark stack, and use
   503   // between task-local queues and the global mark stack, and use
   492   // locking for concurrency safety.
   504   // locking for concurrency safety.
   518     _concurrent_marking_in_progress = false;
   530     _concurrent_marking_in_progress = false;
   519   }
   531   }
   520 
   532 
   521   void register_concurrent_phase_start(const char* title);
   533   void register_concurrent_phase_start(const char* title);
   522   void register_concurrent_phase_end();
   534   void register_concurrent_phase_end();
       
   535   // Ends both concurrent phase and timer.
       
   536   void register_concurrent_gc_end_and_stop_timer();
   523 
   537 
   524   void update_accum_task_vtime(int i, double vtime) {
   538   void update_accum_task_vtime(int i, double vtime) {
   525     _accum_task_vtime[i] += vtime;
   539     _accum_task_vtime[i] += vtime;
   526   }
   540   }
   527 
   541