author | gtriantafill |
Thu, 19 Jan 2017 10:56:32 -0500 | |
changeset 43467 | f91da24c6bca |
parent 40631 | ed82623d7831 |
permissions | -rw-r--r-- |
28390
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
1 |
/* |
43467 | 2 |
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
28390
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
4 |
* |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
8 |
* |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
13 |
* accompanied this code). |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
14 |
* |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
18 |
* |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
21 |
* questions. |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
22 |
*/ |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
23 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
24 |
/** |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
25 |
* @test |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
26 |
* @bug 8015774 |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
27 |
* @summary Verify SegmentedCodeCache option's processing |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
40059
diff
changeset
|
28 |
* @library /test/lib / |
36851 | 29 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28390
diff
changeset
|
30 |
* java.compiler |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28390
diff
changeset
|
31 |
* java.management |
43467 | 32 |
* jdk.internal.jvmstat/sun.jvmstat.monitor |
40059 | 33 |
* |
34 |
* @run driver compiler.codecache.cli.TestSegmentedCodeCacheOption |
|
28390
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
35 |
*/ |
40059 | 36 |
|
37 |
package compiler.codecache.cli; |
|
38 |
||
39 |
import compiler.codecache.cli.common.CodeCacheOptions; |
|
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
40059
diff
changeset
|
40 |
import jdk.test.lib.process.ExitCode; |
40059 | 41 |
import jdk.test.lib.Platform; |
42 |
import jdk.test.lib.cli.CommandLineOptionTest; |
|
43 |
import sun.hotspot.code.BlobType; |
|
44 |
||
28390
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
45 |
public class TestSegmentedCodeCacheOption { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
46 |
private static final String INT_MODE = "-Xint"; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
47 |
private static final String TIERED_COMPILATION = "TieredCompilation"; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
48 |
private static final String SEGMENTED_CODE_CACHE = "SegmentedCodeCache"; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
49 |
private static final String USE_SEGMENTED_CODE_CACHE |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
50 |
= CommandLineOptionTest.prepareBooleanFlag(SEGMENTED_CODE_CACHE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
51 |
true); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
52 |
private static final long THRESHOLD_CC_SIZE_VALUE |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
53 |
= CodeCacheOptions.mB(240); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
54 |
private static final long BELOW_THRESHOLD_CC_SIZE |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
55 |
= THRESHOLD_CC_SIZE_VALUE - CodeCacheOptions.mB(1); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
56 |
private static final String[] UNEXPECTED_MESSAGES = new String[] { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
57 |
".*" + SEGMENTED_CODE_CACHE + ".*" |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
58 |
}; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
59 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
60 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
61 |
private static enum TestCase { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
62 |
JVM_STARTUP { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
63 |
@Override |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
64 |
public void run() throws Throwable { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
65 |
// There should be no errors when we're trying to enable SCC ... |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
66 |
String testCaseWarningMessage = "JVM output should not contain " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
67 |
+ "any warnings related to " + SEGMENTED_CODE_CACHE; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
68 |
String testCaseExitCodeMessage = "JVM should start without any " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
69 |
+ "issues with " + USE_SEGMENTED_CODE_CACHE; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
70 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
71 |
CommandLineOptionTest.verifySameJVMStartup( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
72 |
/* expectedMessages */ null, UNEXPECTED_MESSAGES, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
73 |
testCaseExitCodeMessage, testCaseWarningMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
74 |
ExitCode.OK, USE_SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
75 |
// ... and when we're trying to enable it w/o TieredCompilation |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
76 |
testCaseExitCodeMessage = "Disabled tiered compilation should " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
77 |
+ "not cause startup failure w/ " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
78 |
+ USE_SEGMENTED_CODE_CACHE; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
79 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
80 |
CommandLineOptionTest.verifySameJVMStartup( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
81 |
/* expectedMessages */ null, UNEXPECTED_MESSAGES, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
82 |
testCaseExitCodeMessage, testCaseWarningMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
83 |
ExitCode.OK, USE_SEGMENTED_CODE_CACHE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
84 |
CommandLineOptionTest.prepareBooleanFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
85 |
TIERED_COMPILATION, false)); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
86 |
// ... and even w/ Xint. |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
87 |
testCaseExitCodeMessage = "It should be possible to use " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
88 |
+ USE_SEGMENTED_CODE_CACHE + " in interpreted mode " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
89 |
+ "without any errors."; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
90 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
91 |
CommandLineOptionTest.verifyJVMStartup( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
92 |
/* expected messages */ null, UNEXPECTED_MESSAGES, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
93 |
testCaseExitCodeMessage, testCaseWarningMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
94 |
ExitCode.OK, false, INT_MODE, USE_SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
95 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
96 |
}, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
97 |
OPTION_VALUES_GENERIC { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
98 |
@Override |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
99 |
public void run() throws Throwable { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
100 |
// SCC is disabled w/o TieredCompilation by default |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
101 |
String errorMessage = SEGMENTED_CODE_CACHE |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
102 |
+ " should be disabled by default when tiered " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
103 |
+ "compilation is disabled"; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
104 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
105 |
CommandLineOptionTest.verifyOptionValueForSameVM( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
106 |
SEGMENTED_CODE_CACHE, "false", errorMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
107 |
CommandLineOptionTest.prepareBooleanFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
108 |
TIERED_COMPILATION, false)); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
109 |
// SCC is disabled by default when ReservedCodeCacheSize is too |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
110 |
// small |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
111 |
errorMessage = String.format("%s should be disabled bu default " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
112 |
+ "when %s value is too small.", SEGMENTED_CODE_CACHE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
113 |
BlobType.All.sizeOptionName); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
114 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
115 |
CommandLineOptionTest.verifyOptionValueForSameVM( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
116 |
SEGMENTED_CODE_CACHE, "false", errorMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
117 |
CommandLineOptionTest.prepareNumericFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
118 |
BlobType.All.sizeOptionName, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
119 |
BELOW_THRESHOLD_CC_SIZE)); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
120 |
// SCC could be explicitly enabled w/ Xint |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
121 |
errorMessage = String.format("It should be possible to " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
122 |
+ "explicitly enable %s in interpreted mode.", |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
123 |
SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
124 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
125 |
CommandLineOptionTest.verifyOptionValue(SEGMENTED_CODE_CACHE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
126 |
"true", errorMessage, false, INT_MODE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
127 |
USE_SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
128 |
// SCC could be explicitly enabled w/o TieredCompilation and w/ |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
129 |
// small ReservedCodeCacheSize value |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
130 |
errorMessage = String.format("It should be possible to " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
131 |
+ "explicitly enable %s with small %s and " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
132 |
+ "disabled tiered comp.", SEGMENTED_CODE_CACHE, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
133 |
BlobType.All.sizeOptionName); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
134 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
135 |
CommandLineOptionTest.verifyOptionValueForSameVM( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
136 |
SEGMENTED_CODE_CACHE, "true", errorMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
137 |
CommandLineOptionTest.prepareBooleanFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
138 |
TIERED_COMPILATION, false), |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
139 |
CommandLineOptionTest.prepareNumericFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
140 |
BlobType.All.sizeOptionName, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
141 |
BELOW_THRESHOLD_CC_SIZE), |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
142 |
USE_SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
143 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
144 |
}, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
145 |
OPTION_VALUES_SERVER_SPECIFIC { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
146 |
@Override |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
147 |
public boolean isApplicable() { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
148 |
return Platform.isServer() && Platform.isTieredSupported(); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
149 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
150 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
151 |
@Override |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
152 |
public void run() throws Throwable { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
153 |
// SCC is enabled by default when TieredCompilation is on and |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
154 |
// ReservedCodeCacheSize is large enough |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
155 |
String errorMessage = String.format("Large enough %s and " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
156 |
+ "enabled tiered compilation should enable %s " |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
157 |
+ "by default.", BlobType.All.sizeOptionName, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
158 |
SEGMENTED_CODE_CACHE); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
159 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
160 |
CommandLineOptionTest.verifyOptionValueForSameVM( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
161 |
SEGMENTED_CODE_CACHE, "true", errorMessage, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
162 |
CommandLineOptionTest.prepareNumericFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
163 |
BlobType.All.sizeOptionName, |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
164 |
THRESHOLD_CC_SIZE_VALUE), |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
165 |
CommandLineOptionTest.prepareBooleanFlag( |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
166 |
TIERED_COMPILATION, true)); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
167 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
168 |
}; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
169 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
170 |
TestCase() { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
171 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
172 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
173 |
public boolean isApplicable() { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
174 |
return true; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
175 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
176 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
177 |
public abstract void run() throws Throwable; |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
178 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
179 |
|
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
180 |
public static void main(String args[]) throws Throwable { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
181 |
for (TestCase testCase : TestCase.values()) { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
182 |
if (testCase.isApplicable()) { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
183 |
System.out.println("Running test case: " + testCase.name()); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
184 |
testCase.run(); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
185 |
} else { |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
186 |
System.out.println("Test case skipped: " + testCase.name()); |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
187 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
188 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
189 |
} |
263a69157012
8059623: JEP-JDK-8043304: Test task: command line options tests
fzhinkin
parents:
diff
changeset
|
190 |
} |