提交 8067d901 编写于 作者: H hseigel

8024517: runtime/CDSCompressedKPtrs/XShareAuto.java failed with RuntimeException

Summary: Make sure CDS is off by default when running server compiler.
Reviewed-by: dholmes, coleenp
上级 7620084e
...@@ -1096,6 +1096,7 @@ void Arguments::set_mode_flags(Mode mode) { ...@@ -1096,6 +1096,7 @@ void Arguments::set_mode_flags(Mode mode) {
} }
} }
#if defined(COMPILER2) || defined(_LP64) || !INCLUDE_CDS
// Conflict: required to use shared spaces (-Xshare:on), but // Conflict: required to use shared spaces (-Xshare:on), but
// incompatible command line options were chosen. // incompatible command line options were chosen.
...@@ -1108,6 +1109,7 @@ static void no_shared_spaces() { ...@@ -1108,6 +1109,7 @@ static void no_shared_spaces() {
FLAG_SET_DEFAULT(UseSharedSpaces, false); FLAG_SET_DEFAULT(UseSharedSpaces, false);
} }
} }
#endif
void Arguments::set_tiered_flags() { void Arguments::set_tiered_flags() {
// With tiered, set default policy to AdvancedThresholdPolicy, which is 3. // With tiered, set default policy to AdvancedThresholdPolicy, which is 3.
...@@ -1492,16 +1494,18 @@ void Arguments::set_ergonomics_flags() { ...@@ -1492,16 +1494,18 @@ void Arguments::set_ergonomics_flags() {
FLAG_SET_ERGO(bool, UseParallelGC, true); FLAG_SET_ERGO(bool, UseParallelGC, true);
} }
} }
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. On server class machines, keep the default
// off unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
if (!DumpSharedSpaces && !RequireSharedSpaces &&
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces();
}
} }
#ifdef COMPILER2
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. When -server is specified, keep the default off
// unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
if (!DumpSharedSpaces && !RequireSharedSpaces &&
(FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
no_shared_spaces();
}
#endif
#ifndef ZERO #ifndef ZERO
#ifdef _LP64 #ifdef _LP64
......
...@@ -33,16 +33,9 @@ import com.oracle.java.testlibrary.*; ...@@ -33,16 +33,9 @@ import com.oracle.java.testlibrary.*;
public class XShareAuto { public class XShareAuto {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
if (!Platform.is64bit()) {
System.out.println("ObjectAlignmentInBytes for CDS is only " +
"supported on 64bit platforms; this plaform is " +
System.getProperty("sun.arch.data.model"));
System.out.println("Skipping the test");
return;
}
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-server", "-XX:+UnlockDiagnosticVMOptions",
"-Xshare:dump"); "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
OutputAnalyzer output = new OutputAnalyzer(pb.start()); OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("Loading classes to share"); output.shouldContain("Loading classes to share");
output.shouldHaveExitValue(0); output.shouldHaveExitValue(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册