< prev index next >

src/hotspot/share/gc/shared/oopStorage.hpp

v2

8211718: Supporting multiple concurrent OopStorage iterators

202     void push_back(const Block& block);                                                                                              
203     void unlink(const Block& block);                                                                                                 
204   };                                                                                                                                 
205 
206 private:                                                                                                                             
207   const char* _name;                                                                                                                 
208   ActiveArray* _active_array;                                                                                                        
209   AllocationList _allocation_list;                                                                                                   
210   Block* volatile _deferred_updates;                                                                                                 
211 
212   Mutex* _allocation_mutex;                                                                                                          
213   Mutex* _active_mutex;                                                                                                              
214 
215   // Volatile for racy unlocked accesses.                                                                                            
216   volatile size_t _allocation_count;                                                                                                 
217 
218   // Protection for _active_array.                                                                                                   
219   mutable SingleWriterSynchronizer _protect_active;                                                                                  
220 
221   // mutable because this gets set even for const iteration.                                                                         
222   mutable bool _concurrent_iteration_active;                                                                                         
223 
224   Block* find_block_or_null(const oop* ptr) const;                                                                                   
225   void delete_empty_block(const Block& block);                                                                                       
226   bool reduce_deferred_updates();                                                                                                    
227 
228   // Managing _active_array.                                                                                                         
229   bool expand_active_array();                                                                                                        
230   void replace_active_array(ActiveArray* new_array);                                                                                 
231   ActiveArray* obtain_active_array() const;                                                                                          
232   void relinquish_block_array(ActiveArray* array) const;                                                                             
233   class WithActiveArray;        // RAII helper for active array access.                                                              
234 
235   template<typename F, typename Storage>                                                                                             
236   static bool iterate_impl(F f, Storage* storage);                                                                                   
237 
238   // Implementation support for parallel iteration                                                                                   
239   class BasicParState;                                                                                                               
240 
241   // Wrapper for OopClosure-style function, so it can be used with                                                                   

202     void push_back(const Block& block);
203     void unlink(const Block& block);
204   };
205 
206 private:
207   const char* _name;
208   ActiveArray* _active_array;
209   AllocationList _allocation_list;
210   Block* volatile _deferred_updates;
211 
212   Mutex* _allocation_mutex;
213   Mutex* _active_mutex;
214 
215   // Volatile for racy unlocked accesses.
216   volatile size_t _allocation_count;
217 
218   // Protection for _active_array.
219   mutable SingleWriterSynchronizer _protect_active;
220 
221   // mutable because this gets set even for const iteration.
222   mutable int _concurrent_iteration_count;
223 
224   Block* find_block_or_null(const oop* ptr) const;
225   void delete_empty_block(const Block& block);
226   bool reduce_deferred_updates();
227 
228   // Managing _active_array.
229   bool expand_active_array();
230   void replace_active_array(ActiveArray* new_array);
231   ActiveArray* obtain_active_array() const;
232   void relinquish_block_array(ActiveArray* array) const;
233   class WithActiveArray;        // RAII helper for active array access.
234 
235   template<typename F, typename Storage>
236   static bool iterate_impl(F f, Storage* storage);
237 
238   // Implementation support for parallel iteration
239   class BasicParState;
240 
241   // Wrapper for OopClosure-style function, so it can be used with
< prev index next >