9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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
30 #define hrt_assert_is_valid(tag) \
31 assert(is_valid((tag)), "invalid HR type: %u", (uint) (tag))
32
33 class HeapRegionType {
34 friend class VMStructs;
35
36 private:
37 // We encode the value of the heap region type so the generation can be
38 // determined quickly. The tag is split into two parts:
39 //
40 // major type (young, old, humongous, archive) : top N-1 bits
41 // minor type (eden / survivor, starts / cont hum, etc.) : bottom 1 bit
42 //
43 // If there's need to increase the number of minor types in the
44 // future, we'll have to increase the size of the latter and hence
45 // decrease the size of the former.
46 //
47 // 00000 0 [ 0] Free
48 //
49 // 00001 0 [ 2] Young Mask
50 // 00001 0 [ 2] Eden
51 // 00001 1 [ 3] Survivor
52 //
53 // 00010 0 [ 4] Humongous Mask
|