1 /*
   2  * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jfr/jfrEvents.hpp"
  27 #include "jvm.h"
  28 #include "memory/allocation.inline.hpp"
  29 #include "oops/oop.inline.hpp"
  30 #include "runtime/arguments.hpp"
  31 #include "runtime/globals.hpp"
  32 #include "runtime/globals_extension.hpp"
  33 #include "runtime/globals_shared.hpp"
  34 #include "runtime/flags/jvmFlagConstraintList.hpp"
  35 #include "runtime/os.hpp"
  36 #include "runtime/sharedRuntime.hpp"
  37 #include "utilities/defaultStream.hpp"
  38 #include "utilities/macros.hpp"
  39 #include "utilities/ostream.hpp"
  40 #include "utilities/stringUtils.hpp"
  41 
  42 // Implementation macros
  43 #define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc)      type name = value;
  44 #define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc)          type name = pd_##name;
  45 #define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc)   type name = value;
  46 #define MATERIALIZE_PD_DIAGNOSTIC_FLAG(type, name, doc)       type name = pd_##name;
  47 #define MATERIALIZE_EXPERIMENTAL_FLAG(type, name, value, doc) type name = value;
  48 #define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc)   type name = value;
  49 #define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc)   type name = value;
  50 #ifdef PRODUCT
  51 #define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc)
  52 #define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)
  53 #define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)
  54 #else
  55 #define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc)    type name = value;
  56 #define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)        type name = pd_##name;
  57 #define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)   type name = value;
  58 #endif // PRODUCT
  59 #ifdef _LP64
  60 #define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) type name = value;
  61 #else
  62 #define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) /* flag is constant */
  63 #endif // _LP64
  64 
  65 
  66 ALL_FLAGS(MATERIALIZE_DEVELOPER_FLAG,     \
  67           MATERIALIZE_PD_DEVELOPER_FLAG,  \
  68           MATERIALIZE_PRODUCT_FLAG,       \
  69           MATERIALIZE_PD_PRODUCT_FLAG,    \
  70           MATERIALIZE_DIAGNOSTIC_FLAG,    \
  71           MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
  72           MATERIALIZE_EXPERIMENTAL_FLAG,  \
  73           MATERIALIZE_NOTPRODUCT_FLAG,    \
  74           MATERIALIZE_MANAGEABLE_FLAG,    \
  75           MATERIALIZE_PRODUCT_RW_FLAG,    \
  76           MATERIALIZE_LP64_PRODUCT_FLAG,  \
  77           IGNORE_RANGE,                   \
  78           IGNORE_CONSTRAINT)