RFC 8236988 - Modular Design for JVM Flags
Ioi Lam
ioi.lam at oracle.com
Fri Apr 10 00:06:56 UTC 2020
The code for specifying HotSpot command-line flags used to be simple. At
the very beginning it was something like
#define ALL_FLAGS(develop, develop) \
product(int, SomeFlag, def_value, "some doc") \
develop(int, MoreFlag, def_value, "more doc") \
but like all good ideas, it has gradually degraded into a mess [1][2].
It's now very difficult to add any new functionality (e.g., add
"manageable" annotations to the flags [3]).
I think it's time for a complete rewrite :-)
My proposal is here. Please comment if it's a good or bad idea.
https://wiki.openjdk.java.net/display/HotSpot/HotSpot+Command-Line+Flags+Overhaul+-+Design+Doc
tldr; ---
OLD:
product(intx, AliasLevel, 3, \
"0 for no aliasing, 1 for oop/field/static/array split,
" \
"2 for class split, 3 for unique
instances") \
range(0, 3)
/*optional*/ \
constraint(AliasLevelConstraintFunc,AfterErgo) /*optional*/
\
NEW:
PRODUCT_FLAG(intx, AliasLevel, 3, JVMFlag::RANGE | JVMFlag::CONSTRAINT,
"0 for no aliasing, 1 for oop/field/static/array
split, "
"2 for class split, 3 for unique instances");
// optional
FLAG_RANGE( AliasLevel, 0, 3);
// optional
FLAG_CONSTRAINT( AliasLevel, (void*)AliasLevelConstraintFunc,
JVMFlag::AfterErgo);
[1]
http://hg.openjdk.java.net/jdk/jdk/file/7af6364e1792/src/hotspot/share/runtime/globals.hpp#l115
[2]
http://hg.openjdk.java.net/jdk/jdk/file/7af6364e1792/src/hotspot/share/runtime/flags/jvmFlag.cpp#l635
[3] https://bugs.openjdk.java.net/browse/JDK-7123237
Thanks
- Ioi
More information about the hotspot-dev
mailing list