Path: blob/master/test/hotspot/jtreg/compiler/compilercontrol/share/scenario/Command.java
41161 views
/*1* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package compiler.compilercontrol.share.scenario;2425import compiler.compilercontrol.share.processors.LogProcessor;2627import java.util.Arrays;2829/**30* Represents a CompileCommand command set31*/32public enum Command {33COMPILEONLY("compileonly", ".*", "-Xbatch"),34EXCLUDE("exclude", "", "-Xbatch"),35INLINE("inline", ".*", "-Xbatch", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:InlineSmallCode=4000"),36DONTINLINE("dontinline", "", "-Xbatch", "-XX:+IgnoreUnrecognizedVMOptions", "-XX:InlineSmallCode=4000"),37LOG("log", "", "-XX:+UnlockDiagnosticVMOptions",38"-XX:+LogCompilation", "-XX:LogFile=" + LogProcessor.LOG_FILE),39PRINT("print", ""),40QUIET("quiet", ""),41INTRINSIC("ControlIntrinsic", ""),42NONEXISTENT("nonexistent", ""); // wrong command for a negative case4344/**45* Command name46*/47public final String name;4849/**50* Base regular expression51*/52public final String regex;5354/**55* Additional VM options for this command56*/57public final String[] vmOpts;5859private Command(String name, String regex, String... vmOptions) {60this.name = name;61this.regex = regex;62String[] wbOpts = new String[] { "-Xbootclasspath/a:.",63"-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI" };64int length = (vmOptions != null) ? vmOptions.length : 0;65this.vmOpts = Arrays.copyOf(wbOpts, wbOpts.length + length);66if (vmOptions != null) {67System.arraycopy(vmOptions, 0, vmOpts, wbOpts.length, length);68}69}70}717273