1 /*
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 */
52
53 bool is_object_marked(uintptr_t addr) const;
54 bool is_object_strongly_marked(uintptr_t addr) const;
55
56 public:
57 ZPage(const ZVirtualMemory& vmem, const ZPhysicalMemory& pmem);
58 ZPage(uint8_t type, const ZVirtualMemory& vmem, const ZPhysicalMemory& pmem);
59 ~ZPage();
60
61 uint32_t object_max_count() const;
62 size_t object_alignment_shift() const;
63 size_t object_alignment() const;
64
65 uint8_t type() const;
66 uintptr_t start() const;
67 uintptr_t end() const;
68 size_t size() const;
69 uintptr_t top() const;
70 size_t remaining() const;
71
72 const ZPhysicalMemory& physical_memory() const;
73 const ZVirtualMemory& virtual_memory() const;
74
75 uint8_t numa_id();
76
77 bool is_allocating() const;
78 bool is_relocatable() const;
79
80 bool is_mapped() const;
81 void set_pre_mapped();
82
83 uint64_t last_used() const;
84 void set_last_used();
85
86 void reset();
87
88 ZPage* retype(uint8_t type);
89 ZPage* split(size_t size);
90 ZPage* split(uint8_t type, size_t size);
91
92 bool is_in(uintptr_t addr) const;
93
94 bool is_marked() const;
95 bool is_object_live(uintptr_t addr) const;
96 bool is_object_strongly_live(uintptr_t addr) const;
97 bool mark_object(uintptr_t addr, bool finalizable, bool& inc_live);
98
99 void inc_live(uint32_t objects, size_t bytes);
100 uint32_t live_objects() const;
101 size_t live_bytes() const;
102
103 void object_iterate(ObjectClosure* cl);
104
105 uintptr_t alloc_object(size_t size);
106 uintptr_t alloc_object_atomic(size_t size);
107
108 bool undo_alloc_object(uintptr_t addr, size_t size);
109 bool undo_alloc_object_atomic(uintptr_t addr, size_t size);
110
|
1 /*
2 * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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 */
52
53 bool is_object_marked(uintptr_t addr) const;
54 bool is_object_strongly_marked(uintptr_t addr) const;
55
56 public:
57 ZPage(const ZVirtualMemory& vmem, const ZPhysicalMemory& pmem);
58 ZPage(uint8_t type, const ZVirtualMemory& vmem, const ZPhysicalMemory& pmem);
59 ~ZPage();
60
61 uint32_t object_max_count() const;
62 size_t object_alignment_shift() const;
63 size_t object_alignment() const;
64
65 uint8_t type() const;
66 uintptr_t start() const;
67 uintptr_t end() const;
68 size_t size() const;
69 uintptr_t top() const;
70 size_t remaining() const;
71
72 const ZVirtualMemory& virtual_memory() const;
73 const ZPhysicalMemory& physical_memory() const;
74 ZPhysicalMemory& physical_memory();
75
76 uint8_t numa_id();
77
78 bool is_allocating() const;
79 bool is_relocatable() const;
80
81 uint64_t last_used() const;
82 void set_last_used();
83
84 void reset();
85
86 ZPage* retype(uint8_t type);
87 ZPage* split(size_t size);
88 ZPage* split(uint8_t type, size_t size);
89 ZPage* split_committed();
90
91 bool is_in(uintptr_t addr) const;
92
93 bool is_marked() const;
94 bool is_object_live(uintptr_t addr) const;
95 bool is_object_strongly_live(uintptr_t addr) const;
96 bool mark_object(uintptr_t addr, bool finalizable, bool& inc_live);
97
98 void inc_live(uint32_t objects, size_t bytes);
99 uint32_t live_objects() const;
100 size_t live_bytes() const;
101
102 void object_iterate(ObjectClosure* cl);
103
104 uintptr_t alloc_object(size_t size);
105 uintptr_t alloc_object_atomic(size_t size);
106
107 bool undo_alloc_object(uintptr_t addr, size_t size);
108 bool undo_alloc_object_atomic(uintptr_t addr, size_t size);
109
|