< prev index next >

src/share/vm/gc_implementation/g1/heapRegionType.hpp

Print this page
rev 9374 : 8259659: Missing memory fences between memory allocation and refinement
Summary: Refactored to have needed barrier
Reviewed-by: tschatzl, ehelin


  94     assert(_tag == before,
  95            err_msg("HR tag: %u, expected: %u new tag; %u", _tag, before, tag));
  96     _tag = tag;
  97   }
  98 
  99 public:
 100   // Queries
 101 
 102   bool is_free() const { return get() == FreeTag; }
 103 
 104   bool is_young()    const { return (get() & YoungMask) != 0; }
 105   bool is_eden()     const { return get() == EdenTag;  }
 106   bool is_survivor() const { return get() == SurvTag;  }
 107 
 108   bool is_humongous()           const { return (get() & HumMask) != 0; }
 109   bool is_starts_humongous()    const { return get() == HumStartsTag;  }
 110   bool is_continues_humongous() const { return get() == HumContTag;    }
 111 
 112   bool is_old() const { return get() == OldTag; }
 113 


 114   // Setters
 115 
 116   void set_free() { set(FreeTag); }
 117 
 118   void set_eden()        { set_from(EdenTag, FreeTag); }
 119   void set_eden_pre_gc() { set_from(EdenTag, SurvTag); }
 120   void set_survivor()    { set_from(SurvTag, FreeTag); }
 121 
 122   void set_starts_humongous()    { set_from(HumStartsTag, FreeTag); }
 123   void set_continues_humongous() { set_from(HumContTag,   FreeTag); }
 124 
 125   void set_old() { set(OldTag); }
 126 
 127   // Misc
 128 
 129   const char* get_str() const;
 130   const char* get_short_str() const;
 131   G1HeapRegionTraceType::Type get_trace_type();
 132 
 133   HeapRegionType() : _tag(FreeTag) { hrt_assert_is_valid(_tag); }


  94     assert(_tag == before,
  95            err_msg("HR tag: %u, expected: %u new tag; %u", _tag, before, tag));
  96     _tag = tag;
  97   }
  98 
  99 public:
 100   // Queries
 101 
 102   bool is_free() const { return get() == FreeTag; }
 103 
 104   bool is_young()    const { return (get() & YoungMask) != 0; }
 105   bool is_eden()     const { return get() == EdenTag;  }
 106   bool is_survivor() const { return get() == SurvTag;  }
 107 
 108   bool is_humongous()           const { return (get() & HumMask) != 0; }
 109   bool is_starts_humongous()    const { return get() == HumStartsTag;  }
 110   bool is_continues_humongous() const { return get() == HumContTag;    }
 111 
 112   bool is_old() const { return get() == OldTag; }
 113 
 114   bool is_old_or_humongous() const { return (get() & (OldTag | HumMask)) != 0; }
 115 
 116   // Setters
 117 
 118   void set_free() { set(FreeTag); }
 119 
 120   void set_eden()        { set_from(EdenTag, FreeTag); }
 121   void set_eden_pre_gc() { set_from(EdenTag, SurvTag); }
 122   void set_survivor()    { set_from(SurvTag, FreeTag); }
 123 
 124   void set_starts_humongous()    { set_from(HumStartsTag, FreeTag); }
 125   void set_continues_humongous() { set_from(HumContTag,   FreeTag); }
 126 
 127   void set_old() { set(OldTag); }
 128 
 129   // Misc
 130 
 131   const char* get_str() const;
 132   const char* get_short_str() const;
 133   G1HeapRegionTraceType::Type get_trace_type();
 134 
 135   HeapRegionType() : _tag(FreeTag) { hrt_assert_is_valid(_tag); }
< prev index next >