Skip to content

Commit

Permalink
8325763: Revert properties: vm.opt.x.*
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, stefank
  • Loading branch information
lkorinth committed Feb 16, 2024
1 parent 4018b2b commit 0aaec97
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 40 deletions.
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/arguments/TestG1HeapSizeFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,7 +28,7 @@
* @bug 8006088
* @summary Tests argument processing for initial and maximum heap size for the G1 collector
* @key flag-sensitive
* @requires vm.gc.G1 & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @requires vm.gc.G1 & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/arguments/TestHeapFreeRatio.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,7 @@
* @test TestHeapFreeRatio
* @bug 8025661
* @summary Test parsing of -Xminf and -Xmaxf
* @requires vm.opt.x.Xminf == null & vm.opt.x.Xmaxf == null & vm.opt.MinHeapFreeRatio == null & vm.opt.MaxHeapFreeRatio == null
* @requires vm.opt.MinHeapFreeRatio == null & vm.opt.MaxHeapFreeRatio == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
8 changes: 4 additions & 4 deletions test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,7 +29,7 @@
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @key flag-sensitive
* @requires vm.gc.Serial & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @requires vm.gc.Serial & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand All @@ -44,7 +44,7 @@
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @key flag-sensitive
* @requires vm.gc.Parallel & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @requires vm.gc.Parallel & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand All @@ -59,7 +59,7 @@
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @key flag-sensitive
* @requires vm.gc.G1 & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @requires vm.gc.G1 & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,7 +29,7 @@
* @summary Tests argument processing for initial and maximum heap size for the
* parallel collectors.
* @key flag-sensitive
* @requires vm.gc.Parallel & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @requires vm.gc.Parallel & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/gc/arguments/TestSerialHeapSizeFlags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,7 +28,7 @@
* @bug 8006088
* @summary Tests argument processing for initial and maximum heap size for the Serial collector
* @key flag-sensitive
* @requires vm.gc.Serial & vm.opt.x.Xmx == null & vm.opt.x.Xms == null & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @requires vm.gc.Serial & vm.opt.MinHeapSize == null & vm.opt.MaxHeapSize == null & vm.opt.InitialHeapSize == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
Expand Down
29 changes: 1 addition & 28 deletions test/jtreg-ext/requires/VMProps.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -47,7 +47,6 @@
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import jdk.internal.foreign.CABI;
Expand Down Expand Up @@ -84,10 +83,6 @@ public void put(String key, Supplier<String> s) {
}
map.put(key, value);
}

public void putAll(Map<String, String> map) {
map.entrySet().forEach(e -> put(e.getKey(), () -> e.getValue()));
}
}

/**
Expand Down Expand Up @@ -140,7 +135,6 @@ public Map<String, String> call() {
map.put("jdk.containerized", this::jdkContainerized);
map.put("vm.flagless", this::isFlagless);
map.put("jdk.foreign.linker", this::jdkForeignLinker);
map.putAll(xOptFlags()); // -Xmx4g -> @requires vm.opt.x.Xmx == "4g" )
vmGC(map); // vm.gc.X = true/false
vmGCforCDS(map); // may set vm.gc
vmOptFinalFlags(map);
Expand Down Expand Up @@ -719,27 +713,6 @@ private Stream<String> allFlags() {
return Stream.of((System.getProperty("test.vm.opts", "") + " " + System.getProperty("test.java.opts", "")).trim().split("\\s+"));
}

/**
* Parses extra options, options that start with -X excluding the
* bare -X option (as it is not considered an extra option).
* Ignores extra options not starting with -X
*
* This could be improved to handle extra options not starting
* with -X as well as "standard" options.
*/
private Map<String, String> xOptFlags() {
return allFlags()
.filter(s -> s.startsWith("-X") && !s.startsWith("-XX:") && !s.equals("-X"))
.map(s -> s.replaceFirst("-", ""))
.map(flag -> flag.splitWithDelimiters("[:0123456789]", 2))
.collect(Collectors.toMap(a -> "vm.opt.x." + a[0],
a -> (a.length == 1)
? "true" // -Xnoclassgc
: (a[1].equals(":")
? a[2] // ["-XshowSettings", ":", "system"]
: a[1] + a[2]))); // ["-Xmx", "4", "g"]
}

/*
* A string indicating the foreign linker that is currently being used. See jdk.internal.foreign.CABI
* for valid values.
Expand Down

5 comments on commit 0aaec97

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb
Copy link
Member

@mrserb mrserb commented on 0aaec97 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk22u

@mrserb
Copy link
Member

@mrserb mrserb commented on 0aaec97 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 0aaec97 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb the backport was successfully created on the branch backport-mrserb-0aaec975 in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 0aaec975 from the openjdk/jdk repository.

The commit being backported was authored by Leo Korinth on 16 Feb 2024 and was reviewed by Albert Mingkun Yang and Stefan Karlsson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-mrserb-0aaec975:backport-mrserb-0aaec975
$ git checkout backport-mrserb-0aaec975
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-mrserb-0aaec975

⚠️ @mrserb You are not yet a collaborator in my fork openjdk-bots/jdk22u. An invite will be sent out and you need to accept it before you can proceed.

@openjdk
Copy link

@openjdk openjdk bot commented on 0aaec97 May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb the backport was successfully created on the branch backport-mrserb-0aaec975 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 0aaec975 from the openjdk/jdk repository.

The commit being backported was authored by Leo Korinth on 16 Feb 2024 and was reviewed by Albert Mingkun Yang and Stefan Karlsson.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-mrserb-0aaec975:backport-mrserb-0aaec975
$ git checkout backport-mrserb-0aaec975
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-mrserb-0aaec975

Please sign in to comment.