hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp
author shade
Fri, 04 Mar 2016 01:30:11 +0300
changeset 36554 a7eb9ee4680c
parent 35751 6a057f120b11
child 38220 8d86b82e0ac7
permissions -rw-r--r--
8146801: Allocating short arrays of non-constant size is slow Reviewed-by: kvn, twisti, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     1
/*
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     4
 *
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     7
 * published by the Free Software Foundation.
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     8
 *
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    13
 * accompanied this code).
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    14
 *
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    18
 *
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    21
 * questions.
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    22
 *
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    23
 */
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    24
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    25
#include "precompiled.hpp"
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    26
#include "oops/metadata.hpp"
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    27
#include "runtime/os.hpp"
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    28
#include "code/relocInfo.hpp"
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    29
#include "interpreter/invocationCounter.hpp"
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    30
#include "runtime/arguments.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    31
#include "runtime/commandLineFlagConstraintsCompiler.hpp"
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    32
#include "runtime/commandLineFlagRangeList.hpp"
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    33
#include "runtime/globals.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    34
#include "utilities/defaultStream.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    35
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    36
Flag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
    37
  if ((value <= 1) && (Arguments::mode() == Arguments::_comp || Arguments::mode() == Arguments::_mixed)) {
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    38
    CommandLineError::print(verbose,
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    39
                            "AliasLevel (" INTX_FORMAT ") is not "
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
    40
                            "compatible with -Xcomp or -Xmixed\n",
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    41
                            value);
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    42
    return Flag::VIOLATES_CONSTRAINT;
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    43
  } else {
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    44
    return Flag::SUCCESS;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    45
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    46
}
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    47
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    48
/**
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    49
 * Validate the minimum number of compiler threads needed to run the
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    50
 * JVM. The following configurations are possible.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    51
 *
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    52
 * 1) The JVM is build using an interpreter only. As a result, the minimum number of
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    53
 *    compiler threads is 0.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    54
 * 2) The JVM is build using the compiler(s) and tiered compilation is disabled. As
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    55
 *    a result, either C1 or C2 is used, so the minimum number of compiler threads is 1.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    56
 * 3) The JVM is build using the compiler(s) and tiered compilation is enabled. However,
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    57
 *    the option "TieredStopAtLevel < CompLevel_full_optimization". As a result, only
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    58
 *    C1 can be used, so the minimum number of compiler threads is 1.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    59
 * 4) The JVM is build using the compilers and tiered compilation is enabled. The option
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    60
 *    'TieredStopAtLevel = CompLevel_full_optimization' (the default value). As a result,
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    61
 *    the minimum number of compiler threads is 2.
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    62
 */
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    63
Flag::Error CICompilerCountConstraintFunc(intx value, bool verbose) {
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    64
  int min_number_of_compiler_threads = 0;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 32351
diff changeset
    65
#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK) && !INCLUDE_JVMCI
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    66
  // case 1
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    67
#else
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    68
  if (!TieredCompilation || (TieredStopAtLevel < CompLevel_full_optimization)) {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    69
    min_number_of_compiler_threads = 1; // case 2 or case 3
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    70
  } else {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    71
    min_number_of_compiler_threads = 2;   // case 4 (tiered)
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    72
  }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    73
#endif
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    74
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    75
  // The default CICompilerCount's value is CI_COMPILER_COUNT.
32083
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    76
  // With a client VM, -XX:+TieredCompilation causes TieredCompilation
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    77
  // to be true here (the option is validated later) and
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    78
  // min_number_of_compiler_threads to exceed CI_COMPILER_COUNT.
1796911eb140 8132525: java -client -XX:+TieredCompilation -XX:CICompilerCount=1 -version asserts since 8130858
roland
parents: 31959
diff changeset
    79
  min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    80
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    81
  if (value < (intx)min_number_of_compiler_threads) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    82
    CommandLineError::print(verbose,
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    83
                            "CICompilerCount (" INTX_FORMAT ") must be "
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    84
                            "at least %d \n",
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 32087
diff changeset
    85
                            value, min_number_of_compiler_threads);
31959
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    86
    return Flag::VIOLATES_CONSTRAINT;
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    87
  } else {
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    88
    return Flag::SUCCESS;
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    89
  }
34180370555e 8130858: CICompilerCount=1 when tiered is off is not allowed any more
roland
parents: 31371
diff changeset
    90
}
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    91
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    92
Flag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    93
  if (value < 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    94
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    95
                            "Unable to determine system-specific value for AllocatePrefetchDistance. "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    96
                            "Please provide appropriate value, if unsure, use 0 to disable prefetching\n");
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    97
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    98
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
    99
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   100
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   101
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   102
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   103
Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   104
  intx max_value = max_intx;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   105
#if defined(SPARC)
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   106
  max_value = 1;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   107
#elif defined(X86)
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   108
  max_value = 3;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   109
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   110
  if (value < 0 || value > max_value) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   111
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   112
                            "AllocatePrefetchInstr (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   113
                            "between 0 and " INTX_FORMAT "\n", value, max_value);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   114
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   115
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   116
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   117
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   118
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   119
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   120
Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
35751
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   121
  intx max_value = 512;
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   122
  if (value < 1 || value > max_value) {
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   123
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   124
                            "AllocatePrefetchStepSize (" INTX_FORMAT ") "
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   125
                            "must be between 1 and %d\n",
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   126
                            AllocatePrefetchStepSize,
35751
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   127
                            max_value);
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   128
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   129
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   130
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   131
  if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) {
35751
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   132
    CommandLineError::print(verbose,
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   133
                            "AllocatePrefetchDistance (" INTX_FORMAT ") "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   134
                            "%% AllocatePrefetchStepSize (" INTX_FORMAT ") "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   135
                            "= " INTX_FORMAT " "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   136
                            "must be 0\n",
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   137
                            AllocatePrefetchDistance, AllocatePrefetchStepSize,
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   138
                            AllocatePrefetchDistance % AllocatePrefetchStepSize);
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   139
    return Flag::VIOLATES_CONSTRAINT;
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   140
  }
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   141
35751
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   142
  /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   143
   * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines.
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   144
   * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation()
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   145
   * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle,
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   146
   * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   147
   * quantities must have the same limit (64 in this case).
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   148
   */
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   149
  if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) {
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   150
    CommandLineError::print(verbose,
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   151
                            "AllocatePrefetchDistance (" INTX_FORMAT ") too large or "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   152
                            "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   153
                            "try decreasing/increasing values so that "
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   154
                            "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n",
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   155
                            AllocatePrefetchDistance, AllocatePrefetchStepSize,
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   156
                            AllocatePrefetchDistance % AllocatePrefetchStepSize);
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   157
    return Flag::VIOLATES_CONSTRAINT;
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   158
  }
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   159
6a057f120b11 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823
zmajo
parents: 33744
diff changeset
   160
  return Flag::SUCCESS;
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   161
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   162
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   163
Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   164
  if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   165
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   166
                            "CompileThreshold (" INTX_FORMAT ") "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   167
                            "must be between 0 and %d\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   168
                            value,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   169
                            INT_MAX >> InvocationCounter::count_shift);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   170
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   171
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   172
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   173
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   174
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   175
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   176
Flag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   177
  int backward_branch_limit;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   178
  if (ProfileInterpreter) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   179
    if (OnStackReplacePercentage < InterpreterProfilePercentage) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   180
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   181
                              "OnStackReplacePercentage (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   182
                              "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   183
                              OnStackReplacePercentage, InterpreterProfilePercentage);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   184
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   185
    }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   186
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   187
    backward_branch_limit = ((CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100)
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   188
                            << InvocationCounter::count_shift;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   189
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   190
    if (backward_branch_limit < 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   191
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   192
                              "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   193
                              INTX_FORMAT " "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   194
                              "must be between 0 and " INTX_FORMAT ", try changing "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   195
                              "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   196
                              (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   197
                              INT_MAX >> InvocationCounter::count_shift);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   198
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   199
    }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   200
  } else {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   201
    if (OnStackReplacePercentage < 0 ) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   202
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   203
                              "OnStackReplacePercentage (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   204
                              "non-negative\n", OnStackReplacePercentage);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   205
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   206
    }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   207
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   208
    backward_branch_limit = ((CompileThreshold * OnStackReplacePercentage) / 100)
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   209
                            << InvocationCounter::count_shift;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   210
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   211
    if (backward_branch_limit < 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   212
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   213
                              "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   214
                              "must be between 0 and " INTX_FORMAT ", try changing "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   215
                              "CompileThreshold and/or OnStackReplacePercentage\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   216
                              (CompileThreshold * OnStackReplacePercentage) / 100,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   217
                              INT_MAX >> InvocationCounter::count_shift);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   218
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   219
    }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   220
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   221
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   222
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   223
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   224
Flag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   225
  if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   226
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   227
                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   228
                            "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   229
                            "to align entry points\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   230
                            CodeCacheSegmentSize, CodeEntryAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   231
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   232
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   233
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   234
  if (CodeCacheSegmentSize < sizeof(jdouble)) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   235
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   236
                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   237
                            "at least " SIZE_FORMAT " to align constants\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   238
                            CodeCacheSegmentSize, sizeof(jdouble));
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   239
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   240
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   241
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   242
#ifdef COMPILER2
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   243
  if (CodeCacheSegmentSize < (uintx)OptoLoopAlignment) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   244
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   245
                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   246
                            "larger than or equal to OptoLoopAlignment (" INTX_FORMAT ") "
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   247
                            "to align inner loops\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   248
                            CodeCacheSegmentSize, OptoLoopAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   249
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   250
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   251
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   252
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   253
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   254
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   255
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   256
Flag::Error CompilerThreadPriorityConstraintFunc(intx value, bool verbose) {
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   257
#ifdef SOLARIS
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   258
  if ((value < MinimumPriority || value > MaximumPriority) &&
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   259
      (value != -1) && (value != -FXCriticalPriority)) {
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   260
    CommandLineError::print(verbose,
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   261
                            "CompileThreadPriority (" INTX_FORMAT ") must be "
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   262
                            "between %d and %d inclusively or -1 (means no change) "
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   263
                            "or %d (special value for critical thread class/priority)\n",
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   264
                            value, MinimumPriority, MaximumPriority, -FXCriticalPriority);
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   265
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   266
  }
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   267
#endif
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   268
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   269
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   270
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   271
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   272
Flag::Error CodeEntryAlignmentConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   273
#ifdef SPARC
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   274
  if (CodeEntryAlignment % relocInfo::addr_unit() != 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   275
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   276
                            "CodeEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   277
                            "multiple of NOP size\n", CodeEntryAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   278
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   279
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   280
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   281
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   282
  if (!is_power_of_2(value)) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   283
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   284
                            "CodeEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   285
                            "a power of two\n", CodeEntryAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   286
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   287
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   288
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   289
  if (CodeEntryAlignment < 16) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   290
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   291
                              "CodeEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   292
                              "greater than or equal to %d\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   293
                              CodeEntryAlignment, 16);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   294
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   295
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   296
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   297
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   298
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   299
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   300
Flag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   301
  if (!is_power_of_2(value)) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   302
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   303
                            "OptoLoopAlignment (" INTX_FORMAT ") "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   304
                            "must be a power of two\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   305
                            value);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   306
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   307
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   308
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   309
#ifdef SPARC
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   310
  if (OptoLoopAlignment % relocInfo::addr_unit() != 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   311
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   312
                            "OptoLoopAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   313
                            "multiple of NOP size\n");
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   314
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   315
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   316
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   317
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   318
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   319
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   320
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   321
Flag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   322
  if (value != 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   323
    CommandLineError::print(verbose,
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   324
                            "ArraycopyDstPrefetchDistance (" UINTX_FORMAT ") must be 0\n",
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   325
                            value);
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   326
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   327
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   328
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   329
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   330
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   331
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   332
Flag::Error ArraycopySrcPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   333
  if (value != 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   334
    CommandLineError::print(verbose,
33744
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   335
                            "ArraycopySrcPrefetchDistance (" UINTX_FORMAT ") must be 0\n",
8dd886109959 8141042: Typos and refactoring in Compiler constraints functions
ddmitriev
parents: 33163
diff changeset
   336
                            value);
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   337
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   338
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   339
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   340
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   341
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   342
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   343
Flag::Error TypeProfileLevelConstraintFunc(uintx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   344
  for (int i = 0; i < 3; i++) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   345
    if (value % 10 > 2) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   346
      CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   347
                              "Invalid value (" UINTX_FORMAT ") "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   348
                              "in TypeProfileLevel at position %d\n", value, i);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   349
      return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   350
    }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   351
    value = value / 10;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   352
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   353
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   354
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   355
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   356
36554
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   357
Flag::Error InitArrayShortSizeConstraintFunc(intx value, bool verbose) {
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   358
  if (value % BytesPerLong != 0) {
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   359
    return Flag::VIOLATES_CONSTRAINT;
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   360
  } else {
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   361
    return Flag::SUCCESS;
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   362
  }
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   363
}
a7eb9ee4680c 8146801: Allocating short arrays of non-constant size is slow
shade
parents: 35751
diff changeset
   364
33163
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   365
#ifdef COMPILER2
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   366
Flag::Error InteriorEntryAlignmentConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   367
  if (InteriorEntryAlignment > CodeEntryAlignment) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   368
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   369
                           "InteriorEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   370
                           "less than or equal to CodeEntryAlignment (" INTX_FORMAT ")\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   371
                           InteriorEntryAlignment, CodeEntryAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   372
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   373
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   374
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   375
#ifdef SPARC
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   376
  if (InteriorEntryAlignment % relocInfo::addr_unit() != 0) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   377
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   378
                            "InteriorEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   379
                            "multiple of NOP size\n");
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   380
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   381
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   382
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   383
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   384
  if (!is_power_of_2(value)) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   385
     CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   386
                             "InteriorEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   387
                             "a power of two\n", InteriorEntryAlignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   388
     return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   389
   }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   390
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   391
  int minimum_alignment = 16;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   392
#if defined(SPARC) || (defined(X86) && !defined(AMD64))
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   393
  minimum_alignment = 4;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   394
#endif
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   395
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   396
  if (InteriorEntryAlignment < minimum_alignment) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   397
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   398
                            "InteriorEntryAlignment (" INTX_FORMAT ") must be "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   399
                            "greater than or equal to %d\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   400
                            InteriorEntryAlignment, minimum_alignment);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   401
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   402
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   403
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   404
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   405
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   406
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   407
Flag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   408
  if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   409
    CommandLineError::print(verbose,
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   410
                            "NodeLimitFudgeFactor must be between 2%% and 40%% "
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   411
                            "of MaxNodeLimit (" INTX_FORMAT ")\n",
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   412
                            MaxNodeLimit);
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   413
    return Flag::VIOLATES_CONSTRAINT;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   414
  }
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   415
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   416
  return Flag::SUCCESS;
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   417
}
9e128b399e48 8078554: Compiler: implement ranges (optionally constraints) for those flags that have them missing
zmajo
parents: 33160
diff changeset
   418
#endif // COMPILER2