src/hotspot/share/gc/z/zAddress.cpp
author coleenp
Wed, 31 Jul 2019 06:54:50 -0400
changeset 57603 f9d9bed12d1a
parent 54617 24f6b0e413a0
child 58294 872465abbfe3
permissions -rw-r--r--
8228630: Remove always true parameter to NoSafepointVerifier Summary: Also remove NoGCVerifier since NoSafepointVerifier covers GC checking when not already at a safepoint and is a stronger check. Reviewed-by: kbarrett, dholmes
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
/*
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
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
#include "precompiled.hpp"
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    25
#include "gc/z/zAddress.hpp"
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    26
#include "gc/z/zGlobals.hpp"
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    27
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    28
void ZAddress::set_good_mask(uintptr_t mask) {
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    29
  ZAddressGoodMask = mask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    30
  ZAddressBadMask = ZAddressGoodMask ^ ZAddressMetadataMask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    31
  ZAddressWeakBadMask = (ZAddressGoodMask | ZAddressMetadataRemapped | ZAddressMetadataFinalizable) ^ ZAddressMetadataMask;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    32
}
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    33
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    34
void ZAddress::initialize() {
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    35
  ZAddressSpaceStart = ZPlatformAddressSpaceStart();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    36
  ZAddressSpaceEnd = ZPlatformAddressSpaceEnd();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    37
  ZAddressSpaceSize = ZAddressSpaceEnd - ZAddressSpaceStart;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    38
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    39
  ZAddressReservedStart = ZPlatformAddressReservedStart();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    40
  ZAddressReservedEnd = ZPlatformAddressReservedEnd();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    41
  ZAddressReservedSize = ZAddressReservedEnd - ZAddressReservedStart;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    42
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    43
  ZAddressBase = ZPlatformAddressBase();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    44
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    45
  ZAddressOffsetBits = ZPlatformAddressOffsetBits();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    46
  ZAddressOffsetMask = (((uintptr_t)1 << ZAddressOffsetBits) - 1) << ZAddressOffsetShift;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    47
  ZAddressOffsetMax = (uintptr_t)1 << ZAddressOffsetBits;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    48
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    49
  ZAddressMetadataShift = ZPlatformAddressMetadataShift();
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    50
  ZAddressMetadataMask = (((uintptr_t)1 << ZAddressMetadataBits) - 1) << ZAddressMetadataShift;
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    51
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    52
  ZAddressMetadataMarked0 = (uintptr_t)1 << (ZAddressMetadataShift + 0);
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    53
  ZAddressMetadataMarked1 = (uintptr_t)1 << (ZAddressMetadataShift + 1);
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    54
  ZAddressMetadataRemapped = (uintptr_t)1 << (ZAddressMetadataShift + 2);
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    55
  ZAddressMetadataFinalizable = (uintptr_t)1 << (ZAddressMetadataShift + 3);
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    56
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    57
  ZAddressMetadataMarked = ZAddressMetadataMarked0;
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    58
  set_good_mask(ZAddressMetadataRemapped);
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    59
}
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    60
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    61
void ZAddress::flip_to_marked() {
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    62
  ZAddressMetadataMarked ^= (ZAddressMetadataMarked0 | ZAddressMetadataMarked1);
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    63
  set_good_mask(ZAddressMetadataMarked);
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    64
}
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    65
54617
24f6b0e413a0 8221786: ZGC: Increase max heap size to 16TB
pliden
parents: 50525
diff changeset
    66
void ZAddress::flip_to_remapped() {
50525
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    67
  set_good_mask(ZAddressMetadataRemapped);
767cdb97f103 8204210: Implementation: JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
pliden
parents:
diff changeset
    68
}