hotspot/src/share/vm/gc/g1/heapRegionType.hpp
changeset 31346 a70d45c06136
parent 30764 fec48bf5a827
child 32623 390a27af5657
equal deleted inserted replaced
31345:1bba15125d8d 31346:a70d45c06136
    42   // future, we'll have to increase the size of the latter and hence
    42   // future, we'll have to increase the size of the latter and hence
    43   // decrease the size of the former.
    43   // decrease the size of the former.
    44   //
    44   //
    45   // 0000 0 [ 0] Free
    45   // 0000 0 [ 0] Free
    46   //
    46   //
    47   // 0001 0      Young Mask
    47   // 0001 0 [ 2] Young Mask
    48   // 0001 0 [ 2] Eden
    48   // 0001 0 [ 2] Eden
    49   // 0001 1 [ 3] Survivor
    49   // 0001 1 [ 3] Survivor
    50   //
    50   //
    51   // 0010 0      Humongous Mask
    51   // 0010 0 [ 4] Humongous Mask
    52   // 0010 0 [ 4] Starts Humongous
    52   // 0100 0 [ 8] Pinned Mask
    53   // 0010 1 [ 5] Continues Humongous
    53   // 0110 0 [12] Starts Humongous
       
    54   // 0110 1 [13] Continues Humongous
    54   //
    55   //
    55   // 01000 [ 8] Old
    56   // 1000 0 [16] Old Mask
       
    57   //
       
    58   // 1100 0 [24] Archive
    56   typedef enum {
    59   typedef enum {
    57     FreeTag               = 0,
    60     FreeTag               = 0,
    58 
    61 
    59     YoungMask             = 2,
    62     YoungMask             = 2,
    60     EdenTag               = YoungMask,
    63     EdenTag               = YoungMask,
    61     SurvTag               = YoungMask + 1,
    64     SurvTag               = YoungMask + 1,
    62 
    65 
    63     HumongousMask         = 4,
    66     HumongousMask         = 4,
    64     StartsHumongousTag    = HumongousMask,
    67     PinnedMask            = 8,
    65     ContinuesHumongousTag = HumongousMask + 1,
    68     StartsHumongousTag    = HumongousMask | PinnedMask,
       
    69     ContinuesHumongousTag = HumongousMask | PinnedMask + 1,
    66 
    70 
    67     OldTag                = 8
    71     OldMask               = 16,
       
    72     OldTag                = OldMask,
       
    73 
       
    74     ArchiveTag            = PinnedMask | OldMask
    68   } Tag;
    75   } Tag;
    69 
    76 
    70   volatile Tag _tag;
    77   volatile Tag _tag;
    71 
    78 
    72   static bool is_valid(Tag tag);
    79   static bool is_valid(Tag tag);
   106 
   113 
   107   bool is_humongous()           const { return (get() & HumongousMask) != 0;   }
   114   bool is_humongous()           const { return (get() & HumongousMask) != 0;   }
   108   bool is_starts_humongous()    const { return get() == StartsHumongousTag;    }
   115   bool is_starts_humongous()    const { return get() == StartsHumongousTag;    }
   109   bool is_continues_humongous() const { return get() == ContinuesHumongousTag; }
   116   bool is_continues_humongous() const { return get() == ContinuesHumongousTag; }
   110 
   117 
   111   bool is_old() const { return get() == OldTag; }
   118   bool is_archive() const { return get() == ArchiveTag; }
       
   119 
       
   120   // is_old regions may or may not also be pinned
       
   121   bool is_old() const { return (get() & OldMask) != 0; }
       
   122 
       
   123   // is_pinned regions may be archive or humongous
       
   124   bool is_pinned() const { return (get() & PinnedMask) != 0; }
   112 
   125 
   113   // Setters
   126   // Setters
   114 
   127 
   115   void set_free() { set(FreeTag); }
   128   void set_free() { set(FreeTag); }
   116 
   129 
   121   void set_starts_humongous()    { set_from(StartsHumongousTag,    FreeTag); }
   134   void set_starts_humongous()    { set_from(StartsHumongousTag,    FreeTag); }
   122   void set_continues_humongous() { set_from(ContinuesHumongousTag, FreeTag); }
   135   void set_continues_humongous() { set_from(ContinuesHumongousTag, FreeTag); }
   123 
   136 
   124   void set_old() { set(OldTag); }
   137   void set_old() { set(OldTag); }
   125 
   138 
       
   139   void set_archive() { set_from(ArchiveTag, FreeTag); }
       
   140 
   126   // Misc
   141   // Misc
   127 
   142 
   128   const char* get_str() const;
   143   const char* get_str() const;
   129   const char* get_short_str() const;
   144   const char* get_short_str() const;
   130 
   145