--- a/src/hotspot/share/memory/universe.cpp Wed Aug 22 16:06:51 2018 +0100
+++ b/src/hotspot/share/memory/universe.cpp Tue Aug 14 09:59:37 2018 -0700
@@ -517,8 +517,11 @@
// that the number of objects allocated at this point is very small.
assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded");
HandleMark hm(THREAD);
- // Cache the start of the static fields
- InstanceMirrorKlass::init_offset_of_static_fields();
+
+ if (!UseSharedSpaces) {
+ // Cache the start of the static fields
+ InstanceMirrorKlass::init_offset_of_static_fields();
+ }
GrowableArray <Klass*>* list = java_lang_Class::fixup_mirror_list();
int list_length = list->length();