1 | /* |
2 | * Copyright (c) 2003, 2019, 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 | #ifndef SHARE_RUNTIME_GLOBALS_EXTENSION_HPP |
26 | #define SHARE_RUNTIME_GLOBALS_EXTENSION_HPP |
27 | |
28 | #include "runtime/globals.hpp" |
29 | #include "utilities/macros.hpp" |
30 | |
31 | // Construct enum of Flag_<cmdline-arg> constants. |
32 | |
33 | #define FLAG_MEMBER_ENUM(name) Flag_##name##_enum |
34 | #define FLAG_MEMBER_ENUM_(name) FLAG_MEMBER_ENUM(name), |
35 | |
36 | #define FLAG_MEMBER_ENUM_PRODUCT(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
37 | #define FLAG_MEMBER_ENUM_PD_PRODUCT(type, name, doc) FLAG_MEMBER_ENUM_(name) |
38 | #define FLAG_MEMBER_ENUM_DIAGNOSTIC(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
39 | #define FLAG_MEMBER_ENUM_PD_DIAGNOSTIC(type, name, doc) FLAG_MEMBER_ENUM_(name) |
40 | #define FLAG_MEMBER_ENUM_EXPERIMENTAL(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
41 | #define FLAG_MEMBER_ENUM_MANAGEABLE(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
42 | #define FLAG_MEMBER_ENUM_PRODUCT_RW(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
43 | #define FLAG_MEMBER_ENUM_DEVELOP(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
44 | #define FLAG_MEMBER_ENUM_PD_DEVELOP(type, name, doc) FLAG_MEMBER_ENUM_(name) |
45 | #define FLAG_MEMBER_ENUM_NOTPRODUCT(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
46 | #ifdef _LP64 |
47 | #define FLAG_MEMBER_ENUM_LP64_PRODUCT(type, name, value, doc) FLAG_MEMBER_ENUM_(name) |
48 | #else |
49 | #define FLAG_MEMBER_ENUM_LP64_PRODUCT(type, name, value, doc) /* flag is constant */ |
50 | #endif // _LP64 |
51 | |
52 | typedef enum { |
53 | ALL_FLAGS(FLAG_MEMBER_ENUM_DEVELOP, |
54 | FLAG_MEMBER_ENUM_PD_DEVELOP, |
55 | FLAG_MEMBER_ENUM_PRODUCT, |
56 | FLAG_MEMBER_ENUM_PD_PRODUCT, |
57 | FLAG_MEMBER_ENUM_DIAGNOSTIC, |
58 | FLAG_MEMBER_ENUM_PD_DIAGNOSTIC, |
59 | FLAG_MEMBER_ENUM_EXPERIMENTAL, |
60 | FLAG_MEMBER_ENUM_NOTPRODUCT, |
61 | FLAG_MEMBER_ENUM_MANAGEABLE, |
62 | FLAG_MEMBER_ENUM_PRODUCT_RW, |
63 | FLAG_MEMBER_ENUM_LP64_PRODUCT, |
64 | IGNORE_RANGE, |
65 | IGNORE_CONSTRAINT, |
66 | IGNORE_WRITEABLE) |
67 | JVMFLAGSENUM_EXT |
68 | NUM_JVMFlagsEnum |
69 | } JVMFlagsEnum; |
70 | |
71 | // Can't put the following in JVMFlags because |
72 | // of a circular dependency on the enum definition. |
73 | class JVMFlagEx : JVMFlag { |
74 | public: |
75 | static JVMFlag::Error boolAtPut(JVMFlagsEnum flag, bool value, JVMFlag::Flags origin); |
76 | static JVMFlag::Error intAtPut(JVMFlagsEnum flag, int value, JVMFlag::Flags origin); |
77 | static JVMFlag::Error uintAtPut(JVMFlagsEnum flag, uint value, JVMFlag::Flags origin); |
78 | static JVMFlag::Error intxAtPut(JVMFlagsEnum flag, intx value, JVMFlag::Flags origin); |
79 | static JVMFlag::Error uintxAtPut(JVMFlagsEnum flag, uintx value, JVMFlag::Flags origin); |
80 | static JVMFlag::Error uint64_tAtPut(JVMFlagsEnum flag, uint64_t value, JVMFlag::Flags origin); |
81 | static JVMFlag::Error size_tAtPut(JVMFlagsEnum flag, size_t value, JVMFlag::Flags origin); |
82 | static JVMFlag::Error doubleAtPut(JVMFlagsEnum flag, double value, JVMFlag::Flags origin); |
83 | // Contract: Flag will make private copy of the incoming value |
84 | static JVMFlag::Error ccstrAtPut(JVMFlagsEnum flag, ccstr value, JVMFlag::Flags origin); |
85 | static JVMFlag::Error ccstrlistAtPut(JVMFlagsEnum flag, ccstr value, JVMFlag::Flags origin) { |
86 | return ccstrAtPut(flag, value, origin); |
87 | } |
88 | |
89 | static bool is_default(JVMFlagsEnum flag); |
90 | static bool is_ergo(JVMFlagsEnum flag); |
91 | static bool is_cmdline(JVMFlagsEnum flag); |
92 | |
93 | static void setOnCmdLine(JVMFlagsEnum flag); |
94 | }; |
95 | |
96 | // Construct set functions for all flags |
97 | |
98 | #define FLAG_MEMBER_SET(name) Flag_##name##_set |
99 | #define FLAG_MEMBER_SET_(type, name) inline JVMFlag::Error FLAG_MEMBER_SET(name)(type |
---|