src/hotspot/share/gc/z/zGlobals.hpp
author eosterlund
Tue, 12 Nov 2019 20:01:23 +0000
changeset 59038 b9a42ca342db
parent 58811 38f4701d6587
child 59149 3b998574be4b
permissions -rw-r--r--
8233061: ZGC: Enforce memory ordering in segmented bit maps Reviewed-by: pliden, stefank
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     1
/*
54094
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
     2
 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     4
 *
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     7
 * published by the Free Software Foundation.
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     8
 *
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    13
 * accompanied this code).
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    14
 *
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    18
 *
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    21
 * questions.
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    22
 */
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    23
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    24
#ifndef SHARE_GC_Z_ZGLOBALS_HPP
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    25
#define SHARE_GC_Z_ZGLOBALS_HPP
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    26
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    27
#include "utilities/globalDefinitions.hpp"
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    28
#include "utilities/macros.hpp"
57962
4b436b5d1630 8230307: ZGC: Make zGlobals and zArguments OS agnostic
eosterlund
parents: 54617
diff changeset
    29
#include CPU_HEADER(gc/z/zGlobals)
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    30
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    31
// Collector name
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
    32
const char* const ZName                         = "The Z Garbage Collector";
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    33
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    34
// Global phase state
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    35
extern uint32_t   ZGlobalPhase;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    36
const uint32_t    ZPhaseMark                    = 0;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    37
const uint32_t    ZPhaseMarkCompleted           = 1;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    38
const uint32_t    ZPhaseRelocate                = 2;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    39
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    40
// Global sequence number
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    41
extern uint32_t   ZGlobalSeqNum;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    42
54094
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
    43
// Granule shift/size
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
    44
const size_t      ZGranuleSizeShift             = ZPlatformGranuleSizeShift;
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
    45
const size_t      ZGranuleSize                  = (size_t)1 << ZGranuleSizeShift;
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
    46
58787
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    47
// Number of heap views
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    48
const size_t      ZHeapViews                    = ZPlatformHeapViews;
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    49
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    50
// Virtual memory to physical memory ratio
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    51
const size_t      ZVirtualToPhysicalRatio       = 16; // 16:1
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    52
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    53
//
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    54
// Page Tiers (assuming ZGranuleSize=2M)
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    55
// -------------------------------------
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    56
//
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    57
//                 Page Size        Object Size      Object Alignment
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    58
//                 --------------------------------------------------
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    59
//  Small          2M               <= 265K          MinObjAlignmentInBytes
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    60
//  Medium         32M              <= 4M            4K
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    61
//  Large          N x 2M           > 4M             2M
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    62
//
32d39d9525f9 8231552: ZGC: Refine address space reservation
pliden
parents: 58468
diff changeset
    63
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    64
// Page types
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    65
const uint8_t     ZPageTypeSmall                = 0;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    66
const uint8_t     ZPageTypeMedium               = 1;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    67
const uint8_t     ZPageTypeLarge                = 2;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    68
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    69
// Page size shifts
54094
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
    70
const size_t      ZPageSizeSmallShift           = ZGranuleSizeShift;
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    71
const size_t      ZPageSizeMediumShift          = ZPageSizeSmallShift + 4;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    72
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    73
// Page sizes
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    74
const size_t      ZPageSizeSmall                = (size_t)1 << ZPageSizeSmallShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    75
const size_t      ZPageSizeMedium               = (size_t)1 << ZPageSizeMediumShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    76
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    77
// Object size limits
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    78
const size_t      ZObjectSizeLimitSmall         = (ZPageSizeSmall / 8);  // Allow 12.5% waste
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    79
const size_t      ZObjectSizeLimitMedium        = (ZPageSizeMedium / 8); // Allow 12.5% waste
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    80
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    81
// Object alignment shifts
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    82
extern const int& ZObjectAlignmentSmallShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    83
const int         ZObjectAlignmentMediumShift   = ZPageSizeMediumShift - 13; // 8192 objects per page
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    84
const int         ZObjectAlignmentLargeShift    = ZPageSizeSmallShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    85
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    86
// Object alignments
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    87
extern const int& ZObjectAlignmentSmall;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    88
const int         ZObjectAlignmentMedium        = 1 << ZObjectAlignmentMediumShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    89
const int         ZObjectAlignmentLarge         = 1 << ZObjectAlignmentLargeShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    90
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    91
//
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    92
// Good/Bad mask states
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    93
// --------------------
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    94
//
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    95
//                 GoodMask         BadMask          WeakGoodMask     WeakBadMask
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    96
//                 --------------------------------------------------------------
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    97
//  Marked0        001              110              101              010
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    98
//  Marked1        010              101              110              001
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    99
//  Remapped       100              011              100              011
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   100
//
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   101
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   102
// Good/bad masks
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   103
extern uintptr_t  ZAddressGoodMask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   104
extern uintptr_t  ZAddressBadMask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   105
extern uintptr_t  ZAddressWeakBadMask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   106
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   107
// Pointer base address
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   108
extern uintptr_t  ZAddressBase;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   109
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   110
// Pointer part of address
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   111
extern size_t     ZAddressOffsetBits;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   112
const  size_t     ZAddressOffsetShift           = 0;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   113
extern uintptr_t  ZAddressOffsetMask;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   114
extern size_t     ZAddressOffsetMax;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   115
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   116
// Metadata part of address
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   117
const size_t      ZAddressMetadataBits          = 4;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   118
extern size_t     ZAddressMetadataShift;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   119
extern uintptr_t  ZAddressMetadataMask;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   120
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   121
// Metadata types
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   122
extern uintptr_t  ZAddressMetadataMarked;
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   123
extern uintptr_t  ZAddressMetadataMarked0;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   124
extern uintptr_t  ZAddressMetadataMarked1;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   125
extern uintptr_t  ZAddressMetadataRemapped;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   126
extern uintptr_t  ZAddressMetadataFinalizable;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   127
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   128
// NMethod entry barrier
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   129
const size_t      ZNMethodDisarmedOffset        = ZPlatformNMethodDisarmedOffset;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   130
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   131
// Cache line size
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 54094
diff changeset
   132
const size_t      ZCacheLineSize                = ZPlatformCacheLineSize;
58811
38f4701d6587 8232648: ZGC: Move ATTRIBUTE_ALIGNED to the front of declarations
stefank
parents: 58787
diff changeset
   133
#define           ZCACHE_ALIGNED                ATTRIBUTE_ALIGNED(ZCacheLineSize)
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   134
51394
8ed5f86b15aa 8209375: ZGC: Use dynamic base address for mark stack space
pliden
parents: 50525
diff changeset
   135
// Mark stack space
8ed5f86b15aa 8209375: ZGC: Use dynamic base address for mark stack space
pliden
parents: 50525
diff changeset
   136
extern uintptr_t  ZMarkStackSpaceStart;
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   137
const size_t      ZMarkStackSpaceExpandSize     = (size_t)1 << 25; // 32M
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   138
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   139
// Mark stack and magazine sizes
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   140
const size_t      ZMarkStackSizeShift           = 11; // 2K
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   141
const size_t      ZMarkStackSize                = (size_t)1 << ZMarkStackSizeShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   142
const size_t      ZMarkStackHeaderSize          = (size_t)1 << 4; // 16B
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   143
const size_t      ZMarkStackSlots               = (ZMarkStackSize - ZMarkStackHeaderSize) / sizeof(uintptr_t);
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   144
const size_t      ZMarkStackMagazineSize        = (size_t)1 << 15; // 32K
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   145
const size_t      ZMarkStackMagazineSlots       = (ZMarkStackMagazineSize / ZMarkStackSize) - 1;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   146
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   147
// Mark stripe size
54094
ed3c6f07faab 8219633: ZGC: Rename ZPageSizeMin to ZGranuleSize
pliden
parents: 52939
diff changeset
   148
const size_t      ZMarkStripeShift              = ZGranuleSizeShift;
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   149
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   150
// Max number of mark stripes
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   151
const size_t      ZMarkStripesMax               = 16; // Must be a power of two
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   152
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   153
// Mark cache size
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   154
const size_t      ZMarkCacheSize                = 1024; // Must be a power of two
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   155
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   156
// Partial array minimum size
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   157
const size_t      ZMarkPartialArrayMinSizeShift = 12; // 4K
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   158
const size_t      ZMarkPartialArrayMinSize      = (size_t)1 << ZMarkPartialArrayMinSizeShift;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   159
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   160
// Max number of proactive/terminate flush attempts
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   161
const size_t      ZMarkProactiveFlushMax        = 10;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   162
const size_t      ZMarkTerminateFlushMax        = 3;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   163
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   164
// Try complete mark timeout
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   165
const uint64_t    ZMarkCompleteTimeout          = 1; // ms
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   166
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
   167
#endif // SHARE_GC_Z_ZGLOBALS_HPP