8276711: compiler/codecache/cli tests failing when SegmentedCodeCache used with -Xint

Reviewed-by: kvn, dholmes
This commit is contained in:
Coleen Phillimore 2022-03-03 13:20:58 +00:00
parent 832729b41e
commit 7822cbce10
5 changed files with 19 additions and 26 deletions
src/hotspot/share
test/hotspot/jtreg/compiler/codecache/cli

@ -368,7 +368,7 @@ bool CodeCache::heap_available(int code_blob_type) {
if (!SegmentedCodeCache) {
// No segmentation: use a single code heap
return (code_blob_type == CodeBlobType::All);
} else if (Arguments::is_interpreter_only()) {
} else if (CompilerConfig::is_interpreter_only()) {
// Interpreter only: we don't need any method code heaps
return (code_blob_type == CodeBlobType::NonNMethod);
} else if (CompilerConfig::is_c1_profiling()) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2022, 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
@ -310,7 +310,6 @@ void CompilerConfig::set_compilation_policy_flags() {
}
}
if (CompileThresholdScaling < 0) {
vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL);
}
@ -509,6 +508,10 @@ bool CompilerConfig::check_args_consistency(bool status) {
}
FLAG_SET_CMDLINE(TieredCompilation, false);
}
if (SegmentedCodeCache) {
warning("SegmentedCodeCache has no meaningful effect with -Xint");
FLAG_SET_DEFAULT(SegmentedCodeCache, false);
}
#if INCLUDE_JVMCI
if (EnableJVMCI) {
if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2022, 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
@ -56,6 +56,9 @@ public class TestSegmentedCodeCacheOption {
private static final String[] UNEXPECTED_MESSAGES = new String[] {
".*" + SEGMENTED_CODE_CACHE + ".*"
};
private static final String[] XINT_EXPECTED_MESSAGE = new String[] {
"SegmentedCodeCache has no meaningful effect with -Xint"
};
private static enum TestCase {
@ -86,10 +89,11 @@ public class TestSegmentedCodeCacheOption {
// ... and even w/ Xint.
testCaseExitCodeMessage = "It should be possible to use "
+ USE_SEGMENTED_CODE_CACHE + " in interpreted mode "
+ "without any errors.";
+ "but it produces a warning that it is ignored.";
CommandLineOptionTest.verifyJVMStartup(
/* expected messages */ null, UNEXPECTED_MESSAGES,
XINT_EXPECTED_MESSAGE,
/* unexpected messages */ null,
testCaseExitCodeMessage, testCaseWarningMessage,
ExitCode.OK, false, INT_MODE, USE_SEGMENTED_CODE_CACHE);
}
@ -117,14 +121,6 @@ public class TestSegmentedCodeCacheOption {
CommandLineOptionTest.prepareNumericFlag(
BlobType.All.sizeOptionName,
BELOW_THRESHOLD_CC_SIZE));
// SCC could be explicitly enabled w/ Xint
errorMessage = String.format("It should be possible to "
+ "explicitly enable %s in interpreted mode.",
SEGMENTED_CODE_CACHE);
CommandLineOptionTest.verifyOptionValue(SEGMENTED_CODE_CACHE,
"true", errorMessage, false, INT_MODE,
USE_SEGMENTED_CODE_CACHE);
// SCC could be explicitly enabled w/o TieredCompilation and w/
// small ReservedCodeCacheSize value
errorMessage = String.format("It should be possible to "

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2022, 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
@ -63,15 +63,9 @@ public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase {
private TestCodeHeapSizeOptions() {
super(CodeCacheCLITestBase.OPTIONS_SET,
new CodeCacheCLITestCase(CodeCacheCLITestCase
.CommonDescriptions.INT_MODE.description,
GENERIC_RUNNER),
new CodeCacheCLITestCase(CodeCacheCLITestCase
.CommonDescriptions.NON_TIERED.description,
GENERIC_RUNNER),
new CodeCacheCLITestCase(CodeCacheCLITestCase
.CommonDescriptions.TIERED_LEVEL_0.description,
GENERIC_RUNNER),
new CodeCacheCLITestCase(CodeCacheCLITestCase
.CommonDescriptions.TIERED_LEVEL_1.description,
GENERIC_RUNNER),

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2022, 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
@ -66,9 +66,9 @@ public class CodeCacheCLITestCase {
public enum CommonDescriptions {
/**
* Verifies that in interpreted mode PrintCodeCache output contains
* only NonNMethod code heap.
* the whole code cache. Int mode disables SegmentedCodeCache with a warning.
*/
INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.NonNMethod), USE_INT_MODE),
INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.All), USE_INT_MODE),
/**
* Verifies that with disabled SegmentedCodeCache PrintCodeCache output
* contains only CodeCache's entry.
@ -87,11 +87,11 @@ public class CodeCacheCLITestCase {
false)),
/**
* Verifies that with TieredStopAtLevel=0 PrintCodeCache output will
* contain information about non-nmethods and non-profiled nmethods
* warn about SegmentedCodeCache and contain information about all
* heaps only.
*/
TIERED_LEVEL_0(SEGMENTED_SERVER,
EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled),
EnumSet.of(BlobType.All),
CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION,
true),
CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 0)),