< prev index next >

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

Print this page
rev 10742 : Make fields used in lock-free algorithms volatile


 212   HeapRegion* _hr;
 213 
 214   enum SomeAdditionalPrivateConstants {
 215     InitialCapacity = 16
 216   };
 217 
 218   void expand();
 219 
 220   bool _expanded;
 221 
 222   bool expanded() { return _expanded; }
 223   void set_expanded(bool b) { _expanded = b; }
 224 
 225   SparsePRT* _next_expanded;
 226 
 227   SparsePRT* next_expanded() { return _next_expanded; }
 228   void set_next_expanded(SparsePRT* nxt) { _next_expanded = nxt; }
 229 
 230   bool should_be_on_expanded_list();
 231 
 232   static SparsePRT* _head_expanded_list;
 233 
 234 public:
 235   SparsePRT(HeapRegion* hr);
 236 
 237   ~SparsePRT();
 238 
 239   size_t occupied() const { return _next->occupied_cards(); }
 240   size_t mem_size() const;
 241 
 242   // Attempts to ensure that the given card_index in the given region is in
 243   // the sparse table.  If successful (because the card was already
 244   // present, or because it was successfully added) returns "true".
 245   // Otherwise, returns "false" to indicate that the addition would
 246   // overflow the entry for the region.  The caller must transfer these
 247   // entries to a larger-capacity representation.
 248   bool add_card(RegionIdx_t region_id, CardIdx_t card_index);
 249 
 250   // If the table hold an entry for "region_ind",  Copies its
 251   // cards into "cards", which must be an array of length at least
 252   // "SparePRTEntry::cards_num()", and returns "true"; otherwise,




 212   HeapRegion* _hr;
 213 
 214   enum SomeAdditionalPrivateConstants {
 215     InitialCapacity = 16
 216   };
 217 
 218   void expand();
 219 
 220   bool _expanded;
 221 
 222   bool expanded() { return _expanded; }
 223   void set_expanded(bool b) { _expanded = b; }
 224 
 225   SparsePRT* _next_expanded;
 226 
 227   SparsePRT* next_expanded() { return _next_expanded; }
 228   void set_next_expanded(SparsePRT* nxt) { _next_expanded = nxt; }
 229 
 230   bool should_be_on_expanded_list();
 231 
 232   static SparsePRT* volatile _head_expanded_list;
 233 
 234 public:
 235   SparsePRT(HeapRegion* hr);
 236 
 237   ~SparsePRT();
 238 
 239   size_t occupied() const { return _next->occupied_cards(); }
 240   size_t mem_size() const;
 241 
 242   // Attempts to ensure that the given card_index in the given region is in
 243   // the sparse table.  If successful (because the card was already
 244   // present, or because it was successfully added) returns "true".
 245   // Otherwise, returns "false" to indicate that the addition would
 246   // overflow the entry for the region.  The caller must transfer these
 247   // entries to a larger-capacity representation.
 248   bool add_card(RegionIdx_t region_id, CardIdx_t card_index);
 249 
 250   // If the table hold an entry for "region_ind",  Copies its
 251   // cards into "cards", which must be an array of length at least
 252   // "SparePRTEntry::cards_num()", and returns "true"; otherwise,


< prev index next >