8184323: compile-time guard some UseSharedSpaces-only coding with the INCLUDE_CDS macro

Reviewed-by: jiangli, shade, simonis
This commit is contained in:
Matthias Baesken 2017-07-18 15:46:04 -04:00
parent 62da378f03
commit cf1044d114
5 changed files with 25 additions and 5 deletions

View file

@ -2122,12 +2122,15 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
// Preload commonly used klasses
WKID scan = FIRST_WKID;
// first do Object, then String, Class
#if INCLUDE_CDS
if (UseSharedSpaces) {
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass), scan, CHECK);
// Initialize the constant pool for the Object_class
Object_klass()->constants()->restore_unshareable_info(CHECK);
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
} else {
} else
#endif
{
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
}