--- old/src/hotspot/share/oops/instanceKlass.cpp 2018-03-05 10:57:02.908223615 -0500 +++ new/src/hotspot/share/oops/instanceKlass.cpp 2018-03-05 10:57:02.620217610 -0500 @@ -888,11 +888,22 @@ } } + // Step 8 + // Initialize classes of flattenable fields + { + for (AllFieldStream fs(this); !fs.done(); fs.next()) { + if (fs.is_flattenable()) { + InstanceKlass* field_klass = InstanceKlass::cast(this->get_value_field_klass(fs.index())); + field_klass->initialize(CHECK); + } + } + } + // Look for aot compiled methods for this klass, including class initializer. AOTLoader::load_for_klass(this, THREAD); - // Step 8 + // Step 9 { assert(THREAD->is_Java_thread(), "non-JavaThread in initialize_impl"); JavaThread* jt = (JavaThread*)THREAD; @@ -908,7 +919,7 @@ call_class_initializer(THREAD); } - // Step 9 + // Step 10 if (!HAS_PENDING_EXCEPTION) { set_initialization_state_and_notify(fully_initialized, CHECK); { @@ -916,7 +927,7 @@ } } else { - // Step 10 and 11 + // Step 11 and 12 Handle e(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; // JVMTI has already reported the pending exception