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 com.oracle.java.testlibrary.ExitCode; 24 import com.oracle.java.testlibrary.Platform; 25 import com.oracle.java.testlibrary.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/sun.misc 35 * java.compiler 36 * java.management 37 * jdk.jvmstat/sun.jvmstat.monitor 38 * @build TestSegmentedCodeCacheOption com.oracle.java.testlibrary.* 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 { | 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/sun.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 { |