Skip to content

Commit c621d7c

Browse files
Rename ReferenceAccess.getAddressSpaceSize() to getMaxAddressSpaceSize().
1 parent 4797b6f commit c621d7c

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/AbstractCollectionPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public UnsignedWord getMinimumHeapSize() {
327327
protected abstract long gcCount();
328328

329329
protected SizeParameters computeSizeParameters(SizeParameters existing) {
330-
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getAddressSpaceSize();
330+
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getMaxAddressSpaceSize();
331331
UnsignedWord minYoungSpaces = minSpaceSize(); // eden
332332
if (HeapParameters.getMaxSurvivorSpaces() > 0) {
333333
minYoungSpaces = minYoungSpaces.add(minSpaceSize().multiply(2)); // survivor from and to
@@ -430,7 +430,7 @@ private SizeParameters(UnsignedWord maxHeapSize, UnsignedWord maxYoungSize, Unsi
430430
assert initialHeapSize.belowOrEqual(maxHeapSize);
431431
assert maxSurvivorSize().belowThan(maxYoungSize);
432432
assert maxYoungSize.add(maxOldSize()).equal(maxHeapSize);
433-
assert maxHeapSize.belowOrEqual(ReferenceAccess.singleton().getAddressSpaceSize());
433+
assert maxHeapSize.belowOrEqual(ReferenceAccess.singleton().getMaxAddressSpaceSize());
434434
assert initialEdenSize.add(initialSurvivorSize.multiply(2)).equal(initialYoungSize());
435435
assert initialYoungSize().add(initialOldSize()).equal(initialHeapSize);
436436
}

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/AddressRangeCommittedMemoryProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
import static com.oracle.svm.core.util.PointerUtils.roundDown;
2929
import static com.oracle.svm.core.util.PointerUtils.roundUp;
3030
import static com.oracle.svm.core.util.VMError.guarantee;
31-
import static jdk.graal.compiler.word.Word.unsigned;
3231
import static jdk.graal.compiler.word.Word.nullPointer;
32+
import static jdk.graal.compiler.word.Word.unsigned;
3333

34-
import jdk.graal.compiler.word.Word;
3534
import org.graalvm.nativeimage.Isolate;
3635
import org.graalvm.nativeimage.Platform;
3736
import org.graalvm.nativeimage.Platforms;
@@ -74,6 +73,7 @@
7473
import com.oracle.svm.core.util.VMError;
7574

7675
import jdk.graal.compiler.api.replacements.Fold;
76+
import jdk.graal.compiler.word.Word;
7777

7878
/**
7979
* Reserves a fixed-size address range and provides memory from it by committing and uncommitting
@@ -144,7 +144,7 @@ public AddressRangeCommittedMemoryProvider() {
144144
@Override
145145
@Uninterruptible(reason = "Still being initialized.")
146146
public int initialize(WordPointer heapBasePointer, IsolateArguments arguments) {
147-
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getAddressSpaceSize();
147+
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getMaxAddressSpaceSize();
148148
UnsignedWord reserved = Word.unsigned(IsolateArgumentAccess.readLong(arguments, IsolateArgumentParser.getOptionIndex(SubstrateGCOptions.ReservedAddressSpaceSize)));
149149
if (reserved.equal(0)) {
150150
/*

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/BasicCollectionPolicies.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public final UnsignedWord getMaximumHeapSize() {
106106
* If the physical size is known yet, the maximum size of the heap is a fraction of the
107107
* size of the physical memory.
108108
*/
109-
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getAddressSpaceSize();
109+
UnsignedWord addressSpaceSize = ReferenceAccess.singleton().getMaxAddressSpaceSize();
110110
UnsignedWord physicalMemorySize = PhysicalMemory.size();
111111
int maximumHeapSizePercent = HeapParameters.getMaximumHeapSizePercent();
112112
/* Do not cache because `-Xmx` option parsing may not have happened yet. */

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/HeapSizeVerifier.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
package com.oracle.svm.core.heap;
2626

27-
import jdk.graal.compiler.word.Word;
2827
import org.graalvm.word.UnsignedWord;
2928

3029
import com.oracle.svm.core.SubstrateGCOptions;
@@ -34,6 +33,8 @@
3433
import com.oracle.svm.core.util.UserError;
3534
import com.oracle.svm.core.util.UserError.UserException;
3635

36+
import jdk.graal.compiler.word.Word;
37+
3738
/**
3839
* Verifies that the heap size options are used consistently. Note that some checks seem redundant
3940
* at first glance. However, those checks are needed because options don't necessarily have a value.
@@ -100,7 +101,7 @@ public static void verifyMaxNewSizeAgainstMaxAddressSpaceSize(UnsignedWord maxNe
100101
}
101102

102103
private static void verifyAgainstMaxAddressSpaceSize(UnsignedWord actualValue, String actualValueName) {
103-
UnsignedWord maxAddressSpaceSize = ReferenceAccess.singleton().getAddressSpaceSize();
104+
UnsignedWord maxAddressSpaceSize = ReferenceAccess.singleton().getMaxAddressSpaceSize();
104105
if (actualValue.aboveThan(maxAddressSpaceSize)) {
105106
throwError(actualValue, actualValueName, maxAddressSpaceSize, "largest possible heap address space");
106107
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ static ReferenceAccess singleton() {
103103
* Returns the maximum size that the Java heap address space can have at run-time (e.g., based
104104
* on the reference size).
105105
*/
106-
UnsignedWord getAddressSpaceSize();
106+
UnsignedWord getMaxAddressSpaceSize();
107107
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/ReferenceAccessImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public CompressEncoding getCompressEncoding() {
109109

110110
@Fold
111111
@Override
112-
public UnsignedWord getAddressSpaceSize() {
112+
public UnsignedWord getMaxAddressSpaceSize() {
113113
int compressionShift = ReferenceAccess.singleton().getCompressEncoding().getShift();
114114
if (compressionShift > 0) {
115115
int referenceSize = ConfigurationValues.getObjectLayout().getReferenceSize();

0 commit comments

Comments
 (0)