Currently, many CDS operations are guarded by various global variables, such as DumpSharedSpaces and DynamicDumpSharedSpaces. There are also ad-hoc capabilities function like HeapShared::can_write(). So we have code like this where it's not clean what the intended condition us.
if (DumpSharedSpaces && HeapShared::can_write()) {
_narrow_oop_mode = CompressedOops::mode();
_narrow_oop_base = CompressedOops::base();
_narrow_oop_shift = CompressedOops::shift();
}
We should have higher-level functions for checking/setting CDS configuration. E.g.,
if (CDSConfig::is_dumping_heap()) {
_narrow_oop_mode = CompressedOops::mode();
_narrow_oop_base = CompressedOops::base();
_narrow_oop_shift = CompressedOops::shift();
}
In Leyden, we are implementing more capabilities in CDS that need to be conditionalized, so a more coherent set of configuration API is needed.
This RFE is to upstream the relevant part of the CDSConfig API from the Leyden repo to the mainline JDK repo:
https://github.com/openjdk/leyden/blob/7fe445527b18ae72da0848ea8a4792fc305181ad/src/hotspot/share/cds/cdsConfig.hpp
=============
Note: today we have a few high-level functions like Arguments::is_dumping_archive().
https://github.com/openjdk/jdk/blob/e25a49a993f270c33f7929e629fb3075a11fdec9/src/hotspot/share/runtime/arguments.hpp#L528-L532
For better modularity, these function should be moved to a new class.
To simplify review, this RFE is divided into multiple sub tasks.
if (DumpSharedSpaces && HeapShared::can_write()) {
_narrow_oop_mode = CompressedOops::mode();
_narrow_oop_base = CompressedOops::base();
_narrow_oop_shift = CompressedOops::shift();
}
We should have higher-level functions for checking/setting CDS configuration. E.g.,
if (CDSConfig::is_dumping_heap()) {
_narrow_oop_mode = CompressedOops::mode();
_narrow_oop_base = CompressedOops::base();
_narrow_oop_shift = CompressedOops::shift();
}
In Leyden, we are implementing more capabilities in CDS that need to be conditionalized, so a more coherent set of configuration API is needed.
This RFE is to upstream the relevant part of the CDSConfig API from the Leyden repo to the mainline JDK repo:
https://github.com/openjdk/leyden/blob/7fe445527b18ae72da0848ea8a4792fc305181ad/src/hotspot/share/cds/cdsConfig.hpp
=============
Note: today we have a few high-level functions like Arguments::is_dumping_archive().
https://github.com/openjdk/jdk/blob/e25a49a993f270c33f7929e629fb3075a11fdec9/src/hotspot/share/runtime/arguments.hpp#L528-L532
For better modularity, these function should be moved to a new class.
To simplify review, this RFE is divided into multiple sub tasks.
1.
|
Initial version of cdsConfig.hpp | Resolved | Ioi Lam | ||
2.
|
Remove DynamicDumpSharedSpaces | Resolved | Ioi Lam | ||
3.
|
Refactor MetaspaceShared::use_full_module_graph() | Resolved | Ioi Lam | ||
4.
|
Remove DumpSharedSpaces | Resolved | Ioi Lam | ||
5.
|
Move CDS config initialization code to cdsConfig.cpp | Resolved | Ioi Lam |