< prev index next >

src/hotspot/share/gc/z/vmStructs_z.hpp

Print this page




  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 #ifndef SHARE_GC_Z_VMSTRUCTS_Z_HPP
  25 #define SHARE_GC_Z_VMSTRUCTS_Z_HPP
  26 
  27 #include "gc/z/zAttachedArray.hpp"
  28 #include "gc/z/zCollectedHeap.hpp"
  29 #include "gc/z/zForwarding.hpp"
  30 #include "gc/z/zGranuleMap.hpp"
  31 #include "gc/z/zHeap.hpp"
  32 #include "gc/z/zPageAllocator.hpp"
  33 #include "gc/z/zPhysicalMemory.hpp"
  34 #include "utilities/macros.hpp"
  35 
  36 // Expose some ZGC globals to the SA agent.
  37 class ZGlobalsForVMStructs {
  38   static ZGlobalsForVMStructs _instance;
  39 
  40 public:
  41   static ZGlobalsForVMStructs* _instance_p;
  42 
  43   ZGlobalsForVMStructs();
  44 
  45   uint32_t* _ZGlobalPhase;
  46 
  47   uint32_t* _ZGlobalSeqNum;
  48 
  49   uintptr_t* _ZAddressGoodMask;
  50   uintptr_t* _ZAddressBadMask;
  51   uintptr_t* _ZAddressWeakBadMask;
  52 
  53   const int* _ZObjectAlignmentSmallShift;


  60 #define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field)                      \
  61   static_field(ZGlobalsForVMStructs,            _instance_p,          ZGlobalsForVMStructs*)         \
  62   nonstatic_field(ZGlobalsForVMStructs,         _ZGlobalPhase,        uint32_t*)                     \
  63   nonstatic_field(ZGlobalsForVMStructs,         _ZGlobalSeqNum,       uint32_t*)                     \
  64   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressGoodMask,    uintptr_t*)                    \
  65   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressBadMask,     uintptr_t*)                    \
  66   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressWeakBadMask, uintptr_t*)                    \
  67   nonstatic_field(ZGlobalsForVMStructs,         _ZObjectAlignmentSmallShift, const int*)             \
  68   nonstatic_field(ZGlobalsForVMStructs,         _ZObjectAlignmentSmall, const int*)                  \
  69                                                                                                      \
  70   nonstatic_field(ZCollectedHeap,               _heap,                ZHeap)                         \
  71                                                                                                      \
  72   nonstatic_field(ZHeap,                        _page_allocator,      ZPageAllocator)                \
  73   nonstatic_field(ZHeap,                        _page_table,          ZPageTable)                    \
  74                                                                                                      \
  75   nonstatic_field(ZPage,                        _type,                const uint8_t)                 \
  76   nonstatic_field(ZPage,                        _seqnum,              uint32_t)                      \
  77   nonstatic_field(ZPage,                        _virtual,             const ZVirtualMemory)          \
  78   volatile_nonstatic_field(ZPage,               _top,                 uintptr_t)                     \
  79                                                                                                      \
  80   nonstatic_field(ZPageAllocator,               _physical,            ZPhysicalMemoryManager)        \

  81   nonstatic_field(ZPageAllocator,               _used,                size_t)                        \
  82                                                                                                      \
  83   nonstatic_field(ZPageTable,                   _map,                 ZGranuleMapForPageTable)       \
  84                                                                                                      \
  85   nonstatic_field(ZGranuleMapForPageTable,      _map,                 ZPage** const)                 \
  86                                                                                                      \
  87   nonstatic_field(ZVirtualMemory,               _start,               uintptr_t)                     \
  88   nonstatic_field(ZVirtualMemory,               _end,                 uintptr_t)                     \
  89                                                                                                      \
  90   nonstatic_field(ZForwarding,                  _entries,             const ZAttachedArrayForForwarding) \
  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)                      \


  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 #ifndef SHARE_GC_Z_VMSTRUCTS_Z_HPP
  25 #define SHARE_GC_Z_VMSTRUCTS_Z_HPP
  26 
  27 #include "gc/z/zAttachedArray.hpp"
  28 #include "gc/z/zCollectedHeap.hpp"
  29 #include "gc/z/zForwarding.hpp"
  30 #include "gc/z/zGranuleMap.hpp"
  31 #include "gc/z/zHeap.hpp"
  32 #include "gc/z/zPageAllocator.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   uint32_t* _ZGlobalSeqNum;
  47 
  48   uintptr_t* _ZAddressGoodMask;
  49   uintptr_t* _ZAddressBadMask;
  50   uintptr_t* _ZAddressWeakBadMask;
  51 
  52   const int* _ZObjectAlignmentSmallShift;


  59 #define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field)                      \
  60   static_field(ZGlobalsForVMStructs,            _instance_p,          ZGlobalsForVMStructs*)         \
  61   nonstatic_field(ZGlobalsForVMStructs,         _ZGlobalPhase,        uint32_t*)                     \
  62   nonstatic_field(ZGlobalsForVMStructs,         _ZGlobalSeqNum,       uint32_t*)                     \
  63   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressGoodMask,    uintptr_t*)                    \
  64   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressBadMask,     uintptr_t*)                    \
  65   nonstatic_field(ZGlobalsForVMStructs,         _ZAddressWeakBadMask, uintptr_t*)                    \
  66   nonstatic_field(ZGlobalsForVMStructs,         _ZObjectAlignmentSmallShift, const int*)             \
  67   nonstatic_field(ZGlobalsForVMStructs,         _ZObjectAlignmentSmall, const int*)                  \
  68                                                                                                      \
  69   nonstatic_field(ZCollectedHeap,               _heap,                ZHeap)                         \
  70                                                                                                      \
  71   nonstatic_field(ZHeap,                        _page_allocator,      ZPageAllocator)                \
  72   nonstatic_field(ZHeap,                        _page_table,          ZPageTable)                    \
  73                                                                                                      \
  74   nonstatic_field(ZPage,                        _type,                const uint8_t)                 \
  75   nonstatic_field(ZPage,                        _seqnum,              uint32_t)                      \
  76   nonstatic_field(ZPage,                        _virtual,             const ZVirtualMemory)          \
  77   volatile_nonstatic_field(ZPage,               _top,                 uintptr_t)                     \
  78                                                                                                      \
  79   nonstatic_field(ZPageAllocator,               _max_capacity,        const size_t)                  \
  80   nonstatic_field(ZPageAllocator,               _capacity,            size_t)                        \
  81   nonstatic_field(ZPageAllocator,               _used,                size_t)                        \
  82                                                                                                      \
  83   nonstatic_field(ZPageTable,                   _map,                 ZGranuleMapForPageTable)       \
  84                                                                                                      \
  85   nonstatic_field(ZGranuleMapForPageTable,      _map,                 ZPage** const)                 \
  86                                                                                                      \
  87   nonstatic_field(ZVirtualMemory,               _start,               const uintptr_t)               \
  88   nonstatic_field(ZVirtualMemory,               _end,                 const uintptr_t)               \
  89                                                                                                      \
  90   nonstatic_field(ZForwarding,                  _entries,             const ZAttachedArrayForForwarding)



  91 
  92 #define VM_INT_CONSTANTS_ZGC(declare_constant, declare_constant_with_value)                          \
  93   declare_constant(ZPhaseRelocate)                                                                   \
  94   declare_constant(ZPageTypeSmall)                                                                   \
  95   declare_constant(ZPageTypeMedium)                                                                  \
  96   declare_constant(ZPageTypeLarge)                                                                   \
  97   declare_constant(ZObjectAlignmentMediumShift)                                                      \
  98   declare_constant(ZObjectAlignmentLargeShift)
  99 
 100 #define VM_LONG_CONSTANTS_ZGC(declare_constant)                                                      \
 101   declare_constant(ZGranuleSizeShift)                                                                \
 102   declare_constant(ZPageSizeSmallShift)                                                              \
 103   declare_constant(ZPageSizeMediumShift)                                                             \
 104   declare_constant(ZAddressOffsetShift)                                                              \
 105   declare_constant(ZAddressOffsetBits)                                                               \
 106   declare_constant(ZAddressOffsetMask)                                                               \
 107   declare_constant(ZAddressOffsetMax)                                                                \
 108   declare_constant(ZAddressSpaceStart)
 109 
 110 #define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type)                      \
< prev index next >