35 class ZGlobalsForVMStructs {
36 static ZGlobalsForVMStructs _instance;
37
38 public:
39 static ZGlobalsForVMStructs* _instance_p;
40
41 ZGlobalsForVMStructs();
42
43 uint32_t* _ZGlobalPhase;
44
45 uint32_t* _ZGlobalSeqNum;
46
47 uintptr_t* _ZAddressGoodMask;
48 uintptr_t* _ZAddressBadMask;
49 uintptr_t* _ZAddressWeakBadMask;
50
51 const int* _ZObjectAlignmentSmallShift;
52 const int* _ZObjectAlignmentSmall;
53 };
54
55 typedef ZAddressRangeMap<ZPageTableEntry, ZPageSizeMinShift> ZAddressRangeMapForPageTable;
56
57 #define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field) \
58 static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \
59 nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \
60 nonstatic_field(ZGlobalsForVMStructs, _ZGlobalSeqNum, 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, _seqnum, uint32_t) \
74 nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \
75 volatile_nonstatic_field(ZPage, _top, uintptr_t) \
84 nonstatic_field(ZAddressRangeMapForPageTable, _map, ZPageTableEntry* const) \
85 \
86 nonstatic_field(ZVirtualMemory, _start, uintptr_t) \
87 nonstatic_field(ZVirtualMemory, _end, uintptr_t) \
88 \
89 nonstatic_field(ZForwardingTable, _table, ZForwardingTableEntry*) \
90 nonstatic_field(ZForwardingTable, _size, size_t) \
91 \
92 nonstatic_field(ZPhysicalMemoryManager, _max_capacity, const size_t) \
93 nonstatic_field(ZPhysicalMemoryManager, _capacity, size_t)
94
95 #define VM_INT_CONSTANTS_ZGC(declare_constant, declare_constant_with_value) \
96 declare_constant(ZPhaseRelocate) \
97 declare_constant(ZPageTypeSmall) \
98 declare_constant(ZPageTypeMedium) \
99 declare_constant(ZPageTypeLarge) \
100 declare_constant(ZObjectAlignmentMediumShift) \
101 declare_constant(ZObjectAlignmentLargeShift)
102
103 #define VM_LONG_CONSTANTS_ZGC(declare_constant) \
104 declare_constant(ZPageSizeSmallShift) \
105 declare_constant(ZPageSizeMediumShift) \
106 declare_constant(ZPageSizeMinShift) \
107 declare_constant(ZAddressOffsetShift) \
108 declare_constant(ZAddressOffsetBits) \
109 declare_constant(ZAddressOffsetMask) \
110 declare_constant(ZAddressOffsetMax) \
111 declare_constant(ZAddressSpaceStart)
112
113 #define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type) \
114 declare_toplevel_type(ZGlobalsForVMStructs) \
115 declare_type(ZCollectedHeap, CollectedHeap) \
116 declare_toplevel_type(ZHeap) \
117 declare_toplevel_type(ZPage) \
118 declare_toplevel_type(ZPageAllocator) \
119 declare_toplevel_type(ZPageTable) \
120 declare_toplevel_type(ZPageTableEntry) \
121 declare_toplevel_type(ZAddressRangeMapForPageTable) \
122 declare_toplevel_type(ZVirtualMemory) \
123 declare_toplevel_type(ZForwardingTable) \
124 declare_toplevel_type(ZForwardingTableEntry) \
125 declare_toplevel_type(ZPhysicalMemoryManager)
126
|
35 class ZGlobalsForVMStructs {
36 static ZGlobalsForVMStructs _instance;
37
38 public:
39 static ZGlobalsForVMStructs* _instance_p;
40
41 ZGlobalsForVMStructs();
42
43 uint32_t* _ZGlobalPhase;
44
45 uint32_t* _ZGlobalSeqNum;
46
47 uintptr_t* _ZAddressGoodMask;
48 uintptr_t* _ZAddressBadMask;
49 uintptr_t* _ZAddressWeakBadMask;
50
51 const int* _ZObjectAlignmentSmallShift;
52 const int* _ZObjectAlignmentSmall;
53 };
54
55 typedef ZAddressRangeMap<ZPageTableEntry, ZGranuleSizeShift> ZAddressRangeMapForPageTable;
56
57 #define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field) \
58 static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \
59 nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \
60 nonstatic_field(ZGlobalsForVMStructs, _ZGlobalSeqNum, 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, _seqnum, uint32_t) \
74 nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \
75 volatile_nonstatic_field(ZPage, _top, uintptr_t) \
84 nonstatic_field(ZAddressRangeMapForPageTable, _map, ZPageTableEntry* const) \
85 \
86 nonstatic_field(ZVirtualMemory, _start, uintptr_t) \
87 nonstatic_field(ZVirtualMemory, _end, uintptr_t) \
88 \
89 nonstatic_field(ZForwardingTable, _table, ZForwardingTableEntry*) \
90 nonstatic_field(ZForwardingTable, _size, size_t) \
91 \
92 nonstatic_field(ZPhysicalMemoryManager, _max_capacity, const size_t) \
93 nonstatic_field(ZPhysicalMemoryManager, _capacity, size_t)
94
95 #define VM_INT_CONSTANTS_ZGC(declare_constant, declare_constant_with_value) \
96 declare_constant(ZPhaseRelocate) \
97 declare_constant(ZPageTypeSmall) \
98 declare_constant(ZPageTypeMedium) \
99 declare_constant(ZPageTypeLarge) \
100 declare_constant(ZObjectAlignmentMediumShift) \
101 declare_constant(ZObjectAlignmentLargeShift)
102
103 #define VM_LONG_CONSTANTS_ZGC(declare_constant) \
104 declare_constant(ZGranuleSizeShift) \
105 declare_constant(ZPageSizeSmallShift) \
106 declare_constant(ZPageSizeMediumShift) \
107 declare_constant(ZAddressOffsetShift) \
108 declare_constant(ZAddressOffsetBits) \
109 declare_constant(ZAddressOffsetMask) \
110 declare_constant(ZAddressOffsetMax) \
111 declare_constant(ZAddressSpaceStart)
112
113 #define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type) \
114 declare_toplevel_type(ZGlobalsForVMStructs) \
115 declare_type(ZCollectedHeap, CollectedHeap) \
116 declare_toplevel_type(ZHeap) \
117 declare_toplevel_type(ZPage) \
118 declare_toplevel_type(ZPageAllocator) \
119 declare_toplevel_type(ZPageTable) \
120 declare_toplevel_type(ZPageTableEntry) \
121 declare_toplevel_type(ZAddressRangeMapForPageTable) \
122 declare_toplevel_type(ZVirtualMemory) \
123 declare_toplevel_type(ZForwardingTable) \
124 declare_toplevel_type(ZForwardingTableEntry) \
125 declare_toplevel_type(ZPhysicalMemoryManager)
126
|