Skip to content

Commit 476994a

Browse files
committed
8266531: ZAddress::address() should be removed from SA
Reviewed-by: cjplummer, stefank
1 parent e828a93 commit 476994a

File tree

8 files changed

+25
-46
lines changed

8 files changed

+25
-46
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
2727
ZGlobalsForVMStructs::ZGlobalsForVMStructs() :
2828
_ZGlobalPhase(&ZGlobalPhase),
2929
_ZGlobalSeqNum(&ZGlobalSeqNum),
30+
_ZAddressOffsetMask(&ZAddressOffsetMask),
3031
_ZAddressGoodMask(&ZAddressGoodMask),
3132
_ZAddressBadMask(&ZAddressBadMask),
3233
_ZAddressWeakBadMask(&ZAddressWeakBadMask),

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@ class ZGlobalsForVMStructs {
4545

4646
uint32_t* _ZGlobalSeqNum;
4747

48+
uintptr_t* _ZAddressOffsetMask;
4849
uintptr_t* _ZAddressGoodMask;
4950
uintptr_t* _ZAddressBadMask;
5051
uintptr_t* _ZAddressWeakBadMask;
@@ -60,6 +61,7 @@ typedef ZAttachedArray<ZForwarding, ZForwardingEntry> ZAttachedArrayForForwardin
6061
static_field(ZGlobalsForVMStructs, _instance_p, ZGlobalsForVMStructs*) \
6162
nonstatic_field(ZGlobalsForVMStructs, _ZGlobalPhase, uint32_t*) \
6263
nonstatic_field(ZGlobalsForVMStructs, _ZGlobalSeqNum, uint32_t*) \
64+
nonstatic_field(ZGlobalsForVMStructs, _ZAddressOffsetMask, uintptr_t*) \
6365
nonstatic_field(ZGlobalsForVMStructs, _ZAddressGoodMask, uintptr_t*) \
6466
nonstatic_field(ZGlobalsForVMStructs, _ZAddressBadMask, uintptr_t*) \
6567
nonstatic_field(ZGlobalsForVMStructs, _ZAddressWeakBadMask, uintptr_t*) \

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,6 @@ class ZAddress : public AllStatic {
5252
static bool is_remapped(uintptr_t value);
5353
static bool is_in(uintptr_t value);
5454

55-
static uintptr_t address(uintptr_t value);
5655
static uintptr_t offset(uintptr_t value);
5756
static uintptr_t good(uintptr_t value);
5857
static uintptr_t good_or_null(uintptr_t value);

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZAddress.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -52,15 +52,11 @@ static boolean is_weak_good_or_null(Address value) {
5252
}
5353

5454
static long offset(Address address) {
55-
return as_long(address) & ZGlobals.ZAddressOffsetMask;
56-
}
57-
58-
static Address address(long value) {
59-
return ZUtils.longToAddress(value);
55+
return as_long(address) & ZGlobals.ZAddressOffsetMask();
6056
}
6157

6258
static Address good(Address value) {
63-
return address(offset(value) | ZGlobals.ZAddressGoodMask());
59+
return VM.getVM().getDebugger().newAddress(offset(value) | ZGlobals.ZAddressGoodMask());
6460
}
6561

6662
static Address good_or_null(Address value) {

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZExternalBitMap.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@ public ZExternalBitMap(ZCollectedHeap collectedHeap) {
4343
}
4444

4545
private ZPage getPage(long zOffset) {
46-
if (zOffset > ZGlobals.ZAddressOffsetMask) {
46+
if (zOffset > ZGlobals.ZAddressOffsetMask()) {
4747
throw new RuntimeException("Not a Z offset: " + zOffset);
4848
}
4949

@@ -78,8 +78,8 @@ private int pageLocalBitMapIndex(ZPage page, long zOffset) {
7878
}
7979

8080
private long convertToZOffset(long offset) {
81-
long addr = ZGlobals.ZAddressSpaceStart + oopSize * offset;
82-
return addr & ZGlobals.ZAddressOffsetMask;
81+
long addr = oopSize * offset;
82+
return addr & ZGlobals.ZAddressOffsetMask();
8383
}
8484

8585
@Override

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobals.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,12 +55,8 @@ public class ZGlobals {
5555

5656
// Pointer part of address
5757
public static long ZAddressOffsetBits;
58-
public static long ZAddressOffsetMask;
5958
public static long ZAddressOffsetMax;
6059

61-
// Address space start/end/size
62-
public static long ZAddressSpaceStart;
63-
6460
static {
6561
VM.registerVMInitializedObserver((o, d) -> initialize(VM.getVM().getTypeDataBase()));
6662
}
@@ -87,10 +83,7 @@ static private synchronized void initialize(TypeDataBase db) {
8783
ZAddressOffsetShift = db.lookupLongConstant("ZAddressOffsetShift").longValue();
8884

8985
ZAddressOffsetBits = db.lookupLongConstant("ZAddressOffsetBits").longValue();
90-
ZAddressOffsetMask = db.lookupLongConstant("ZAddressOffsetMask").longValue();
9186
ZAddressOffsetMax = db.lookupLongConstant("ZAddressOffsetMax").longValue();
92-
93-
ZAddressSpaceStart = db.lookupLongConstant("ZAddressSpaceStart").longValue();
9487
}
9588

9689
private static ZGlobalsForVMStructs instance() {
@@ -105,6 +98,10 @@ public static int ZGlobalSeqNum() {
10598
return instance().ZGlobalSeqNum();
10699
}
107100

101+
public static long ZAddressOffsetMask() {
102+
return instance().ZAddressOffsetMask();
103+
}
104+
108105
public static long ZAddressGoodMask() {
109106
return instance().ZAddressGoodMask();
110107
}

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZGlobalsForVMStructs.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
3434
class ZGlobalsForVMStructs extends VMObject {
3535
private static AddressField ZGlobalPhaseField;
3636
private static AddressField ZGlobalSeqNumField;
37+
private static AddressField ZAddressOffsetMaskField;
3738
private static AddressField ZAddressGoodMaskField;
3839
private static AddressField ZAddressBadMaskField;
3940
private static AddressField ZAddressWeakBadMaskField;
@@ -49,6 +50,7 @@ static private synchronized void initialize(TypeDataBase db) {
4950

5051
ZGlobalPhaseField = type.getAddressField("_ZGlobalPhase");
5152
ZGlobalSeqNumField = type.getAddressField("_ZGlobalSeqNum");
53+
ZAddressOffsetMaskField = type.getAddressField("_ZAddressOffsetMask");
5254
ZAddressGoodMaskField = type.getAddressField("_ZAddressGoodMask");
5355
ZAddressBadMaskField = type.getAddressField("_ZAddressBadMask");
5456
ZAddressWeakBadMaskField = type.getAddressField("_ZAddressWeakBadMask");
@@ -68,6 +70,10 @@ int ZGlobalSeqNum() {
6870
return ZGlobalSeqNumField.getValue(addr).getJIntAt(0);
6971
}
7072

73+
long ZAddressOffsetMask() {
74+
return ZAddressOffsetMaskField.getValue(addr).getJLongAt(0);
75+
}
76+
7177
long ZAddressGoodMask() {
7278
return ZAddressGoodMaskField.getValue(addr).getJLongAt(0);
7379
}

test/hotspot/jtreg/ProblemList-zgc.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,14 @@
3030
resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8220624 generic-all
3131
serviceability/sa/CDSJMapClstats.java 8220624 generic-all
3232
serviceability/sa/ClhsdbDumpheap.java 8220624 generic-all
33-
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8220624 generic-all
3433
serviceability/sa/ClhsdbFindPC.java#id0 8220624 generic-all
3534
serviceability/sa/ClhsdbFindPC.java#id1 8220624 generic-all
3635
serviceability/sa/ClhsdbFindPC.java#id2 8220624 generic-all
3736
serviceability/sa/ClhsdbFindPC.java#id3 8220624 generic-all
3837
serviceability/sa/ClhsdbInspect.java 8220624 generic-all
39-
serviceability/sa/ClhsdbJdis.java 8220624 generic-all
4038
serviceability/sa/ClhsdbJhisto.java 8220624 generic-all
41-
serviceability/sa/ClhsdbJstack.java#id0 8220624 generic-all
42-
serviceability/sa/ClhsdbJstack.java#id1 8220624 generic-all
43-
serviceability/sa/ClhsdbJstackXcompStress.java 8220624 generic-all
44-
serviceability/sa/ClhsdbPrintAs.java 8220624 generic-all
45-
serviceability/sa/ClhsdbPrintStatics.java 8220624 generic-all
46-
serviceability/sa/ClhsdbPstack.java#id0 8220624 generic-all
47-
serviceability/sa/ClhsdbPstack.java#id1 8220624 generic-all
48-
serviceability/sa/ClhsdbSource.java 8220624 generic-all
4939
serviceability/sa/ClhsdbSymbol.java 8220624 generic-all
50-
serviceability/sa/ClhsdbThread.java 8220624 generic-all
51-
serviceability/sa/ClhsdbWhere.java 8220624 generic-all
52-
serviceability/sa/DeadlockDetectionTest.java 8220624 generic-all
53-
serviceability/sa/JhsdbThreadInfoTest.java 8220624 generic-all
54-
serviceability/sa/ClhsdbCDSCore.java 8220624 generic-all
55-
serviceability/sa/TestClhsdbJstackLock.java 8220624 generic-all
5640
serviceability/sa/TestHeapDumpForInvokeDynamic.java 8220624 generic-all
5741
serviceability/sa/TestHeapDumpForLargeArray.java 8220624 generic-all
58-
serviceability/sa/TestJhsdbJstackLock.java 8220624 generic-all
59-
serviceability/sa/TestJhsdbJstackMixed.java 8220624 generic-all
6042
serviceability/sa/TestJmapCore.java 8220624 generic-all
61-
serviceability/sa/TestJmapCoreMetaspace.java 8220624 generic-all
62-
serviceability/sa/TestSysProps.java 8220624 generic-all
63-
serviceability/sa/sadebugd/DebugdConnectTest.java 8220624 generic-all
64-
serviceability/sa/sadebugd/DisableRegistryTest.java 8220624 generic-all
6543
vmTestbase/jit/escape/AdaptiveBlocking/AdaptiveBlocking001/AdaptiveBlocking001.java 8260303 windows-x64

0 commit comments

Comments
 (0)