--- old/src/hotspot/share/classfile/systemDictionary.cpp 2018-02-26 15:31:28.425659543 -0800 +++ new/src/hotspot/share/classfile/systemDictionary.cpp 2018-02-26 15:31:28.172635704 -0800 @@ -1059,12 +1059,19 @@ #if INCLUDE_CDS ResourceMark rm(THREAD); if (DumpSharedSpaces && !class_loader.is_null() && - !UseAppCDS && strcmp(class_name->as_C_string(), "Unnamed") != 0) { - // If AppCDS is not enabled, don't define the class at dump time (except for the "Unnamed" - // class, which is used by MethodHandles). + !UseAppCDS && (strcmp(class_name->as_C_string(), "Unnamed") != 0) + // If AppCDS is not enabled, don't define the class at dump time (except for the "Unnamed" + // class, which is used by MethodHandles). +#if INCLUDE_JVMCI + // Need to define the class if force initialization of JVMCI runtime. Otherwise the of the + // JVMCI class will result in ClassNotFoundException. + && !Arguments::is_force_init_jvmci_runtime()) { +#else + ) { +#endif // INCLUDE_JVMCI THROW_MSG_NULL(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string()); } -#endif +#endif // INCLUDE_CDS HandleMark hm(THREAD);