Path: blob/master/src/hotspot/share/gc/z/vmStructs_z.hpp
40957 views
/*1* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223#ifndef SHARE_GC_Z_VMSTRUCTS_Z_HPP24#define SHARE_GC_Z_VMSTRUCTS_Z_HPP2526#include "gc/z/zAttachedArray.hpp"27#include "gc/z/zCollectedHeap.hpp"28#include "gc/z/zForwarding.hpp"29#include "gc/z/zGranuleMap.hpp"30#include "gc/z/zHeap.hpp"31#include "gc/z/zPageAllocator.hpp"32#include "utilities/macros.hpp"3334// Expose some ZGC globals to the SA agent.35class ZGlobalsForVMStructs {36static ZGlobalsForVMStructs _instance;3738public:39static ZGlobalsForVMStructs* _instance_p;4041ZGlobalsForVMStructs();4243uint32_t* _ZGlobalPhase;4445uint32_t* _ZGlobalSeqNum;4647uintptr_t* _ZAddressOffsetMask;48uintptr_t* _ZAddressMetadataMask;49uintptr_t* _ZAddressMetadataFinalizable;50uintptr_t* _ZAddressGoodMask;51uintptr_t* _ZAddressBadMask;52uintptr_t* _ZAddressWeakBadMask;5354const int* _ZObjectAlignmentSmallShift;55const int* _ZObjectAlignmentSmall;56};5758typedef ZGranuleMap<ZPage*> ZGranuleMapForPageTable;59typedef ZGranuleMap<ZForwarding*> ZGranuleMapForForwarding;60typedef ZAttachedArray<ZForwarding, ZForwardingEntry> ZAttachedArrayForForwarding;6162#define VM_STRUCTS_ZGC(nonstatic_field, volatile_nonstatic_field, static_field) \63static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \64nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \65nonstatic_field(ZGlobalsForVMStructs, _ZGlobalSeqNum, uint32_t*) \66nonstatic_field(ZGlobalsForVMStructs, _ZAddressOffsetMask, uintptr_t*) \67nonstatic_field(ZGlobalsForVMStructs, _ZAddressMetadataMask, uintptr_t*) \68nonstatic_field(ZGlobalsForVMStructs, _ZAddressMetadataFinalizable, uintptr_t*) \69nonstatic_field(ZGlobalsForVMStructs, _ZAddressGoodMask, uintptr_t*) \70nonstatic_field(ZGlobalsForVMStructs, _ZAddressBadMask, uintptr_t*) \71nonstatic_field(ZGlobalsForVMStructs, _ZAddressWeakBadMask, uintptr_t*) \72nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmallShift, const int*) \73nonstatic_field(ZGlobalsForVMStructs, _ZObjectAlignmentSmall, const int*) \74\75nonstatic_field(ZCollectedHeap, _heap, ZHeap) \76\77nonstatic_field(ZHeap, _page_allocator, ZPageAllocator) \78nonstatic_field(ZHeap, _page_table, ZPageTable) \79nonstatic_field(ZHeap, _forwarding_table, ZForwardingTable) \80nonstatic_field(ZHeap, _relocate, ZRelocate) \81\82nonstatic_field(ZPage, _type, const uint8_t) \83nonstatic_field(ZPage, _seqnum, uint32_t) \84nonstatic_field(ZPage, _virtual, const ZVirtualMemory) \85volatile_nonstatic_field(ZPage, _top, uintptr_t) \86\87nonstatic_field(ZPageAllocator, _max_capacity, const size_t) \88volatile_nonstatic_field(ZPageAllocator, _capacity, size_t) \89volatile_nonstatic_field(ZPageAllocator, _used, size_t) \90\91nonstatic_field(ZPageTable, _map, ZGranuleMapForPageTable) \92\93nonstatic_field(ZGranuleMapForPageTable, _map, ZPage** const) \94nonstatic_field(ZGranuleMapForForwarding, _map, ZForwarding** const) \95\96nonstatic_field(ZForwardingTable, _map, ZGranuleMapForForwarding) \97\98nonstatic_field(ZVirtualMemory, _start, const uintptr_t) \99nonstatic_field(ZVirtualMemory, _end, const uintptr_t) \100\101nonstatic_field(ZForwarding, _virtual, const ZVirtualMemory) \102nonstatic_field(ZForwarding, _object_alignment_shift, const size_t) \103volatile_nonstatic_field(ZForwarding, _ref_count, int) \104nonstatic_field(ZForwarding, _entries, const ZAttachedArrayForForwarding) \105nonstatic_field(ZForwardingEntry, _entry, uint64_t) \106nonstatic_field(ZAttachedArrayForForwarding, _length, const size_t)107108#define VM_INT_CONSTANTS_ZGC(declare_constant, declare_constant_with_value) \109declare_constant(ZPhaseRelocate) \110declare_constant(ZPageTypeSmall) \111declare_constant(ZPageTypeMedium) \112declare_constant(ZPageTypeLarge) \113declare_constant(ZObjectAlignmentMediumShift) \114declare_constant(ZObjectAlignmentLargeShift)115116#define VM_LONG_CONSTANTS_ZGC(declare_constant) \117declare_constant(ZGranuleSizeShift) \118declare_constant(ZPageSizeSmallShift) \119declare_constant(ZPageSizeMediumShift) \120declare_constant(ZAddressOffsetShift) \121declare_constant(ZAddressOffsetBits) \122declare_constant(ZAddressOffsetMask) \123declare_constant(ZAddressOffsetMax)124125#define VM_TYPES_ZGC(declare_type, declare_toplevel_type, declare_integer_type) \126declare_toplevel_type(ZGlobalsForVMStructs) \127declare_type(ZCollectedHeap, CollectedHeap) \128declare_toplevel_type(ZHeap) \129declare_toplevel_type(ZRelocate) \130declare_toplevel_type(ZPage) \131declare_toplevel_type(ZPageAllocator) \132declare_toplevel_type(ZPageTable) \133declare_toplevel_type(ZAttachedArrayForForwarding) \134declare_toplevel_type(ZGranuleMapForPageTable) \135declare_toplevel_type(ZGranuleMapForForwarding) \136declare_toplevel_type(ZVirtualMemory) \137declare_toplevel_type(ZForwardingTable) \138declare_toplevel_type(ZForwarding) \139declare_toplevel_type(ZForwardingEntry) \140declare_toplevel_type(ZPhysicalMemoryManager)141142#endif // SHARE_GC_Z_VMSTRUCTS_Z_HPP143144145