1 /* 2 * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. 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 * @key randomness 27 * @bug 8015774 28 * @summary Verify processing of options related to code heaps sizing. 29 * @library /test/lib / 30 * @requires vm.flagless 31 * @modules java.base/jdk.internal.misc 32 * java.compiler 33 * java.management 34 * jdk.internal.jvmstat/sun.jvmstat.monitor 35 * 36 * @run driver/timeout=240 compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions 37 */ 38 39 package compiler.codecache.cli.codeheapsize; 40 41 import compiler.codecache.cli.common.CodeCacheCLITestBase; 42 import compiler.codecache.cli.common.CodeCacheCLITestCase; 43 import jdk.test.lib.Platform; 44 import sun.hotspot.code.BlobType; 45 46 import java.util.EnumSet; 47 48 public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase { 49 private static final CodeCacheCLITestCase JVM_STARTUP 50 = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( 51 options -> options.segmented, 52 EnumSet.noneOf(BlobType.class)), 53 new JVMStartupRunner()); 54 55 private static final CodeCacheCLITestCase CODE_CACHE_FREE_SPACE 56 = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( 57 options -> options.segmented 58 && Platform.isDebugBuild(), 59 EnumSet.noneOf(BlobType.class)), 60 new CodeCacheFreeSpaceRunner()); 61 62 private static final GenericCodeHeapSizeRunner GENERIC_RUNNER 63 = new GenericCodeHeapSizeRunner(); 64 65 private TestCodeHeapSizeOptions() { 66 super(CodeCacheCLITestBase.OPTIONS_SET, 67 new CodeCacheCLITestCase(CodeCacheCLITestCase 68 .CommonDescriptions.INT_MODE.description, 69 GENERIC_RUNNER), 70 new CodeCacheCLITestCase(CodeCacheCLITestCase 71 .CommonDescriptions.NON_TIERED.description, 72 GENERIC_RUNNER), 73 new CodeCacheCLITestCase(CodeCacheCLITestCase 74 .CommonDescriptions.TIERED_LEVEL_0.description, 75 GENERIC_RUNNER), 76 new CodeCacheCLITestCase(CodeCacheCLITestCase 77 .CommonDescriptions.TIERED_LEVEL_1.description, 78 GENERIC_RUNNER), 79 new CodeCacheCLITestCase(CodeCacheCLITestCase 80 .CommonDescriptions.TIERED_LEVEL_4.description, 81 GENERIC_RUNNER), 82 JVM_STARTUP, 83 CODE_CACHE_FREE_SPACE); 84 } 85 86 public static void main(String args[]) throws Throwable { 87 new TestCodeHeapSizeOptions().runTestCases(); 88 } 89 }