< prev index next >

test/compiler/arguments/CheckCompileThresholdScaling.java

Print this page


   1 /*
   2  * Copyright (c) 2014, 2015, 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  */


 327             "double CompileThresholdScaling                  := 0.000000                            {product}",
 328             "interpreted mode"
 329         }
 330     };
 331 
 332     private static void verifyValidOption(String[] arguments, String[] expected_outputs, boolean tiered) throws Exception {
 333         ProcessBuilder pb;
 334         OutputAnalyzer out;
 335 
 336         pb = ProcessTools.createJavaProcessBuilder(arguments);
 337         out = new OutputAnalyzer(pb.start());
 338 
 339         try {
 340             for (String expected_output : expected_outputs) {
 341                 out.shouldContain(expected_output);
 342             }
 343             out.shouldHaveExitValue(0);
 344         } catch (RuntimeException e) {
 345             // Check if tiered compilation is available in this JVM
 346             // Version. Throw exception only if it is available.
 347             if (!(tiered && out.getOutput().contains("TieredCompilation is disabled in this release."))) {
 348                 throw new RuntimeException(e);
 349             }
 350         }
 351     }
 352 
 353     public static void main(String[] args) throws Exception {
 354 
 355         if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length) {
 356             throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in non-tiered mode of operation does not match.");
 357         }
 358 
 359         if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length) {
 360             throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in tiered mode of operation.");
 361         }
 362 
 363         // Check if thresholds are scaled properly in non-tiered mode of operation
 364         for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
 365             verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], false);
 366         }
 367 
   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  */


 327             "double CompileThresholdScaling                  := 0.000000                            {product}",
 328             "interpreted mode"
 329         }
 330     };
 331 
 332     private static void verifyValidOption(String[] arguments, String[] expected_outputs, boolean tiered) throws Exception {
 333         ProcessBuilder pb;
 334         OutputAnalyzer out;
 335 
 336         pb = ProcessTools.createJavaProcessBuilder(arguments);
 337         out = new OutputAnalyzer(pb.start());
 338 
 339         try {
 340             for (String expected_output : expected_outputs) {
 341                 out.shouldContain(expected_output);
 342             }
 343             out.shouldHaveExitValue(0);
 344         } catch (RuntimeException e) {
 345             // Check if tiered compilation is available in this JVM
 346             // Version. Throw exception only if it is available.
 347             if (!(tiered && out.getOutput().contains("-XX:+TieredCompilation not supported in this VM"))) {
 348                 throw new RuntimeException(e);
 349             }
 350         }
 351     }
 352 
 353     public static void main(String[] args) throws Exception {
 354 
 355         if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length) {
 356             throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in non-tiered mode of operation does not match.");
 357         }
 358 
 359         if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length) {
 360             throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in tiered mode of operation.");
 361         }
 362 
 363         // Check if thresholds are scaled properly in non-tiered mode of operation
 364         for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
 365             verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], false);
 366         }
 367 
< prev index next >