--- old/src/hotspot/share/gc/z/vmStructs_z.hpp 2018-01-13 12:14:28.033595469 +0900 +++ new/src/hotspot/share/gc/z/vmStructs_z.hpp 2018-01-13 12:14:27.768594752 +0900 @@ -32,38 +32,9 @@ #include "gc/z/zAddressRangeMap.hpp" #include "utilities/macros.hpp" -// Expose some ZGC globals to the SA agent. -class ZGlobalsForVMStructs { - static ZGlobalsForVMStructs _instance; - -public: - static ZGlobalsForVMStructs* _instance_p; - - ZGlobalsForVMStructs(); - - uint32_t* _ZGlobalPhase; - - uintptr_t* _ZAddressGoodMask; - uintptr_t* _ZAddressBadMask; - uintptr_t* _ZAddressWeakBadMask; - - const int* _ZObjectAlignmentSmallShift; - const int* _ZObjectAlignmentSmall; -}; - - typedef ZAddressRangeMap ZAddressRangeMapForPageTable; #define VM_STRUCTS_Z(nonstatic_field, static_field) \ - \ - static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZAddressGoodMask, uintptr_t*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZAddressBadMask, uintptr_t*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZAddressWeakBadMask, uintptr_t*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmallShift, const int*) \ - nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmall, const int*) \ - \ nonstatic_field(ZCollectedHeap, _heap, ZHeap) \ \ nonstatic_field(ZHeap, _page_allocator, ZPageAllocator) \ @@ -89,11 +60,25 @@ nonstatic_field(ZPhysicalMemoryManager, _max_capacity, const size_t) \ nonstatic_field(ZPhysicalMemoryManager, _capacity, size_t) +#define VM_INT_CONSTANTS_Z(declare_constant, declare_constant_with_value) \ + declare_constant(ZGlobalPhase) \ + declare_constant(ZPhaseRelocate) \ + declare_constant(ZPageTypeSmall) \ + declare_constant(ZPageTypeMedium) \ + declare_constant(ZPageTypeLarge) \ + declare_constant(ZPageSizeMinShift) \ + declare_constant(ZObjectAlignmentSmallShift) \ + declare_constant(ZObjectAlignmentMediumShift) \ + declare_constant(ZObjectAlignmentLargeShift) + +#define VM_LONG_CONSTANTS_Z(declare_constant, declare_constant_with_value) \ + declare_constant(ZAddressGoodMask) \ + declare_constant(ZAddressWeakBadMask) \ + declare_constant(ZAddressOffsetMask) + #define VM_TYPES_Z(declare_type, \ declare_toplevel_type) \ \ - declare_toplevel_type(ZGlobalsForVMStructs) \ - \ declare_type(ZCollectedHeap, CollectedHeap) \ \ declare_toplevel_type(ZHeap) \