Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce +UseCompressedClassPointers #5

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -4105,6 +4105,13 @@ jint Arguments::apply_ergo() {
}
UseBiasedLocking = false;

#ifdef _LP64
if (!FLAG_IS_DEFAULT(UseCompressedClassPointers) && !UseCompressedClassPointers) {
warning("Compressed class pointers are required with Lilliput build; ignoring UsCompressedClassPointers flag.");
}
UseCompressedClassPointers = true;
#endif

return JNI_OK;
}

@@ -25,7 +25,6 @@
* @test
* @bug 8160591
* @summary C1-generated code for System.arraycopy() does not throw an ArrayStoreException if 'dst' is no a "proper" array (i.e., it is java.lang.Object)
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xcomp -XX:-UseCompressedClassPointers -XX:CompileOnly=TestArrayCopyToFromObject.test TestArrayCopyToFromObject
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xcomp -XX:+UseCompressedClassPointers -XX:CompileOnly=TestArrayCopyToFromObject.test TestArrayCopyToFromObject
*/
public class TestArrayCopyToFromObject {
@@ -33,19 +33,9 @@
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:+UseCompressedOops -XX:-UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:-UseCompressedOops -XX:+UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:-UseCompressedOops -XX:-UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
*/
package compiler.unsafe;

This file was deleted.

@@ -47,8 +47,8 @@
* java.compiler
* java.management/sun.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UsePerfData -XX:+UseSerialGC gc.metaspace.TestMetaspacePerfCounters
*/

/* @test TestMetaspacePerfCountersParallel
@@ -61,8 +61,8 @@
* java.compiler
* java.management/sun.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UsePerfData -XX:+UseParallelGC gc.metaspace.TestMetaspacePerfCounters
*/

/* @test TestMetaspacePerfCountersG1
@@ -75,8 +75,8 @@
* java.compiler
* java.management/sun.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UsePerfData -XX:+UseG1GC gc.metaspace.TestMetaspacePerfCounters
*/

/* @test TestMetaspacePerfCountersShenandoah
@@ -89,8 +89,8 @@
* java.compiler
* java.management/sun.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UsePerfData -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.metaspace.TestMetaspacePerfCounters
*/
public class TestMetaspacePerfCounters {
public static Class<?> fooClass = null;
@@ -174,7 +174,7 @@ private static Class<?> compileAndLoad(String name, String source) throws Except
}

private static boolean isUsingCompressedClassPointers() {
return Platform.is64bit() && InputArguments.contains("-XX:+UseCompressedClassPointers");
return Platform.is64bit();
}

private static long getMinCapacity(String ns) throws Exception {
@@ -39,8 +39,8 @@
* @modules java.base/jdk.internal.misc
* java.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseSerialGC -XX:+UsePerfData -Xint gc.metaspace.TestPerfCountersAndMemoryPools
*/
public class TestPerfCountersAndMemoryPools {
public static void main(String[] args) throws Exception {
@@ -35,24 +35,21 @@
* @requires vm.gc.Serial
* @summary Tests that the metaspace size transition logging is done correctly.
* @library /test/lib
* @run driver gc.metaspace.TestSizeTransitions false -XX:+UseSerialGC
* @run driver gc.metaspace.TestSizeTransitions true -XX:+UseSerialGC
* @run driver gc.metaspace.TestSizeTransitions -XX:+UseSerialGC
*/

/* @test TestSizeTransitionsParallel
* @requires vm.gc.Parallel
* @summary Tests that the metaspace size transition logging is done correctly.
* @library /test/lib
* @run driver gc.metaspace.TestSizeTransitions false -XX:+UseParallelGC
* @run driver gc.metaspace.TestSizeTransitions true -XX:+UseParallelGC
* @run driver gc.metaspace.TestSizeTransitions -XX:+UseParallelGC
*/

/* @test TestSizeTransitionsG1
* @requires vm.gc.G1
* @summary Tests that the metaspace size transition logging is done correctly.
* @library /test/lib
* @run driver gc.metaspace.TestSizeTransitions false -XX:+UseG1GC
* @run driver gc.metaspace.TestSizeTransitions true -XX:+UseG1GC
* @run driver gc.metaspace.TestSizeTransitions -XX:+UseG1GC
*/

public class TestSizeTransitions {
@@ -90,25 +87,15 @@ public static void main(String... args) throws Exception {
SIZE_TRANSITION_REGEX);

public static void main(String... args) throws Exception {
// args: <use-coops> <gc-arg>
if (args.length != 2) {
// args: <gc-arg>
if (args.length != 1) {
throw new RuntimeException("wrong number of args: " + args.length);
}

final boolean hasCompressedKlassPointers = Platform.is64bit();
final boolean useCompressedKlassPointers = Boolean.parseBoolean(args[0]);
final String gcArg = args[1];

if (!hasCompressedKlassPointers && useCompressedKlassPointers) {
// No need to run this configuration.
System.out.println("Skipping test.");
return;
}
final String gcArg = args[0];

List<String> jvmArgs = new ArrayList<>();
if (hasCompressedKlassPointers) {
jvmArgs.add(useCompressedKlassPointers ? "-XX:+UseCompressedClassPointers" : "-XX:-UseCompressedClassPointers");
}
jvmArgs.add(gcArg);
jvmArgs.add("-Xmx256m");
jvmArgs.add("-Xlog:gc,gc+metaspace=info");
@@ -124,7 +111,7 @@ public static void main(String... args) throws Exception {
System.out.println(output.getStdout());
output.shouldHaveExitValue(0);

if (useCompressedKlassPointers) {
if (hasCompressedKlassPointers) {
output.stdoutShouldMatch(COMPRESSED_KLASS_POINTERS_REGEX);
output.stdoutShouldNotMatch(NO_COMPRESSED_KLASS_POINTERS_REGEX);
} else {
@@ -86,16 +86,3 @@
* @requires vm.flagless
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:+UnlockDiagnosticVMOptions -XX:VerifyMetaspaceInterval=3 -XX:+MetaspaceGuardAllocations
*/




/* @test id=balanced-no-ccs
* @summary Run metaspace-related gtests with compressed class pointers off
* @requires vm.bits == 64
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.xml
* @requires vm.flagless
* @run main/native GTestWrapper --gtest_filter=metaspace* -XX:MetaspaceReclaimPolicy=balanced -XX:-UseCompressedClassPointers
*/
@@ -27,14 +27,3 @@
* are not tested explicitly in the standard gtests.
*
*/

/* @test
* @bug 8264008
* @summary Run metaspace utils related gtests with compressed class pointers off
* @requires vm.bits == 64
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.xml
* @requires vm.flagless
* @run main/native GTestWrapper --gtest_filter=MetaspaceUtils* -XX:-UseCompressedClassPointers
*/
@@ -83,13 +83,5 @@ public static void main(String[] args) throws Exception {
output = new OutputAnalyzer(pb.start());
output.shouldMatch("Compressed class space.*3221225472")
.shouldHaveExitValue(0);


pb = ProcessTools.createJavaProcessBuilder("-XX:-UseCompressedClassPointers",
"-XX:CompressedClassSpaceSize=1m",
"-version");
output = new OutputAnalyzer(pb.start());
output.shouldContain("Setting CompressedClassSpaceSize has no effect when compressed class pointers are not used")
.shouldHaveExitValue(0);
}
}
@@ -38,7 +38,6 @@
* @modules java.base/jdk.internal.misc
* java.management
* @run main/othervm -XX:+UseCompressedOops -XX:+UseCompressedClassPointers FieldDensityTest
* @run main/othervm -XX:+UseCompressedOops -XX:-UseCompressedClassPointers FieldDensityTest
*/

import java.lang.reflect.Field;
@@ -67,26 +67,6 @@
* @run main/othervm -Dwith-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UnlockDiagnosticVMOptions -XX:+MetaspaceGuardAllocations PrintMetaspaceDcmd
*/

/*
* @test id=test-64bit-noccs
* @summary Test the VM.metaspace command
* @requires vm.bits == "64"
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @run main/othervm -Dwithout-compressed-class-space -XX:MaxMetaspaceSize=201M -Xmx100M -XX:-UseCompressedOops -XX:-UseCompressedClassPointers PrintMetaspaceDcmd
*/

/*
* @test id=test-nospecified
* @summary Test the VM.metaspace command
* @requires vm.bits == "64"
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
* @run main/othervm -Dno-specified-flag -Xmx100M -XX:-UseCompressedOops -XX:-UseCompressedClassPointers PrintMetaspaceDcmd
*/

/*
* @test test-32bit
* @summary Test the VM.metaspace command
@@ -67,8 +67,6 @@ private void initTestTable() {
}
testTable.add( new TestVector("-XX:+UseCompressedOops", "-XX:-UseCompressedOops",
"The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.", 1) );
testTable.add( new TestVector("-XX:+UseCompressedClassPointers", "-XX:-UseCompressedClassPointers",
"The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.", 1) );
}

private void runTests() throws Exception