15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP 26 #define SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP 27 28 #include "gc/g1/g1HeapRegionTraceType.hpp" 29 #include "memory/allocation.hpp" 30 31 #define hrt_assert_is_valid(tag) \ 32 assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag)) 33 34 class HeapRegionType VALUE_OBJ_CLASS_SPEC { 35 private: 36 // We encode the value of the heap region type so the generation can be 37 // determined quickly. The tag is split into two parts: 38 // 39 // major type (young, old, humongous, archive) : top N-1 bits 40 // minor type (eden / survivor, starts / cont hum, etc.) : bottom 1 bit 41 // 42 // If there's need to increase the number of minor types in the 43 // future, we'll have to increase the size of the latter and hence 44 // decrease the size of the former. 45 // 46 // 00000 0 [ 0] Free 47 // 48 // 00001 0 [ 2] Young Mask 49 // 00001 0 [ 2] Eden 50 // 00001 1 [ 3] Survivor 51 // 52 // 00010 0 [ 4] Humongous Mask 53 // 00100 0 [ 8] Pinned Mask 54 // 00110 0 [12] Starts Humongous | 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP 26 #define SHARE_VM_GC_G1_HEAPREGIONTYPE_HPP 27 28 #include "gc/g1/g1HeapRegionTraceType.hpp" 29 #include "memory/allocation.hpp" 30 31 #define hrt_assert_is_valid(tag) \ 32 assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag)) 33 34 class HeapRegionType VALUE_OBJ_CLASS_SPEC { 35 friend class VMStructs; 36 37 private: 38 // We encode the value of the heap region type so the generation can be 39 // determined quickly. The tag is split into two parts: 40 // 41 // major type (young, old, humongous, archive) : top N-1 bits 42 // minor type (eden / survivor, starts / cont hum, etc.) : bottom 1 bit 43 // 44 // If there's need to increase the number of minor types in the 45 // future, we'll have to increase the size of the latter and hence 46 // decrease the size of the former. 47 // 48 // 00000 0 [ 0] Free 49 // 50 // 00001 0 [ 2] Young Mask 51 // 00001 0 [ 2] Eden 52 // 00001 1 [ 3] Survivor 53 // 54 // 00010 0 [ 4] Humongous Mask 55 // 00100 0 [ 8] Pinned Mask 56 // 00110 0 [12] Starts Humongous |