8243619: compiler/codecache/CheckSegmentedCodeCache.java test misses -version

Reviewed-by: thartmann
This commit is contained in:
Igor Ignatyev 2020-04-27 09:16:00 -07:00
parent 9097c799f2
commit 83a6527e44

View File

@ -92,51 +92,60 @@ public class CheckSegmentedCodeCache {
// Disabled with ReservedCodeCacheSize < 240MB
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifySegmentedCodeCache(pb, false);
// Disabled without TieredCompilation
pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifySegmentedCodeCache(pb, false);
// Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB
pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
"-XX:ReservedCodeCacheSize=240m",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifySegmentedCodeCache(pb, true);
pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
"-XX:ReservedCodeCacheSize=400m",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifySegmentedCodeCache(pb, true);
// Always enabled if SegmentedCodeCache is set
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:-TieredCompilation",
"-XX:ReservedCodeCacheSize=239m",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifySegmentedCodeCache(pb, true);
// The profiled and non-profiled code heaps should not be available in
// interpreter-only mode
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-Xint",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED);
// If we stop compilation at CompLevel_none or CompLevel_simple we
// don't need a profiled code heap.
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:TieredStopAtLevel=0",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifyCodeHeapNotExists(pb, PROFILED);
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:TieredStopAtLevel=1",
"-XX:+PrintCodeCache", "-version");
"-XX:+PrintCodeCache",
"-version");
verifyCodeHeapNotExists(pb, PROFILED);
// Fails with too small non-nmethod code heap size
pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K");
pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K",
"-version");
failsWith(pb, "Invalid NonNMethodCodeHeapSize");
// Fails if code heap sizes do not add up
@ -144,7 +153,8 @@ public class CheckSegmentedCodeCache {
"-XX:ReservedCodeCacheSize=10M",
"-XX:NonNMethodCodeHeapSize=5M",
"-XX:ProfiledCodeHeapSize=5M",
"-XX:NonProfiledCodeHeapSize=5M");
"-XX:NonProfiledCodeHeapSize=5M",
"-version");
failsWith(pb, "Invalid code heap sizes");
// Fails if not enough space for VM internal code
@ -153,7 +163,8 @@ public class CheckSegmentedCodeCache {
long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace;
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
"-XX:ReservedCodeCacheSize=" + minSize,
"-XX:InitialCodeCacheSize=100K");
"-XX:InitialCodeCacheSize=100K",
"-version");
failsWith(pb, "Not enough space in non-nmethod code heap to run VM");
}
}