Skip to content

Commit 444f829

Browse files
Evgeny AstigeevichTheRealMDoerr
Evgeny Astigeevich
authored andcommitted
8276711: compiler/codecache/cli tests failing when SegmentedCodeCache used with -Xint
Backport-of: 7822cbce10e0c0c6f9bf521faebc89a0af20734e
1 parent 45b6bca commit 444f829

File tree

5 files changed

+19
-26
lines changed

5 files changed

+19
-26
lines changed

src/hotspot/share/code/codeCache.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ bool CodeCache::heap_available(int code_blob_type) {
354354
if (!SegmentedCodeCache) {
355355
// No segmentation: use a single code heap
356356
return (code_blob_type == CodeBlobType::All);
357-
} else if (Arguments::is_interpreter_only()) {
357+
} else if (CompilerConfig::is_interpreter_only()) {
358358
// Interpreter only: we don't need any method code heaps
359359
return (code_blob_type == CodeBlobType::NonNMethod);
360360
} else if (CompilerConfig::is_c1_profiling()) {

src/hotspot/share/compiler/compilerDefinitions.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -316,7 +316,6 @@ void CompilerConfig::set_compilation_policy_flags() {
316316
}
317317
}
318318

319-
320319
if (CompileThresholdScaling < 0) {
321320
vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL);
322321
}
@@ -523,6 +522,10 @@ bool CompilerConfig::check_args_consistency(bool status) {
523522
}
524523
FLAG_SET_CMDLINE(TieredCompilation, false);
525524
}
525+
if (SegmentedCodeCache) {
526+
warning("SegmentedCodeCache has no meaningful effect with -Xint");
527+
FLAG_SET_DEFAULT(SegmentedCodeCache, false);
528+
}
526529
#if INCLUDE_JVMCI
527530
if (EnableJVMCI) {
528531
if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) {

test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,9 @@ public class TestSegmentedCodeCacheOption {
5656
private static final String[] UNEXPECTED_MESSAGES = new String[] {
5757
".*" + SEGMENTED_CODE_CACHE + ".*"
5858
};
59+
private static final String[] XINT_EXPECTED_MESSAGE = new String[] {
60+
"SegmentedCodeCache has no meaningful effect with -Xint"
61+
};
5962

6063

6164
private static enum TestCase {
@@ -86,10 +89,11 @@ public void run() throws Throwable {
8689
// ... and even w/ Xint.
8790
testCaseExitCodeMessage = "It should be possible to use "
8891
+ USE_SEGMENTED_CODE_CACHE + " in interpreted mode "
89-
+ "without any errors.";
92+
+ "but it produces a warning that it is ignored.";
9093

9194
CommandLineOptionTest.verifyJVMStartup(
92-
/* expected messages */ null, UNEXPECTED_MESSAGES,
95+
XINT_EXPECTED_MESSAGE,
96+
/* unexpected messages */ null,
9397
testCaseExitCodeMessage, testCaseWarningMessage,
9498
ExitCode.OK, false, INT_MODE, USE_SEGMENTED_CODE_CACHE);
9599
}
@@ -117,14 +121,6 @@ public void run() throws Throwable {
117121
CommandLineOptionTest.prepareNumericFlag(
118122
BlobType.All.sizeOptionName,
119123
BELOW_THRESHOLD_CC_SIZE));
120-
// SCC could be explicitly enabled w/ Xint
121-
errorMessage = String.format("It should be possible to "
122-
+ "explicitly enable %s in interpreted mode.",
123-
SEGMENTED_CODE_CACHE);
124-
125-
CommandLineOptionTest.verifyOptionValue(SEGMENTED_CODE_CACHE,
126-
"true", errorMessage, false, INT_MODE,
127-
USE_SEGMENTED_CODE_CACHE);
128124
// SCC could be explicitly enabled w/o TieredCompilation and w/
129125
// small ReservedCodeCacheSize value
130126
errorMessage = String.format("It should be possible to "

test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -63,15 +63,9 @@ public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase {
6363

6464
private TestCodeHeapSizeOptions() {
6565
super(CodeCacheCLITestBase.OPTIONS_SET,
66-
new CodeCacheCLITestCase(CodeCacheCLITestCase
67-
.CommonDescriptions.INT_MODE.description,
68-
GENERIC_RUNNER),
6966
new CodeCacheCLITestCase(CodeCacheCLITestCase
7067
.CommonDescriptions.NON_TIERED.description,
7168
GENERIC_RUNNER),
72-
new CodeCacheCLITestCase(CodeCacheCLITestCase
73-
.CommonDescriptions.TIERED_LEVEL_0.description,
74-
GENERIC_RUNNER),
7569
new CodeCacheCLITestCase(CodeCacheCLITestCase
7670
.CommonDescriptions.TIERED_LEVEL_1.description,
7771
GENERIC_RUNNER),

test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -66,9 +66,9 @@ public final void run(CodeCacheOptions options) throws Throwable {
6666
public enum CommonDescriptions {
6767
/**
6868
* Verifies that in interpreted mode PrintCodeCache output contains
69-
* only NonNMethod code heap.
69+
* the whole code cache. Int mode disables SegmentedCodeCache with a warning.
7070
*/
71-
INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.NonNMethod), USE_INT_MODE),
71+
INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.All), USE_INT_MODE),
7272
/**
7373
* Verifies that with disabled SegmentedCodeCache PrintCodeCache output
7474
* contains only CodeCache's entry.
@@ -87,11 +87,11 @@ public enum CommonDescriptions {
8787
false)),
8888
/**
8989
* Verifies that with TieredStopAtLevel=0 PrintCodeCache output will
90-
* contain information about non-nmethods and non-profiled nmethods
90+
* warn about SegmentedCodeCache and contain information about all
9191
* heaps only.
9292
*/
9393
TIERED_LEVEL_0(SEGMENTED_SERVER,
94-
EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled),
94+
EnumSet.of(BlobType.All),
9595
CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION,
9696
true),
9797
CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 0)),

0 commit comments

Comments
 (0)