src/hotspot/share/runtime/commandLineFlagWriteableList.cpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 39117 hotspot/src/share/vm/runtime/commandLineFlagWriteableList.cpp@59fa99a45873
child 49715 947560700a09
child 55767 8e22715afabc
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     1
/*
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     4
 *
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     7
 * published by the Free Software Foundation.
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     8
 *
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    13
 * accompanied this code).
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    14
 *
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    18
 *
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    21
 * questions.
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    22
 *
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    23
 */
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    24
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    25
#include "precompiled.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    26
#include "runtime/commandLineFlagWriteableList.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    27
#include "runtime/os.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    28
#if INCLUDE_ALL_GCS
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    29
#include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    30
#include "gc/g1/g1_globals.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    31
#include "gc/g1/heapRegionBounds.inline.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    32
#include "gc/shared/plab.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    33
#endif // INCLUDE_ALL_GCS
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    34
#ifdef COMPILER1
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    35
#include "c1/c1_globals.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    36
#endif // COMPILER1
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    37
#ifdef COMPILER2
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    38
#include "opto/c2_globals.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    39
#endif // COMPILER2
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    40
#if INCLUDE_JVMCI
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    41
#include "jvmci/jvmci_globals.hpp"
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    42
#endif
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    43
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    44
bool CommandLineFlagWriteable::is_writeable(void) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    45
  return _writeable;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    46
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    47
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    48
void CommandLineFlagWriteable::mark_once(void) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    49
  if (_type == Once) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    50
    _writeable = false;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    51
  }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    52
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    53
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    54
void CommandLineFlagWriteable::mark_startup(void) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    55
  if (_type == CommandLineFlagWriteable::CommandLineOnly) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    56
    _writeable = false;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    57
  }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    58
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    59
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    60
// No control emitting
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    61
void emit_writeable_no(...)                         { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    62
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    63
// No control emitting if type argument is NOT provided
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    64
void emit_writeable_bool(const char* /*name*/)      { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    65
void emit_writeable_ccstr(const char* /*name*/)     { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    66
void emit_writeable_ccstrlist(const char* /*name*/) { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    67
void emit_writeable_int(const char* /*name*/)       { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    68
void emit_writeable_intx(const char* /*name*/)      { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    69
void emit_writeable_uint(const char* /*name*/)      { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    70
void emit_writeable_uintx(const char* /*name*/)     { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    71
void emit_writeable_uint64_t(const char* /*name*/)  { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    72
void emit_writeable_size_t(const char* /*name*/)    { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    73
void emit_writeable_double(const char* /*name*/)    { /* NOP */ }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    74
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    75
// CommandLineFlagWriteable emitting code functions if range arguments are provided
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    76
void emit_writeable_bool(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    77
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    78
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    79
void emit_writeable_int(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    80
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    81
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    82
void emit_writeable_intx(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    83
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    84
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    85
void emit_writeable_uint(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    86
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    87
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    88
void emit_writeable_uintx(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    89
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    90
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    91
void emit_writeable_uint64_t(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    92
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    93
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    94
void emit_writeable_size_t(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    95
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    96
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    97
void emit_writeable_double(const char* name, CommandLineFlagWriteable::WriteableType type) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    98
  CommandLineFlagWriteableList::add(new CommandLineFlagWriteable(name, type));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
    99
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   100
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   101
// Generate code to call emit_writeable_xxx function
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   102
#define EMIT_WRITEABLE_PRODUCT_FLAG(type, name, value, doc)      ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   103
#define EMIT_WRITEABLE_COMMERCIAL_FLAG(type, name, value, doc)   ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   104
#define EMIT_WRITEABLE_DIAGNOSTIC_FLAG(type, name, value, doc)   ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   105
#define EMIT_WRITEABLE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   106
#define EMIT_WRITEABLE_MANAGEABLE_FLAG(type, name, value, doc)   ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   107
#define EMIT_WRITEABLE_PRODUCT_RW_FLAG(type, name, value, doc)   ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   108
#define EMIT_WRITEABLE_PD_PRODUCT_FLAG(type, name, doc)          ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   109
#define EMIT_WRITEABLE_DEVELOPER_FLAG(type, name, value, doc)    ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   110
#define EMIT_WRITEABLE_PD_DEVELOPER_FLAG(type, name, doc)        ); emit_writeable_##type(#name
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   111
#define EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG(type, name, doc)       ); emit_writeable_##type(#name
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   112
#define EMIT_WRITEABLE_NOTPRODUCT_FLAG(type, name, value, doc)   ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   113
#define EMIT_WRITEABLE_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   114
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   115
// Generate type argument to pass into emit_writeable_xxx functions
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   116
#define EMIT_WRITEABLE(a)                                      , CommandLineFlagWriteable::a
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   117
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   118
#define INITIAL_WRITEABLES_SIZE 2
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   119
GrowableArray<CommandLineFlagWriteable*>* CommandLineFlagWriteableList::_controls = NULL;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   120
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   121
void CommandLineFlagWriteableList::init(void) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   122
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   123
  _controls = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<CommandLineFlagWriteable*>(INITIAL_WRITEABLES_SIZE, true);
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   124
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   125
  emit_writeable_no(NULL RUNTIME_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   126
                                   EMIT_WRITEABLE_PD_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   127
                                   EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   128
                                   EMIT_WRITEABLE_PD_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   129
                                   EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   130
                                   EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   131
                                   EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   132
                                   EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   133
                                   EMIT_WRITEABLE_MANAGEABLE_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   134
                                   EMIT_WRITEABLE_PRODUCT_RW_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   135
                                   EMIT_WRITEABLE_LP64_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   136
                                   IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   137
                                   IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   138
                                   EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   139
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   140
  EMIT_WRITEABLES_FOR_GLOBALS_EXT
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   141
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   142
  emit_writeable_no(NULL ARCH_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   143
                                EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   144
                                EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   145
                                EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   146
                                EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   147
                                IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   148
                                IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   149
                                EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   150
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   151
#if INCLUDE_JVMCI
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   152
  emit_writeable_no(NULL JVMCI_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   153
                                 EMIT_WRITEABLE_PD_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   154
                                 EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   155
                                 EMIT_WRITEABLE_PD_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   156
                                 EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   157
                                 EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   158
                                 EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   159
                                 EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   160
                                 IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   161
                                 IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   162
                                 EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   163
#endif // INCLUDE_JVMCI
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   164
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   165
#ifdef COMPILER1
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   166
  emit_writeable_no(NULL C1_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   167
                              EMIT_WRITEABLE_PD_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   168
                              EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   169
                              EMIT_WRITEABLE_PD_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   170
                              EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   171
                              EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   172
                              EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   173
                              IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   174
                              IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   175
                              EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   176
#endif // COMPILER1
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   177
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   178
#ifdef COMPILER2
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   179
  emit_writeable_no(NULL C2_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   180
                              EMIT_WRITEABLE_PD_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   181
                              EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   182
                              EMIT_WRITEABLE_PD_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   183
                              EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   184
                              EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   185
                              EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   186
                              EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   187
                              IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   188
                              IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   189
                              EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   190
#endif // COMPILER2
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   191
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   192
#if INCLUDE_ALL_GCS
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   193
  emit_writeable_no(NULL G1_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   194
                              EMIT_WRITEABLE_PD_DEVELOPER_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   195
                              EMIT_WRITEABLE_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   196
                              EMIT_WRITEABLE_PD_PRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   197
                              EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
39117
59fa99a45873 8150900: Implement diagnostic_pd
csahu
parents: 38273
diff changeset
   198
                              EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
38273
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   199
                              EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   200
                              EMIT_WRITEABLE_NOTPRODUCT_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   201
                              EMIT_WRITEABLE_MANAGEABLE_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   202
                              EMIT_WRITEABLE_PRODUCT_RW_FLAG,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   203
                              IGNORE_RANGE,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   204
                              IGNORE_CONSTRAINT,
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   205
                              EMIT_WRITEABLE));
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   206
#endif // INCLUDE_ALL_GCS
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   207
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   208
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   209
CommandLineFlagWriteable* CommandLineFlagWriteableList::find(const char* name) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   210
  CommandLineFlagWriteable* found = NULL;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   211
  for (int i=0; i<length(); i++) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   212
    CommandLineFlagWriteable* writeable = at(i);
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   213
    if (strcmp(writeable->name(), name) == 0) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   214
      found = writeable;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   215
      break;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   216
    }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   217
  }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   218
  return found;
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   219
}
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   220
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   221
void CommandLineFlagWriteableList::mark_startup(void) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   222
  for (int i=0; i<length(); i++) {
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   223
    CommandLineFlagWriteable* writeable = at(i);
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   224
    writeable->mark_startup();
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   225
  }
2634194d7555 8073500: Prevent certain commercial flags from being changed at runtime
gziemski
parents:
diff changeset
   226
}