< prev index next >

src/share/vm/memory/sharedHeap.hpp

Print this page




 107 protected:
 108   // If we're doing parallel GC, use this gang of threads.
 109   FlexibleWorkGang* _workers;
 110 
 111   // Full initialization is done in a concrete subtype's "initialize"
 112   // function.
 113   SharedHeap();
 114 
 115 public:
 116   // Iteration functions.
 117   void oop_iterate(ExtendedOopClosure* cl) = 0;
 118 
 119   // Iterate over all spaces in use in the heap, in an undefined order.
 120   virtual void space_iterate(SpaceClosure* cl) = 0;
 121 
 122   // A SharedHeap will contain some number of spaces.  This finds the
 123   // space whose reserved area contains the given address, or else returns
 124   // NULL.
 125   virtual Space* space_containing(const void* addr) const = 0;
 126 
 127   bool no_gc_in_progress() { return !is_gc_active(); }
 128 
 129   // Note, the below comment needs to be updated to reflect the changes
 130   // introduced by JDK-8076225. This should be done as part of JDK-8076289.
 131   //
 132   //Some collectors will perform "process_strong_roots" in parallel.
 133   // Such a call will involve claiming some fine-grained tasks, such as
 134   // scanning of threads.  To make this process simpler, we provide the
 135   // "strong_roots_parity()" method.  Collectors that start parallel tasks
 136   // whose threads invoke "process_strong_roots" must
 137   // call "change_strong_roots_parity" in sequential code starting such a
 138   // task.  (This also means that a parallel thread may only call
 139   // process_strong_roots once.)
 140   //
 141   // For calls to process_roots by sequential code, the parity is
 142   // updated automatically.
 143   //
 144   // The idea is that objects representing fine-grained tasks, such as
 145   // threads, will contain a "parity" field.  A task will is claimed in the
 146   // current "process_roots" call only if its parity field is the
 147   // same as the "strong_roots_parity"; task claiming is accomplished by
 148   // updating the parity field to the strong_roots_parity with a CAS.




 107 protected:
 108   // If we're doing parallel GC, use this gang of threads.
 109   FlexibleWorkGang* _workers;
 110 
 111   // Full initialization is done in a concrete subtype's "initialize"
 112   // function.
 113   SharedHeap();
 114 
 115 public:
 116   // Iteration functions.
 117   void oop_iterate(ExtendedOopClosure* cl) = 0;
 118 
 119   // Iterate over all spaces in use in the heap, in an undefined order.
 120   virtual void space_iterate(SpaceClosure* cl) = 0;
 121 
 122   // A SharedHeap will contain some number of spaces.  This finds the
 123   // space whose reserved area contains the given address, or else returns
 124   // NULL.
 125   virtual Space* space_containing(const void* addr) const = 0;
 126 


 127   // Note, the below comment needs to be updated to reflect the changes
 128   // introduced by JDK-8076225. This should be done as part of JDK-8076289.
 129   //
 130   //Some collectors will perform "process_strong_roots" in parallel.
 131   // Such a call will involve claiming some fine-grained tasks, such as
 132   // scanning of threads.  To make this process simpler, we provide the
 133   // "strong_roots_parity()" method.  Collectors that start parallel tasks
 134   // whose threads invoke "process_strong_roots" must
 135   // call "change_strong_roots_parity" in sequential code starting such a
 136   // task.  (This also means that a parallel thread may only call
 137   // process_strong_roots once.)
 138   //
 139   // For calls to process_roots by sequential code, the parity is
 140   // updated automatically.
 141   //
 142   // The idea is that objects representing fine-grained tasks, such as
 143   // threads, will contain a "parity" field.  A task will is claimed in the
 144   // current "process_roots" call only if its parity field is the
 145   // same as the "strong_roots_parity"; task claiming is accomplished by
 146   // updating the parity field to the strong_roots_parity with a CAS.


< prev index next >