src/hotspot/share/runtime/commandLineFlagConstraintList.cpp
author shade
Mon, 26 Mar 2018 17:27:47 +0200
branchepsilon-gc-branch
changeset 56354 4b9449c330fb
parent 55767 8e22715afabc
child 56448 76d86de267b9
permissions -rw-r--r--
Fix non-PCH build
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
/*
46818
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
     2
 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
31371
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"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    26
#include "classfile/stringTable.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    27
#include "classfile/symbolTable.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    28
#include "gc/shared/referenceProcessor.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    29
#include "runtime/arguments.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    30
#include "runtime/commandLineFlagConstraintList.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    31
#include "runtime/commandLineFlagConstraintsCompiler.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    32
#include "runtime/commandLineFlagConstraintsGC.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    33
#include "runtime/commandLineFlagConstraintsRuntime.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    34
#include "runtime/os.hpp"
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    35
#include "utilities/macros.hpp"
46564
0ec329b23bbf 8182696: Remove gcTrace.hpp include from referenceProcessor.hpp
stefank
parents: 46499
diff changeset
    36
#if INCLUDE_ALL_GCS
0ec329b23bbf 8182696: Remove gcTrace.hpp include from referenceProcessor.hpp
stefank
parents: 46499
diff changeset
    37
#include "gc/g1/g1_globals.hpp"
56354
4b9449c330fb Fix non-PCH build
shade
parents: 55767
diff changeset
    38
#include "gc/epsilon/epsilon_globals.hpp"
46564
0ec329b23bbf 8182696: Remove gcTrace.hpp include from referenceProcessor.hpp
stefank
parents: 46499
diff changeset
    39
#endif
46818
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    40
#ifdef COMPILER1
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    41
#include "c1/c1_globals.hpp"
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    42
#endif
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    43
#ifdef COMPILER2
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    44
#include "opto/c2_globals.hpp"
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    45
#endif
d0475215ae39 8186089: Move Arena to its own header file
hseigel
parents: 46564
diff changeset
    46
46564
0ec329b23bbf 8182696: Remove gcTrace.hpp include from referenceProcessor.hpp
stefank
parents: 46499
diff changeset
    47
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    48
class CommandLineFlagConstraint_bool : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    49
  CommandLineFlagConstraintFunc_bool _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    50
  const bool* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    51
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    52
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    53
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    54
  CommandLineFlagConstraint_bool(const char* name, const bool* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    55
                                 CommandLineFlagConstraintFunc_bool func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    56
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    57
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    58
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    59
    bool value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    60
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    61
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    62
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
    63
  Flag::Error apply_bool(bool value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
    64
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    65
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    66
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    67
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    68
class CommandLineFlagConstraint_int : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    69
  CommandLineFlagConstraintFunc_int _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    70
  const int* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    71
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    72
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    73
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    74
  CommandLineFlagConstraint_int(const char* name, const int* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    75
                                CommandLineFlagConstraintFunc_int func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    76
                                ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    77
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    78
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    79
    int value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    80
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    81
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    82
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
    83
  Flag::Error apply_int(int value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
    84
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    85
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    86
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    87
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    88
class CommandLineFlagConstraint_intx : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    89
  CommandLineFlagConstraintFunc_intx _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    90
  const intx* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    91
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    92
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
    93
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    94
  CommandLineFlagConstraint_intx(const char* name, const intx* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
    95
                                 CommandLineFlagConstraintFunc_intx func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    96
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    97
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    98
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
    99
    intx value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   100
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   101
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   102
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   103
  Flag::Error apply_intx(intx value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   104
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   105
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   106
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   107
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   108
class CommandLineFlagConstraint_uint : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   109
  CommandLineFlagConstraintFunc_uint _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   110
  const uint* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   111
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   112
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   113
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   114
  CommandLineFlagConstraint_uint(const char* name, const uint* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   115
                                 CommandLineFlagConstraintFunc_uint func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   116
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   117
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   118
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   119
    uint value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   120
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   121
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   122
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   123
  Flag::Error apply_uint(uint value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   124
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   125
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   126
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   127
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   128
class CommandLineFlagConstraint_uintx : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   129
  CommandLineFlagConstraintFunc_uintx _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   130
  const uintx* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   131
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   132
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   133
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   134
  CommandLineFlagConstraint_uintx(const char* name, const uintx* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   135
                                  CommandLineFlagConstraintFunc_uintx func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   136
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   137
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   138
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   139
    uintx value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   140
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   141
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   142
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   143
  Flag::Error apply_uintx(uintx value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   144
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   145
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   146
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   147
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   148
class CommandLineFlagConstraint_uint64_t : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   149
  CommandLineFlagConstraintFunc_uint64_t _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   150
  const uint64_t* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   151
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   152
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   153
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   154
  CommandLineFlagConstraint_uint64_t(const char* name, const uint64_t* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   155
                                     CommandLineFlagConstraintFunc_uint64_t func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   156
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   157
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   158
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   159
    uint64_t value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   160
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   161
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   162
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   163
  Flag::Error apply_uint64_t(uint64_t value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   164
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   165
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   166
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   167
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   168
class CommandLineFlagConstraint_size_t : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   169
  CommandLineFlagConstraintFunc_size_t _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   170
  const size_t* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   171
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   172
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   173
  CommandLineFlagConstraint_size_t(const char* name, const size_t* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   174
                                   CommandLineFlagConstraintFunc_size_t func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   175
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   176
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   177
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   178
    size_t value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   179
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   180
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   181
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   182
  Flag::Error apply_size_t(size_t value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   183
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   184
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   185
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   186
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   187
class CommandLineFlagConstraint_double : public CommandLineFlagConstraint {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   188
  CommandLineFlagConstraintFunc_double _constraint;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   189
  const double* _ptr;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   190
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   191
public:
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   192
  // the "name" argument must be a string literal
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   193
  CommandLineFlagConstraint_double(const char* name, const double* ptr,
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   194
                                   CommandLineFlagConstraintFunc_double func,
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   195
                                 ConstraintType type) : CommandLineFlagConstraint(name, type), _constraint(func), _ptr(ptr) {}
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   196
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   197
  Flag::Error apply(bool verbose) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   198
    double value = *_ptr;
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   199
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   200
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   201
32351
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   202
  Flag::Error apply_double(double value, bool verbose) {
1da9b960b3d4 8112746: Followup to JDK-8059557 (JEP 245)
gziemski
parents: 31995
diff changeset
   203
    return _constraint(value, verbose);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   204
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   205
};
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   206
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   207
// No constraint emitting
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   208
void emit_constraint_no(...)                                                      { /* NOP */ }
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   209
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   210
// No constraint emitting if function argument is NOT provided
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   211
void emit_constraint_bool(const char* /*name*/, const bool* /*value*/)            { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   212
void emit_constraint_ccstr(const char* /*name*/, const ccstr* /*value*/)          { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   213
void emit_constraint_ccstrlist(const char* /*name*/, const ccstrlist* /*value*/)  { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   214
void emit_constraint_int(const char* /*name*/, const int* /*value*/)              { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   215
void emit_constraint_intx(const char* /*name*/, const intx* /*value*/)            { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   216
void emit_constraint_uint(const char* /*name*/, const uint* /*value*/)            { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   217
void emit_constraint_uintx(const char* /*name*/, const uintx* /*value*/)          { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   218
void emit_constraint_uint64_t(const char* /*name*/, const uint64_t* /*value*/)    { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   219
void emit_constraint_size_t(const char* /*name*/, const size_t* /*value*/)        { /* NOP */ }
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   220
void emit_constraint_double(const char* /*name*/, const double* /*value*/)        { /* NOP */ }
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   221
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   222
// CommandLineFlagConstraint emitting code functions if function argument is provided
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   223
void emit_constraint_bool(const char* name, const bool* ptr, CommandLineFlagConstraintFunc_bool func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   224
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_bool(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   225
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   226
void emit_constraint_int(const char* name, const int* ptr, CommandLineFlagConstraintFunc_int func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   227
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_int(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   228
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   229
void emit_constraint_intx(const char* name, const intx* ptr, CommandLineFlagConstraintFunc_intx func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   230
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_intx(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   231
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   232
void emit_constraint_uint(const char* name, const uint* ptr, CommandLineFlagConstraintFunc_uint func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   233
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   234
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   235
void emit_constraint_uintx(const char* name, const uintx* ptr, CommandLineFlagConstraintFunc_uintx func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   236
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uintx(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   237
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   238
void emit_constraint_uint64_t(const char* name, const uint64_t* ptr, CommandLineFlagConstraintFunc_uint64_t func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   239
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint64_t(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   240
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   241
void emit_constraint_size_t(const char* name, const size_t* ptr, CommandLineFlagConstraintFunc_size_t func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   242
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_size_t(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   243
}
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   244
void emit_constraint_double(const char* name, const double* ptr, CommandLineFlagConstraintFunc_double func, CommandLineFlagConstraint::ConstraintType type) {
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   245
  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_double(name, ptr, func, type));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   246
}
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   247
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   248
// Generate code to call emit_constraint_xxx function
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   249
#define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc)      ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   250
#define EMIT_CONSTRAINT_COMMERCIAL_FLAG(type, name, value, doc)   ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   251
#define EMIT_CONSTRAINT_DIAGNOSTIC_FLAG(type, name, value, doc)   ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   252
#define EMIT_CONSTRAINT_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   253
#define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc)   ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   254
#define EMIT_CONSTRAINT_PRODUCT_RW_FLAG(type, name, value, doc)   ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   255
#define EMIT_CONSTRAINT_PD_PRODUCT_FLAG(type, name, doc)          ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   256
#define EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG(type, name, doc)       ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   257
#ifndef PRODUCT
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   258
#define EMIT_CONSTRAINT_DEVELOPER_FLAG(type, name, value, doc)    ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   259
#define EMIT_CONSTRAINT_PD_DEVELOPER_FLAG(type, name, doc)        ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   260
#define EMIT_CONSTRAINT_NOTPRODUCT_FLAG(type, name, value, doc)   ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   261
#else
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   262
#define EMIT_CONSTRAINT_DEVELOPER_FLAG(type, name, value, doc)    ); emit_constraint_no(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   263
#define EMIT_CONSTRAINT_PD_DEVELOPER_FLAG(type, name, doc)        ); emit_constraint_no(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   264
#define EMIT_CONSTRAINT_NOTPRODUCT_FLAG(type, name, value, doc)   ); emit_constraint_no(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   265
#endif
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   266
#ifdef _LP64
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   267
#define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   268
#else
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   269
#define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_no(#name,&name
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   270
#endif
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   271
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   272
// Generate func argument to pass into emit_constraint_xxx functions
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   273
#define EMIT_CONSTRAINT_CHECK(func, type)                         , func, CommandLineFlagConstraint::type
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   274
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   275
// the "name" argument must be a string literal
34661
9a1d11d88ea0 8142341: GC: current flags need ranges to be implemented
sangheki
parents: 34242
diff changeset
   276
#define INITIAL_CONSTRAINTS_SIZE 72
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   277
GrowableArray<CommandLineFlagConstraint*>* CommandLineFlagConstraintList::_constraints = NULL;
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   278
CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_validating_type = CommandLineFlagConstraint::AtParse;
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   279
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   280
// Check the ranges of all flags that have them or print them out and exit if requested
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   281
void CommandLineFlagConstraintList::init(void) {
37491
edf4cc53f5a3 8153039: Command line processing should use mtCommand or mtArguments rather than mtInternal for NMT
gziemski
parents: 37208
diff changeset
   282
  _constraints = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   283
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   284
  emit_constraint_no(NULL RUNTIME_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   285
                                        EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   286
                                        EMIT_CONSTRAINT_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   287
                                        EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   288
                                        EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   289
                                        EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   290
                                        EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   291
                                        EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   292
                                        EMIT_CONSTRAINT_MANAGEABLE_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   293
                                        EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   294
                                        EMIT_CONSTRAINT_LP64_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   295
                                        IGNORE_RANGE,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   296
                                        EMIT_CONSTRAINT_CHECK,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   297
                                        IGNORE_WRITEABLE));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   298
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   299
  EMIT_CONSTRAINTS_FOR_GLOBALS_EXT
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   300
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   301
  emit_constraint_no(NULL ARCH_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   302
                                     EMIT_CONSTRAINT_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   303
                                     EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   304
                                     EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   305
                                     EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   306
                                     IGNORE_RANGE,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   307
                                     EMIT_CONSTRAINT_CHECK,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   308
                                     IGNORE_WRITEABLE));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   309
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 32613
diff changeset
   310
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   311
#ifdef COMPILER1
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   312
  emit_constraint_no(NULL C1_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   313
                                   EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   314
                                   EMIT_CONSTRAINT_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   315
                                   EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   316
                                   EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   317
                                   EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   318
                                   EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   319
                                   IGNORE_RANGE,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   320
                                   EMIT_CONSTRAINT_CHECK,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   321
                                   IGNORE_WRITEABLE));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   322
#endif // COMPILER1
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   323
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   324
#ifdef COMPILER2
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   325
  emit_constraint_no(NULL C2_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   326
                                   EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   327
                                   EMIT_CONSTRAINT_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   328
                                   EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   329
                                   EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   330
                                   EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   331
                                   EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   332
                                   EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   333
                                   IGNORE_RANGE,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   334
                                   EMIT_CONSTRAINT_CHECK,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   335
                                   IGNORE_WRITEABLE));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   336
#endif // COMPILER2
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   337
33144
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 32613
diff changeset
   338
#if INCLUDE_ALL_GCS
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   339
  emit_constraint_no(NULL G1_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   340
                                   EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   341
                                   EMIT_CONSTRAINT_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   342
                                   EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   343
                                   EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   344
                                   EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   345
                                   EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   346
                                   EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   347
                                   EMIT_CONSTRAINT_MANAGEABLE_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   348
                                   EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   349
                                   IGNORE_RANGE,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   350
                                   EMIT_CONSTRAINT_CHECK,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents: 37491
diff changeset
   351
                                   IGNORE_WRITEABLE));
55767
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   352
  emit_constraint_no(NULL EPSILON_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   353
                                   EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   354
                                   EMIT_CONSTRAINT_PRODUCT_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   355
                                   EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   356
                                   EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   357
                                   EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   358
                                   EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   359
                                   EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   360
                                   EMIT_CONSTRAINT_MANAGEABLE_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   361
                                   EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   362
                                   IGNORE_RANGE,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   363
                                   EMIT_CONSTRAINT_CHECK,
8e22715afabc Initial import of Epsilon sources from jdk10/sandbox
shade
parents: 47216
diff changeset
   364
                                   IGNORE_WRITEABLE));
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   365
#endif // INCLUDE_ALL_GCS
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   366
}
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   367
37208
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   368
CommandLineFlagConstraint* CommandLineFlagConstraintList::find(const char* name) {
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   369
  CommandLineFlagConstraint* found = NULL;
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   370
  for (int i=0; i<length(); i++) {
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   371
    CommandLineFlagConstraint* constraint = at(i);
37208
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   372
    if (strcmp(constraint->name(), name) == 0) {
31371
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   373
      found = constraint;
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   374
      break;
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   375
    }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   376
  }
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   377
  return found;
311143309e73 8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff changeset
   378
}
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   379
37208
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   380
// Find constraints by name and return only if found constraint's type is equal or lower than current validating type.
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   381
CommandLineFlagConstraint* CommandLineFlagConstraintList::find_if_needs_check(const char* name) {
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   382
  CommandLineFlagConstraint* found = NULL;
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   383
  CommandLineFlagConstraint* constraint = find(name);
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   384
  if (constraint && (constraint->type() <= _validating_type)) {
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   385
    found = constraint;
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   386
  }
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   387
  return found;
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   388
}
aaf76eb8cfd4 8142510: -XX:+PrintFlagsRanges should print default range value for those flags that have constraint and an implicit range.
gziemski
parents: 36313
diff changeset
   389
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   390
// Check constraints for specific constraint type.
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   391
bool CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::ConstraintType type) {
33144
c56850e328fc 8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents: 32613
diff changeset
   392
  guarantee(type > _validating_type, "Constraint check is out of order.");
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   393
  _validating_type = type;
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   394
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   395
  bool status = true;
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   396
  for (int i=0; i<length(); i++) {
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   397
    CommandLineFlagConstraint* constraint = at(i);
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   398
    if (type != constraint->type()) continue;
46499
22e71ef4a16a 8180614: Skip range and constraint checks on non-existent flags
redestad
parents: 39117
diff changeset
   399
    if (constraint->apply(true) != Flag::SUCCESS) status = false;
31995
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   400
  }
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   401
  return status;
aa4049b4184a 8130459: Add additional validation after heap creation
sangheki
parents: 31371
diff changeset
   402
}