hotspot/src/share/vm/runtime/globals_extension.hpp
author coleenp
Mon, 14 Jan 2013 11:01:39 -0500
changeset 15194 a35093d73168
parent 13975 2f7431485cfa
child 15482 470d0b0c09f1
permissions -rw-r--r--
8006005: Fix constant pool index validation and alignment trap for method parameter reflection Summary: This patch addresses an alignment trap due to the storage format of method parameters data in constMethod. It also adds code to validate constant pool indexes for method parameters data. Reviewed-by: jrose, dholmes Contributed-by: eric.mccorkle@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
13521
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
     2
 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4450
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4450
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4450
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "runtime/globals.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "utilities/top.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// Construct enum of Flag_<cmdline-arg> constants.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// Parens left off in the following for the enum decl below.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#define FLAG_MEMBER(flag) Flag_##flag
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
#define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
#define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc)        FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
1382
fa3de4068282 6618726: Introduce -XX:+UnlockExperimentalVMOptions flag
ysr
parents: 1374
diff changeset
    39
#define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
#define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
#define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc)  FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc)      FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
#endif
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
    51
#ifdef _LP64
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
    52
#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
    53
#else
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
    54
#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc)    /* flag is constant */
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
    55
#endif // _LP64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
#define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
#define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc)             FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc)       /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc)       FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
#define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
#define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc)             FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
#define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
4450
6d700b859b3e 6892658: C2 should optimize some stringbuilder patterns
never
parents: 4434
diff changeset
    72
#define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc)       /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc)       FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc)           FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
13521
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    83
#define ARCH_PRODUCT_FLAG_MEMBER(type, name, value, doc)         FLAG_MEMBER(name),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    84
#define ARCH_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc)      FLAG_MEMBER(name),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    85
#define ARCH_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    86
#ifdef PRODUCT
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    87
  #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc)       /* flag is constant */
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    88
  #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    89
#else
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    90
  #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc)       FLAG_MEMBER(name),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    91
  #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc)    FLAG_MEMBER(name),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    92
#endif
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
    93
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
typedef enum {
11167
3931428f62ae 7116730: Revert 7116481: Commercial features in Hotspot must be gated by a switch
phh
parents: 11166
diff changeset
    95
 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER)
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    96
 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER)
13975
2f7431485cfa 7189254: Change makefiles for more flexibility to override defaults
jprovino
parents: 13521
diff changeset
    97
#if INCLUDE_ALTERNATE_GCS
1382
fa3de4068282 6618726: Introduce -XX:+UnlockExperimentalVMOptions flag
ysr
parents: 1374
diff changeset
    98
 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER)
13975
2f7431485cfa 7189254: Change makefiles for more flexibility to override defaults
jprovino
parents: 13521
diff changeset
    99
#endif // INCLUDE_ALTERNATE_GCS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
#ifdef COMPILER1
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   101
 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, C1_PD_DEVELOP_FLAG_MEMBER, C1_PRODUCT_FLAG_MEMBER, C1_PD_PRODUCT_FLAG_MEMBER, C1_NOTPRODUCT_FLAG_MEMBER)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
#ifdef COMPILER2
4450
6d700b859b3e 6892658: C2 should optimize some stringbuilder patterns
never
parents: 4434
diff changeset
   104
 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER, C2_PD_DEVELOP_FLAG_MEMBER, C2_PRODUCT_FLAG_MEMBER, C2_PD_PRODUCT_FLAG_MEMBER, C2_DIAGNOSTIC_FLAG_MEMBER, C2_EXPERIMENTAL_FLAG_MEMBER, C2_NOTPRODUCT_FLAG_MEMBER)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
#endif
13521
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   106
 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER, ARCH_PRODUCT_FLAG_MEMBER, ARCH_DIAGNOSTIC_FLAG_MEMBER, ARCH_EXPERIMENTAL_FLAG_MEMBER, ARCH_NOTPRODUCT_FLAG_MEMBER)
11183
a81bb5c041d3 7117389: Add a framework for vendor-specific command line switch extensions to Hotspot
phh
parents: 11167
diff changeset
   107
 COMMANDLINEFLAG_EXT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
 NUM_CommandLineFlag
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
} CommandLineFlag;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
// Construct enum of Flag_<cmdline-arg>_<type> constants.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
#define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
#define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
#define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)        FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
1382
fa3de4068282 6618726: Introduce -XX:+UnlockExperimentalVMOptions flag
ysr
parents: 1374
diff changeset
   118
#define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
#define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
#define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)         /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)     FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)  FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
#define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
#define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)             FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
#endif
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   142
#ifdef _LP64
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   143
#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   144
#else
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   145
#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    /* flag is constant */
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   146
#endif // _LP64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
#define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
#define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc)             FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
#define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
4450
6d700b859b3e 6892658: C2 should optimize some stringbuilder patterns
never
parents: 4434
diff changeset
   151
#define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
#ifdef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           /* flag is constant */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc)           FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
13521
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   162
#define ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)         FLAG_MEMBER_WITH_TYPE(name,type),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   163
#define ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   164
#define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)      FLAG_MEMBER_WITH_TYPE(name,type),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   165
#ifdef PRODUCT
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   166
  #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       /* flag is constant */
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   167
  #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   168
#else
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   169
  #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)       FLAG_MEMBER_WITH_TYPE(name,type),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   170
  #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc)    FLAG_MEMBER_WITH_TYPE(name,type),
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   171
#endif
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   172
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
typedef enum {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   174
 RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   175
               RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   176
               RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   177
               RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
               RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
1382
fa3de4068282 6618726: Introduce -XX:+UnlockExperimentalVMOptions flag
ysr
parents: 1374
diff changeset
   179
               RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
               RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
               RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   182
               RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 186
diff changeset
   183
               RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE)
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   184
 RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   185
                  RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   186
                  RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   187
                  RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   188
                  RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   189
                  RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
13975
2f7431485cfa 7189254: Change makefiles for more flexibility to override defaults
jprovino
parents: 13521
diff changeset
   190
#if INCLUDE_ALTERNATE_GCS
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   191
 G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   192
          RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   193
          RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   194
          RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   195
          RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
1382
fa3de4068282 6618726: Introduce -XX:+UnlockExperimentalVMOptions flag
ysr
parents: 1374
diff changeset
   196
          RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   197
          RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   198
          RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   199
          RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE)
13975
2f7431485cfa 7189254: Change makefiles for more flexibility to override defaults
jprovino
parents: 13521
diff changeset
   200
#endif // INCLUDE_ALTERNATE_GCS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
#ifdef COMPILER1
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   202
 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   203
          C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   204
          C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   205
          C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   206
          C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
#ifdef COMPILER2
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   209
 C2_FLAGS(C2_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   210
          C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   211
          C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   212
          C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   213
          C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
4450
6d700b859b3e 6892658: C2 should optimize some stringbuilder patterns
never
parents: 4434
diff changeset
   214
          C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   215
          C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
#endif
13521
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   217
 ARCH_FLAGS(ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE,
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   218
          ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE,
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   219
          ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   220
          ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
97a23be06f4e 6677625: Move platform specific flags from globals.hpp to globals_<arch>.hpp
twisti
parents: 11183
diff changeset
   221
          ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
11183
a81bb5c041d3 7117389: Add a framework for vendor-specific command line switch extensions to Hotspot
phh
parents: 11167
diff changeset
   222
 COMMANDLINEFLAGWITHTYPE_EXT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
 NUM_CommandLineFlagWithType
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
} CommandLineFlagWithType;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
#define FLAG_IS_DEFAULT(name)         (CommandLineFlagsEx::is_default(FLAG_MEMBER(name)))
186
32e6c95f8d9b 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 1
diff changeset
   227
#define FLAG_IS_ERGO(name)            (CommandLineFlagsEx::is_ergo(FLAG_MEMBER(name)))
32e6c95f8d9b 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 1
diff changeset
   228
#define FLAG_IS_CMDLINE(name)         (CommandLineFlagsEx::is_cmdline(FLAG_MEMBER(name)))
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
#define FLAG_SET_DEFAULT(name, value) ((name) = (value))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
#define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), COMMAND_LINE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
#define FLAG_SET_ERGO(type, name, value)    (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), ERGONOMIC))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
// Can't put the following in CommandLineFlags because
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
// of a circular dependency on the enum definition.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
class CommandLineFlagsEx : CommandLineFlags {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  static void boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  static void intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  static void uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin);
4434
4b41e5b42f81 6887571: Increase default heap config sizes
phh
parents: 1388
diff changeset
   242
  static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  static void doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  static bool is_default(CommandLineFlag flag);
186
32e6c95f8d9b 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 1
diff changeset
   247
  static bool is_ergo(CommandLineFlag flag);
32e6c95f8d9b 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 1
diff changeset
   248
  static bool is_cmdline(CommandLineFlag flag);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   250
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   251
#endif // SHARE_VM_RUNTIME_GLOBALS_EXTENSION_HPP