< prev index next >

test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java

Print this page
rev 13291 : 8184800: Streamline RTM flag validity testing with generic flag testing support
Reviewed-by: kvn, lucy
   1 /*
   2  * Copyright (c) 2014, 2016, 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 package compiler.rtm.cli;
  25 
  26 import jdk.test.lib.process.ExitCode;
  27 import jdk.test.lib.Platform;
  28 import jdk.test.lib.cli.CommandLineOptionTest;
  29 
  30 import java.util.function.BooleanSupplier;
  31 
  32 /**
  33  * Base for all RTM-related CLI tests.
  34  */
  35 public abstract class RTMGenericCommandLineOptionTest {
  36 
  37     protected static final String RTM_INSTR_ERROR
  38             = "RTM instructions are not available on this CPU";
  39     protected static final String RTM_UNSUPPORTED_VM_ERROR
  40             = "RTM locking optimization is not supported in this VM";
  41     protected static final String RTM_ABORT_RATIO_WARNING
  42             = "RTMAbortRatio must be in the range 0 to 100, resetting it to 50";
  43     protected static final String RTM_FOR_STACK_LOCKS_WARNING
  44             = "UseRTMForStackLocks flag should be off when UseRTMLocking "
  45             + "flag is off";
  46     protected static final String RTM_COUNT_INCR_WARNING
  47             = "RTMTotalCountIncrRate must be a power of 2, resetting it to 64";
  48     protected static final String RTM_BIASED_LOCKING_WARNING
  49             = "Biased locking is not supported with RTM locking; "
  50             + "ignoring UseBiasedLocking flag";
  51 
  52     protected final String optionName;
  53     protected final String errorMessage;
  54     protected final String experimentalOptionError;
  55     protected final boolean isExperimental;
  56     protected final boolean isBoolean;
  57     protected final String defaultValue;
  58     protected final String[] optionValues;
  59 
  60     /**
  61      * Constructs new genetic RTM CLI test, for option {@code optionName} which
  62      * has default value {@code defaultValue}. Test cases will use option's
  63      * values passed via {@code optionValues} for verification of correct
  64      * option processing.
  65      *
  66      * Test constructed using this ctor will be started on any cpu regardless
  67      * it's architecture and supported/unsupported features.


   1 /*
   2  * Copyright (c) 2014, 2017, 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 package compiler.rtm.cli;
  25 
  26 import jdk.test.lib.process.ExitCode;
  27 import jdk.test.lib.Platform;
  28 import jdk.test.lib.cli.CommandLineOptionTest;
  29 
  30 import java.util.function.BooleanSupplier;
  31 
  32 /**
  33  * Base for all RTM-related CLI tests.
  34  */
  35 public abstract class RTMGenericCommandLineOptionTest {
  36 
  37     protected static final String RTM_INSTR_ERROR
  38             = "RTM instructions are not available on this CPU";
  39     protected static final String RTM_UNSUPPORTED_VM_ERROR
  40             = "RTM locking optimization is not supported in this VM";


  41     protected static final String RTM_FOR_STACK_LOCKS_WARNING
  42             = "UseRTMForStackLocks flag should be off when UseRTMLocking "
  43             + "flag is off";
  44     protected static final String RTM_COUNT_INCR_WARNING
  45             = "must be a power of 2, resetting it to 64";
  46     protected static final String RTM_BIASED_LOCKING_WARNING
  47             = "Biased locking is not supported with RTM locking; "
  48             + "ignoring UseBiasedLocking flag";
  49 
  50     protected final String optionName;
  51     protected final String errorMessage;
  52     protected final String experimentalOptionError;
  53     protected final boolean isExperimental;
  54     protected final boolean isBoolean;
  55     protected final String defaultValue;
  56     protected final String[] optionValues;
  57 
  58     /**
  59      * Constructs new genetic RTM CLI test, for option {@code optionName} which
  60      * has default value {@code defaultValue}. Test cases will use option's
  61      * values passed via {@code optionValues} for verification of correct
  62      * option processing.
  63      *
  64      * Test constructed using this ctor will be started on any cpu regardless
  65      * it's architecture and supported/unsupported features.


< prev index next >