src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58044 3277a7454dc5
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     1
/*
50708
bd3a8f48597e 8202331: Obsolete support for commercial features
mikael
parents: 49902
diff changeset
     2
 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     4
 *
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     8
 *
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    13
 * accompanied this code).
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    14
 *
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    18
 *
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    21
 * questions.
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    22
 *
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    23
 */
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    24
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    25
#include "precompiled.hpp"
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    26
#include "classfile/stringTable.hpp"
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    27
#include "classfile/symbolTable.hpp"
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    28
#include "gc/shared/jvmFlagConstraintsGC.hpp"
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    29
#include "runtime/arguments.hpp"
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    30
#include "runtime/flags/jvmFlag.hpp"
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    31
#include "runtime/flags/jvmFlagConstraintList.hpp"
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    32
#include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    33
#include "runtime/flags/jvmFlagConstraintsRuntime.hpp"
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
    34
#include "runtime/globals.hpp"
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    35
#include "runtime/globals_extension.hpp"
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    36
#include "runtime/os.hpp"
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    37
#include "utilities/macros.hpp"
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    38
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    39
class JVMFlagConstraint_bool : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    40
  JVMFlagConstraintFunc_bool _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    41
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    42
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    43
  JVMFlagConstraint_bool(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    44
                         JVMFlagConstraintFunc_bool func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    45
                         ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    46
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    47
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    48
    return _constraint(_flag->get_bool(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    49
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    50
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    51
  JVMFlag::Error apply_bool(bool value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    52
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    53
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    54
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    55
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    56
class JVMFlagConstraint_int : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    57
  JVMFlagConstraintFunc_int _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    58
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    59
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    60
  JVMFlagConstraint_int(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    61
                        JVMFlagConstraintFunc_int func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    62
                        ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    63
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    64
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    65
    return _constraint(_flag->get_int(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    66
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    67
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    68
  JVMFlag::Error apply_int(int value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    69
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    70
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    71
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    72
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    73
class JVMFlagConstraint_intx : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    74
  JVMFlagConstraintFunc_intx _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    75
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    76
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    77
  JVMFlagConstraint_intx(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    78
                         JVMFlagConstraintFunc_intx func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    79
                         ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    80
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    81
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    82
    return _constraint(_flag->get_intx(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    83
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    84
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    85
  JVMFlag::Error apply_intx(intx value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    86
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    87
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    88
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    89
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    90
class JVMFlagConstraint_uint : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    91
  JVMFlagConstraintFunc_uint _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    92
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    93
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    94
  JVMFlagConstraint_uint(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    95
                         JVMFlagConstraintFunc_uint func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    96
                         ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
    97
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
    98
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
    99
    return _constraint(_flag->get_uint(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   100
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   101
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   102
  JVMFlag::Error apply_uint(uint value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   103
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   104
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   105
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   106
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   107
class JVMFlagConstraint_uintx : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   108
  JVMFlagConstraintFunc_uintx _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   109
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   110
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   111
  JVMFlagConstraint_uintx(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   112
                          JVMFlagConstraintFunc_uintx func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   113
                          ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   114
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   115
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   116
    return _constraint(_flag->get_uintx(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   117
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   118
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   119
  JVMFlag::Error apply_uintx(uintx value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   120
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   121
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   122
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   123
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   124
class JVMFlagConstraint_uint64_t : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   125
  JVMFlagConstraintFunc_uint64_t _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   126
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   127
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   128
  JVMFlagConstraint_uint64_t(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   129
                             JVMFlagConstraintFunc_uint64_t func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   130
                             ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   131
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   132
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   133
    return _constraint(_flag->get_uint64_t(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   134
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   135
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   136
  JVMFlag::Error apply_uint64_t(uint64_t value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   137
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   138
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   139
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   140
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   141
class JVMFlagConstraint_size_t : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   142
  JVMFlagConstraintFunc_size_t _constraint;
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   143
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   144
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   145
  JVMFlagConstraint_size_t(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   146
                           JVMFlagConstraintFunc_size_t func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   147
                           ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   148
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   149
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   150
    return _constraint(_flag->get_size_t(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   151
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   152
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   153
  JVMFlag::Error apply_size_t(size_t value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   154
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   155
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   156
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   157
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   158
class JVMFlagConstraint_double : public JVMFlagConstraint {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   159
  JVMFlagConstraintFunc_double _constraint;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   160
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   161
public:
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   162
  JVMFlagConstraint_double(const JVMFlag* flag,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   163
                           JVMFlagConstraintFunc_double func,
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   164
                           ConstraintType type) : JVMFlagConstraint(flag, type), _constraint(func) {}
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   165
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   166
  JVMFlag::Error apply(bool verbose) {
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   167
    return _constraint(_flag->get_double(), verbose);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   168
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   169
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   170
  JVMFlag::Error apply_double(double value, bool verbose) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   171
    return _constraint(value, verbose);
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   172
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   173
};
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   174
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   175
// No constraint emitting
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   176
void emit_constraint_no(...)                            { /* NOP */ }
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   177
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   178
// No constraint emitting if function argument is NOT provided
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   179
void emit_constraint_bool(const JVMFlag* /*flag*/)      { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   180
void emit_constraint_ccstr(const JVMFlag* /*flag*/)     { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   181
void emit_constraint_ccstrlist(const JVMFlag* /*flag*/) { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   182
void emit_constraint_int(const JVMFlag* /*flag*/)       { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   183
void emit_constraint_intx(const JVMFlag* /*flag*/)      { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   184
void emit_constraint_uint(const JVMFlag* /*flag*/)      { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   185
void emit_constraint_uintx(const JVMFlag* /*flag*/)     { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   186
void emit_constraint_uint64_t(const JVMFlag* /*flag*/)  { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   187
void emit_constraint_size_t(const JVMFlag* /*flag*/)    { /* NOP */ }
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   188
void emit_constraint_double(const JVMFlag* /*flag*/)    { /* NOP */ }
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   189
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   190
// JVMFlagConstraint emitting code functions if function argument is provided
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   191
void emit_constraint_bool(const JVMFlag* flag, JVMFlagConstraintFunc_bool func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   192
  JVMFlagConstraintList::add(new JVMFlagConstraint_bool(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   193
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   194
void emit_constraint_int(const JVMFlag* flag, JVMFlagConstraintFunc_int func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   195
  JVMFlagConstraintList::add(new JVMFlagConstraint_int(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   196
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   197
void emit_constraint_intx(const JVMFlag* flag, JVMFlagConstraintFunc_intx func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   198
  JVMFlagConstraintList::add(new JVMFlagConstraint_intx(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   199
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   200
void emit_constraint_uint(const JVMFlag* flag, JVMFlagConstraintFunc_uint func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   201
  JVMFlagConstraintList::add(new JVMFlagConstraint_uint(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   202
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   203
void emit_constraint_uintx(const JVMFlag* flag, JVMFlagConstraintFunc_uintx func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   204
  JVMFlagConstraintList::add(new JVMFlagConstraint_uintx(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   205
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   206
void emit_constraint_uint64_t(const JVMFlag* flag, JVMFlagConstraintFunc_uint64_t func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   207
  JVMFlagConstraintList::add(new JVMFlagConstraint_uint64_t(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   208
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   209
void emit_constraint_size_t(const JVMFlag* flag, JVMFlagConstraintFunc_size_t func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   210
  JVMFlagConstraintList::add(new JVMFlagConstraint_size_t(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   211
}
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   212
void emit_constraint_double(const JVMFlag* flag, JVMFlagConstraintFunc_double func, JVMFlagConstraint::ConstraintType type) {
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   213
  JVMFlagConstraintList::add(new JVMFlagConstraint_double(flag, func, type));
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   214
}
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   215
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   216
// Generate code to call emit_constraint_xxx function
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   217
#define EMIT_CONSTRAINT_START       (void)(0
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   218
#define EMIT_CONSTRAINT(type, name) ); emit_constraint_##type(JVMFlagEx::flag_from_enum(FLAG_MEMBER_ENUM(name))
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   219
#define EMIT_CONSTRAINT_NO          ); emit_constraint_no(0
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   220
#define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc)      EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   221
#define EMIT_CONSTRAINT_DIAGNOSTIC_FLAG(type, name, value, doc)   EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   222
#define EMIT_CONSTRAINT_EXPERIMENTAL_FLAG(type, name, value, doc) EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   223
#define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc)   EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   224
#define EMIT_CONSTRAINT_PRODUCT_RW_FLAG(type, name, value, doc)   EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   225
#define EMIT_CONSTRAINT_PD_PRODUCT_FLAG(type, name, doc)          EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   226
#define EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG(type, name, doc)       EMIT_CONSTRAINT(type, name)
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   227
#ifndef PRODUCT
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   228
#define EMIT_CONSTRAINT_DEVELOPER_FLAG(type, name, value, doc)    EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   229
#define EMIT_CONSTRAINT_PD_DEVELOPER_FLAG(type, name, doc)        EMIT_CONSTRAINT(type, name)
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   230
#define EMIT_CONSTRAINT_NOTPRODUCT_FLAG(type, name, value, doc)   EMIT_CONSTRAINT(type, name)
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   231
#else
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   232
#define EMIT_CONSTRAINT_DEVELOPER_FLAG(type, name, value, doc)    EMIT_CONSTRAINT_NO
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   233
#define EMIT_CONSTRAINT_PD_DEVELOPER_FLAG(type, name, doc)        EMIT_CONSTRAINT_NO
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   234
#define EMIT_CONSTRAINT_NOTPRODUCT_FLAG(type, name, value, doc)   EMIT_CONSTRAINT_NO
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   235
#endif
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   236
#ifdef _LP64
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   237
#define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) EMIT_CONSTRAINT(type, name)
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   238
#else
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   239
#define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) EMIT_CONSTRAINT_NO
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   240
#endif
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   241
#define EMIT_CONSTRAINT_END         );
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   242
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   243
// Generate func argument to pass into emit_constraint_xxx functions
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   244
#define EMIT_CONSTRAINT_CHECK(func, type)                         , func, JVMFlagConstraint::type
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   245
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   246
// the "name" argument must be a string literal
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   247
#define INITIAL_CONSTRAINTS_SIZE 72
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   248
GrowableArray<JVMFlagConstraint*>* JVMFlagConstraintList::_constraints = NULL;
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   249
JVMFlagConstraint::ConstraintType JVMFlagConstraintList::_validating_type = JVMFlagConstraint::AtParse;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   250
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   251
// Check the ranges of all flags that have them or print them out and exit if requested
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   252
void JVMFlagConstraintList::init(void) {
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   253
  _constraints = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<JVMFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   254
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   255
  EMIT_CONSTRAINT_START
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   256
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   257
  ALL_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   258
            EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   259
            EMIT_CONSTRAINT_PRODUCT_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   260
            EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   261
            EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   262
            EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   263
            EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   264
            EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   265
            EMIT_CONSTRAINT_MANAGEABLE_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   266
            EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   267
            EMIT_CONSTRAINT_LP64_PRODUCT_FLAG,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   268
            IGNORE_RANGE,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   269
            EMIT_CONSTRAINT_CHECK,
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   270
            IGNORE_WRITEABLE)
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   271
54982
b18c8301b8c2 8224201: Simplify JVM flag macro expansions
stefank
parents: 50708
diff changeset
   272
  EMIT_CONSTRAINT_END
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   273
}
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   274
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   275
JVMFlagConstraint* JVMFlagConstraintList::find(const JVMFlag* flag) {
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   276
  JVMFlagConstraint* found = NULL;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   277
  for (int i=0; i<length(); i++) {
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   278
    JVMFlagConstraint* constraint = at(i);
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   279
    if (constraint->flag() == flag) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   280
      found = constraint;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   281
      break;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   282
    }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   283
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   284
  return found;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   285
}
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   286
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   287
// Find constraints and return only if found constraint's type is equal or lower than current validating type.
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   288
JVMFlagConstraint* JVMFlagConstraintList::find_if_needs_check(const JVMFlag* flag) {
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   289
  JVMFlagConstraint* found = NULL;
57876
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   290
  JVMFlagConstraint* constraint = find(flag);
30db6422848b 8224878: Use JVMFlag parameters instead of name strings
stefank
parents: 54982
diff changeset
   291
  if (constraint != NULL && (constraint->type() <= _validating_type)) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   292
    found = constraint;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   293
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   294
  return found;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   295
}
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   296
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   297
// Check constraints for specific constraint type.
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   298
bool JVMFlagConstraintList::check_constraints(JVMFlagConstraint::ConstraintType type) {
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   299
  guarantee(type > _validating_type, "Constraint check is out of order.");
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   300
  _validating_type = type;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   301
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   302
  bool status = true;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   303
  for (int i=0; i<length(); i++) {
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   304
    JVMFlagConstraint* constraint = at(i);
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   305
    if (type != constraint->type()) continue;
49902
3661f31c6df4 8202150: [REDO] Split globals.hpp to factor out the Flag class
gziemski
parents: 49860
diff changeset
   306
    if (constraint->apply(true) != JVMFlag::SUCCESS) status = false;
49860
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   307
  }
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   308
  return status;
ca5216a2a2cc 8202151: [BACKOUT] Split globals.hpp to factor out the Flag class
gziemski
parents:
diff changeset
   309
}