Skip to content

Commit

Permalink
[GR-45786] [GR-53798] [GR-59639] Cleanups.
Browse files Browse the repository at this point in the history
PullRequest: graal/19239
  • Loading branch information
christianhaeubl committed Nov 11, 2024
2 parents 3b0c973 + b412009 commit 6dcfa43
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ boolean collectWithoutAllocating(GCCause cause, boolean forceFullGC) {

@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
public static boolean shouldIgnoreOutOfMemory() {
return SerialGCOptions.IgnoreMaxHeapSizeWhileInVMOperation.getValue() && inVMInternalCode();
return SerialGCOptions.IgnoreMaxHeapSizeWhileInVMInternalCode.getValue() && inVMInternalCode();
}

@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package com.oracle.svm.core.genscavenge;

import org.graalvm.collections.EconomicMap;
import org.graalvm.collections.UnmodifiableEconomicMap;

import com.oracle.svm.core.SubstrateOptions;
Expand Down Expand Up @@ -109,23 +110,32 @@ public Integer getValue(OptionValues values) {
@Option(help = "Develop demographics of the object references visited. Serial GC only.", type = OptionType.Debug)//
public static final HostedOptionKey<Boolean> GreyToBlackObjRefDemographics = new HostedOptionKey<>(false, SerialGCOptions::serialGCOnly);

/* Option should be renamed, see GR-53798. */
@Option(help = "Ignore the maximum heap size while in VM-internal code.", type = OptionType.Expert)//
public static final HostedOptionKey<Boolean> IgnoreMaxHeapSizeWhileInVMOperation = new HostedOptionKey<>(false, SerialGCOptions::serialGCOnly);
@Option(help = "Ignore the maximum heap size while in VM-internal code. Serial GC only.", type = OptionType.Expert)//
public static final HostedOptionKey<Boolean> IgnoreMaxHeapSizeWhileInVMInternalCode = new HostedOptionKey<>(false, SerialGCOptions::serialGCOnly);

@Option(help = "Determines whether to always (if true) or never (if false) outline write barrier code to a separate function, " +
"trading reduced image size for (potentially) worse performance. Serial GC only.", type = OptionType.Expert) //
public static final HostedOptionKey<Boolean> OutlineWriteBarriers = new HostedOptionKey<>(null, SerialGCOptions::serialGCOnly);

/** Query these options only through an appropriate method. */
public static class ConcealedOptions {
@Option(help = "Collect old generation by compacting in-place instead of copying.", type = OptionType.Expert) //
@Option(help = "Collect old generation by compacting in-place instead of copying. Serial GC only.", type = OptionType.Expert) //
public static final HostedOptionKey<Boolean> CompactingOldGen = new HostedOptionKey<>(false, SerialGCOptions::validateCompactingOldGen);

@Option(help = "Determines if a remembered set is used, which is necessary for collecting the young and old generation independently.", type = OptionType.Expert) //
@Option(help = "Determines if a remembered set is used, which is necessary for collecting the young and old generation independently. Serial GC only.", type = OptionType.Expert) //
public static final HostedOptionKey<Boolean> UseRememberedSet = new HostedOptionKey<>(true, SerialGCOptions::serialGCOnly);
}

public static class DeprecatedOptions {
@Option(help = "Ignore the maximum heap size while in VM-internal code. Serial GC only.", type = OptionType.Expert, deprecated = true, deprecationMessage = "Please use the option 'IgnoreMaxHeapSizeWhileInVMInternalCode' instead.")//
public static final HostedOptionKey<Boolean> IgnoreMaxHeapSizeWhileInVMOperation = new HostedOptionKey<>(false, SerialGCOptions::serialGCOnly) {
@Override
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean oldValue, Boolean newValue) {
IgnoreMaxHeapSizeWhileInVMInternalCode.update(values, newValue);
}
};
}

private SerialGCOptions() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ public void releaseChunks(ChunkReleaser chunkReleaser) {
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
void appendAlignedHeapChunk(AlignedHeapChunk.AlignedHeader aChunk) {
/*
* This method is used from {@link PosixJavaThreads#detachThread(VMThread)}, so it can not
* guarantee that it is inside a VMOperation, only that there is some mutual exclusion.
* This method is used while detaching a thread, so it cannot guarantee that it is inside a
* VMOperation, only that there is some mutual exclusion.
*/
VMThreads.guaranteeOwnsThreadMutex("Trying to append an aligned heap chunk but no mutual exclusion.", true);
appendAlignedHeapChunkUninterruptibly(aChunk);
Expand Down Expand Up @@ -303,8 +303,8 @@ private void extractAlignedHeapChunkUninterruptibly(AlignedHeapChunk.AlignedHead
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
void appendUnalignedHeapChunk(UnalignedHeapChunk.UnalignedHeader uChunk) {
/*
* This method is used from {@link PosixJavaThreads#detachThread(VMThread)}, so it can not
* guarantee that it is inside a VMOperation, only that there is some mutual exclusion.
* This method is used while detaching a thread, so it cannot guarantee that it is inside a
* VMOperation, only that there is some mutual exclusion.
*/
VMThreads.guaranteeOwnsThreadMutex("Trying to append an unaligned chunk but no mutual exclusion.", true);
appendUnalignedHeapChunkUninterruptibly(uChunk);
Expand Down

0 comments on commit 6dcfa43

Please sign in to comment.