3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 import jdk.test.lib.ExitCode;
24 import jdk.test.lib.Platform;
25 import jdk.test.lib.cli.CommandLineOptionTest;
26 import common.CodeCacheOptions;
27 import sun.hotspot.code.BlobType;
28
29 /**
30 * @test
31 * @bug 8015774
32 * @summary Verify SegmentedCodeCache option's processing
33 * @library /testlibrary /test/lib
34 * @modules java.base/jdk.internal.misc
35 * java.compiler
36 * java.management
37 * jdk.jvmstat/sun.jvmstat.monitor
38 * @build TestSegmentedCodeCacheOption jdk.test.lib.*
39 * @run main TestSegmentedCodeCacheOption
40 */
41 public class TestSegmentedCodeCacheOption {
42 private static final String INT_MODE = "-Xint";
43 private static final String TIERED_COMPILATION = "TieredCompilation";
44 private static final String SEGMENTED_CODE_CACHE = "SegmentedCodeCache";
45 private static final String USE_SEGMENTED_CODE_CACHE
46 = CommandLineOptionTest.prepareBooleanFlag(SEGMENTED_CODE_CACHE,
47 true);
48 private static final long THRESHOLD_CC_SIZE_VALUE
49 = CodeCacheOptions.mB(240);
50 private static final long BELOW_THRESHOLD_CC_SIZE
51 = THRESHOLD_CC_SIZE_VALUE - CodeCacheOptions.mB(1);
52 private static final String[] UNEXPECTED_MESSAGES = new String[] {
53 ".*" + SEGMENTED_CODE_CACHE + ".*"
54 };
55
56
57 private static enum TestCase {
58 JVM_STARTUP {
59 @Override
60 public void run() throws Throwable {
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8015774
27 * @summary Verify SegmentedCodeCache option's processing
28 * @library /testlibrary /test/lib /
29 * @modules java.base/jdk.internal.misc
30 * java.compiler
31 * java.management
32 * jdk.jvmstat/sun.jvmstat.monitor
33 *
34 * @build jdk.test.lib.*
35 * @run driver compiler.codecache.cli.TestSegmentedCodeCacheOption
36 */
37
38 package compiler.codecache.cli;
39
40 import compiler.codecache.cli.common.CodeCacheOptions;
41 import jdk.test.lib.ExitCode;
42 import jdk.test.lib.Platform;
43 import jdk.test.lib.cli.CommandLineOptionTest;
44 import sun.hotspot.code.BlobType;
45
46 public class TestSegmentedCodeCacheOption {
47 private static final String INT_MODE = "-Xint";
48 private static final String TIERED_COMPILATION = "TieredCompilation";
49 private static final String SEGMENTED_CODE_CACHE = "SegmentedCodeCache";
50 private static final String USE_SEGMENTED_CODE_CACHE
51 = CommandLineOptionTest.prepareBooleanFlag(SEGMENTED_CODE_CACHE,
52 true);
53 private static final long THRESHOLD_CC_SIZE_VALUE
54 = CodeCacheOptions.mB(240);
55 private static final long BELOW_THRESHOLD_CC_SIZE
56 = THRESHOLD_CC_SIZE_VALUE - CodeCacheOptions.mB(1);
57 private static final String[] UNEXPECTED_MESSAGES = new String[] {
58 ".*" + SEGMENTED_CODE_CACHE + ".*"
59 };
60
61
62 private static enum TestCase {
63 JVM_STARTUP {
64 @Override
65 public void run() throws Throwable {
|