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_Z_VMSTRUCTS_Z_HPP
26 #define SHARE_VM_GC_Z_VMSTRUCTS_Z_HPP
27
28 #include "gc/z/zCollectedHeap.hpp"
29 #include "gc/z/zHeap.hpp"
30 #include "gc/z/zPageAllocator.hpp"
31 #include "gc/z/zPhysicalMemory.hpp"
32 #include "gc/z/zAddressRangeMap.hpp"
33 #include "utilities/macros.hpp"
34
35 // Expose some ZGC globals to the SA agent.
36 class ZGlobalsForVMStructs {
37 static ZGlobalsForVMStructs _instance;
38
39 public:
40 static ZGlobalsForVMStructs* _instance_p;
41
42 ZGlobalsForVMStructs();
43
44 uint32_t* _ZGlobalPhase;
45
46 uintptr_t* _ZAddressGoodMask;
47 uintptr_t* _ZAddressBadMask;
48 uintptr_t* _ZAddressWeakBadMask;
49
50 const int* _ZObjectAlignmentSmallShift;
51 const int* _ZObjectAlignmentSmall;
52 };
53
54
55 typedef ZAddressRangeMap<ZPageTableEntry, ZPageSizeMinShift> ZAddressRangeMapForPageTable;
56
57 #define VM_STRUCTS_Z(nonstatic_field, static_field) \
58 \
59 static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \
60 nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \
61 nonstatic_field(ZGlobalsForVMStructs, _ZAddressGoodMask, uintptr_t*) \
62 nonstatic_field(ZGlobalsForVMStructs, _ZAddressBadMask, uintptr_t*) \
63 nonstatic_field(ZGlobalsForVMStructs, _ZAddressWeakBadMask, uintptr_t*) \
64 nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmallShift, const int*) \
65 nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmall, const int*) \
66 \
67 nonstatic_field(ZCollectedHeap, _heap, ZHeap) \
68 \
69 nonstatic_field(ZHeap, _page_allocator, ZPageAllocator) \
70 nonstatic_field(ZHeap, _pagetable, ZPageTable) \
71 \
72 nonstatic_field(ZPage, _type, const uint8_t) \
73 nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \
74 nonstatic_field(ZPage, _forwarding, ZForwardingTable) \
75 \
76 nonstatic_field(ZPageAllocator, _physical, ZPhysicalMemoryManager) \
77 nonstatic_field(ZPageAllocator, _used, size_t) \
78 \
79 nonstatic_field(ZPageTable, _map, ZAddressRangeMapForPageTable) \
80 \
81 nonstatic_field(ZAddressRangeMapForPageTable, _map, ZPageTableEntry* const) \
82 \
83 nonstatic_field(ZVirtualMemory, _start, uintptr_t) \
84 nonstatic_field(ZVirtualMemory, _end, uintptr_t) \
85 \
86 nonstatic_field(ZForwardingTable, _table, ZForwardingTableEntry*) \
87 nonstatic_field(ZForwardingTable, _size, size_t) \
88 \
89 nonstatic_field(ZPhysicalMemoryManager, _max_capacity, const size_t) \
90 nonstatic_field(ZPhysicalMemoryManager, _capacity, size_t)
91
92 #define VM_TYPES_Z(declare_type, \
93 declare_toplevel_type) \
94 \
95 declare_toplevel_type(ZGlobalsForVMStructs) \
96 \
97 declare_type(ZCollectedHeap, CollectedHeap) \
98 \
99 declare_toplevel_type(ZHeap) \
100 declare_toplevel_type(ZPage) \
101 declare_toplevel_type(ZPageAllocator) \
102 declare_toplevel_type(ZPageTable) \
103 declare_toplevel_type(ZPageTableEntry) \
104 declare_toplevel_type(ZAddressRangeMapForPageTable) \
105 declare_toplevel_type(ZVirtualMemory) \
106 declare_toplevel_type(ZForwardingTable) \
107 declare_toplevel_type(ZForwardingTableEntry) \
108 declare_toplevel_type(ZPhysicalMemoryManager)
109
110 #endif // SHARE_VM_GC_Z_VMSTRUCTS_Z_HPP
|
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_Z_VMSTRUCTS_Z_HPP
26 #define SHARE_VM_GC_Z_VMSTRUCTS_Z_HPP
27
28 #include "gc/z/zCollectedHeap.hpp"
29 #include "gc/z/zHeap.hpp"
30 #include "gc/z/zPageAllocator.hpp"
31 #include "gc/z/zPhysicalMemory.hpp"
32 #include "gc/z/zAddressRangeMap.hpp"
33 #include "utilities/macros.hpp"
34
35 typedef ZAddressRangeMap<ZPageTableEntry, ZPageSizeMinShift> ZAddressRangeMapForPageTable;
36
37 #define VM_STRUCTS_Z(nonstatic_field, static_field) \
38 nonstatic_field(ZCollectedHeap, _heap, ZHeap) \
39 \
40 nonstatic_field(ZHeap, _page_allocator, ZPageAllocator) \
41 nonstatic_field(ZHeap, _pagetable, ZPageTable) \
42 \
43 nonstatic_field(ZPage, _type, const uint8_t) \
44 nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \
45 nonstatic_field(ZPage, _forwarding, ZForwardingTable) \
46 \
47 nonstatic_field(ZPageAllocator, _physical, ZPhysicalMemoryManager) \
48 nonstatic_field(ZPageAllocator, _used, size_t) \
49 \
50 nonstatic_field(ZPageTable, _map, ZAddressRangeMapForPageTable) \
51 \
52 nonstatic_field(ZAddressRangeMapForPageTable, _map, ZPageTableEntry* const) \
53 \
54 nonstatic_field(ZVirtualMemory, _start, uintptr_t) \
55 nonstatic_field(ZVirtualMemory, _end, uintptr_t) \
56 \
57 nonstatic_field(ZForwardingTable, _table, ZForwardingTableEntry*) \
58 nonstatic_field(ZForwardingTable, _size, size_t) \
59 \
60 nonstatic_field(ZPhysicalMemoryManager, _max_capacity, const size_t) \
61 nonstatic_field(ZPhysicalMemoryManager, _capacity, size_t)
62
63 #define VM_INT_CONSTANTS_Z(declare_constant, declare_constant_with_value) \
64 declare_constant(ZGlobalPhase) \
65 declare_constant(ZPhaseRelocate) \
66 declare_constant(ZPageTypeSmall) \
67 declare_constant(ZPageTypeMedium) \
68 declare_constant(ZPageTypeLarge) \
69 declare_constant(ZPageSizeMinShift) \
70 declare_constant(ZObjectAlignmentSmallShift) \
71 declare_constant(ZObjectAlignmentMediumShift) \
72 declare_constant(ZObjectAlignmentLargeShift)
73
74 #define VM_LONG_CONSTANTS_Z(declare_constant, declare_constant_with_value) \
75 declare_constant(ZAddressGoodMask) \
76 declare_constant(ZAddressWeakBadMask) \
77 declare_constant(ZAddressOffsetMask)
78
79 #define VM_TYPES_Z(declare_type, \
80 declare_toplevel_type) \
81 \
82 declare_type(ZCollectedHeap, CollectedHeap) \
83 \
84 declare_toplevel_type(ZHeap) \
85 declare_toplevel_type(ZPage) \
86 declare_toplevel_type(ZPageAllocator) \
87 declare_toplevel_type(ZPageTable) \
88 declare_toplevel_type(ZPageTableEntry) \
89 declare_toplevel_type(ZAddressRangeMapForPageTable) \
90 declare_toplevel_type(ZVirtualMemory) \
91 declare_toplevel_type(ZForwardingTable) \
92 declare_toplevel_type(ZForwardingTableEntry) \
93 declare_toplevel_type(ZPhysicalMemoryManager)
94
95 #endif // SHARE_VM_GC_Z_VMSTRUCTS_Z_HPP
|