hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp
changeset 33608 7afc768e4d62
parent 31597 f63dde8cc8f7
child 35061 be6025ebffea
equal deleted inserted replaced
33607:2db29ded3865 33608:7afc768e4d62
    25 #ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_HPP
    25 #ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_HPP
    26 #define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_HPP
    26 #define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_HPP
    27 
    27 
    28 #include "gc/shared/concurrentGCThread.hpp"
    28 #include "gc/shared/concurrentGCThread.hpp"
    29 
    29 
    30 // The Concurrent Mark GC Thread (could be several in the future).
    30 // The Concurrent Mark GC Thread triggers the parallel CMConcurrentMarkingTasks
    31 // This is copied from the Concurrent Mark Sweep GC Thread
    31 // as well as handling various marking cleanup.
    32 // Still under construction.
       
    33 
    32 
    34 class ConcurrentMark;
    33 class ConcurrentMark;
       
    34 class G1CollectorPolicy;
    35 
    35 
    36 class ConcurrentMarkThread: public ConcurrentGCThread {
    36 class ConcurrentMarkThread: public ConcurrentGCThread {
    37   friend class VMStructs;
    37   friend class VMStructs;
    38 
    38 
    39   double _vtime_start;  // Initial virtual time.
    39   double _vtime_start;  // Initial virtual time.
    55   };
    55   };
    56 
    56 
    57   volatile State _state;
    57   volatile State _state;
    58 
    58 
    59   void sleepBeforeNextCycle();
    59   void sleepBeforeNextCycle();
       
    60   void delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool remark);
       
    61 
       
    62   void run_service();
       
    63   void stop_service();
    60 
    64 
    61   static SurrogateLockerThread*         _slt;
    65   static SurrogateLockerThread*         _slt;
    62 
    66 
    63  public:
    67  public:
    64   // Constructor
    68   // Constructor
    65   ConcurrentMarkThread(ConcurrentMark* cm);
    69   ConcurrentMarkThread(ConcurrentMark* cm);
    66 
    70 
    67   static void makeSurrogateLockerThread(TRAPS);
    71   static void makeSurrogateLockerThread(TRAPS);
    68   static SurrogateLockerThread* slt() { return _slt; }
    72   static SurrogateLockerThread* slt() { return _slt; }
    69 
    73 
    70   // Total virtual time so far.
    74   // Total virtual time so far for this thread and concurrent marking tasks.
    71   double vtime_accum();
    75   double vtime_accum();
    72   // Marking virtual time so far
    76   // Marking virtual time so far this thread and concurrent marking tasks.
    73   double vtime_mark_accum();
    77   double vtime_mark_accum();
    74 
    78 
    75   ConcurrentMark* cm()     { return _cm; }
    79   ConcurrentMark* cm()     { return _cm; }
    76 
    80 
    77   void set_idle()          { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
    81   void set_idle()          { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }