DESIGN DOC: https://wiki.openjdk.java.net/display/HotSpot/HotSpot+Command-Line+Flags+Overhaul+-+Design+Doc
(The below description is a bit out-dated. Will fix soon. For now please refer to the link above for motivation and proposed design).
====
Currently all JVM flags are grouped under a giant macro ALL_FLAGS
http://hg.openjdk.java.net/jdk/jdk/file/2fbc66ef1a1d/src/hotspot/share/runtime/globals.hpp#l2539
This is very hard to maintain. Erik Österlund and Stefan Karlsson have suggested a new design where flags can be individually maintain by different modules. The basic idea is to declare a flag like this in a header file:
extern int SomeFlag;
and then define the flag in a C file:
int SomeFlag = initial_val;
ProductFlag Flag_SomeFlag("SomeFlag, &SomeFlag, .....);
We can build up a list of all the ProductFlags in the VM (using C++ static initialization) for command-line processing, etc.
class ProductFlag {
static ProductFlag* _head;
ProductFlag* _next;
void* _value_addr;
char* _name;
public:
ProductFlag(char* name, void* valid_addr, ...) {
_name = name;
_value_addr = value_addr;
_next = _head;
_head = this;
...
}
};
This list will replace the flagTable[] in
http://hg.openjdk.java.net/jdk/jdk/file/2fbc66ef1a1d/src/hotspot/share/runtime/flags/jvmFlag.cpp#l825
(The below description is a bit out-dated. Will fix soon. For now please refer to the link above for motivation and proposed design).
====
Currently all JVM flags are grouped under a giant macro ALL_FLAGS
http://hg.openjdk.java.net/jdk/jdk/file/2fbc66ef1a1d/src/hotspot/share/runtime/globals.hpp#l2539
This is very hard to maintain. Erik Österlund and Stefan Karlsson have suggested a new design where flags can be individually maintain by different modules. The basic idea is to declare a flag like this in a header file:
extern int SomeFlag;
and then define the flag in a C file:
int SomeFlag = initial_val;
ProductFlag Flag_SomeFlag("SomeFlag, &SomeFlag, .....);
We can build up a list of all the ProductFlags in the VM (using C++ static initialization) for command-line processing, etc.
class ProductFlag {
static ProductFlag* _head;
ProductFlag* _next;
void* _value_addr;
char* _name;
public:
ProductFlag(char* name, void* valid_addr, ...) {
_name = name;
_value_addr = value_addr;
_next = _head;
_head = this;
...
}
};
This list will replace the flagTable[] in
http://hg.openjdk.java.net/jdk/jdk/file/2fbc66ef1a1d/src/hotspot/share/runtime/flags/jvmFlag.cpp#l825
- relates to
-
JDK-8243205 Modularize JVM flags declaration
- Resolved
-
JDK-7123237 Hotspot command line switches should have multiple type attributes
- Closed
-
JDK-8237807 Store command-line flags in a hashtable
- Closed
-
JDK-8245226 Clean-up FlagSetting and remove misuse.
- Resolved
-
JDK-7123237 Hotspot command line switches should have multiple type attributes
- Closed
-
JDK-8236606 Generate source code for the JVMFlag::flags table
- Closed
(1 relates to)