--- old/src/share/vm/classfile/classLoaderData.cpp 2017-06-29 15:57:09.847363665 -0700 +++ new/src/share/vm/classfile/classLoaderData.cpp 2017-06-29 15:57:09.655356283 -0700 @@ -593,7 +593,6 @@ } Metaspace* ClassLoaderData::metaspace_non_null() { - assert(!DumpSharedSpaces, "wrong metaspace!"); // If the metaspace has not been allocated, create a new one. Might want // to create smaller arena for Reflection class loaders also. // The reason for the delayed allocation is because some class loaders are @@ -1126,37 +1125,6 @@ #endif } -// CDS support - -// Global metaspaces for writing information to the shared archive. When -// application CDS is supported, we may need one per metaspace, so this -// sort of looks like it. -Metaspace* ClassLoaderData::_ro_metaspace = NULL; -Metaspace* ClassLoaderData::_rw_metaspace = NULL; -static bool _shared_metaspaces_initialized = false; - -// Initialize shared metaspaces (change to call from somewhere not lazily) -void ClassLoaderData::initialize_shared_metaspaces() { - assert(DumpSharedSpaces, "only use this for dumping shared spaces"); - assert(this == ClassLoaderData::the_null_class_loader_data(), - "only supported for null loader data for now"); - assert (!_shared_metaspaces_initialized, "only initialize once"); - MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); - _ro_metaspace = new Metaspace(_metaspace_lock, Metaspace::ROMetaspaceType); - _rw_metaspace = new Metaspace(_metaspace_lock, Metaspace::ReadWriteMetaspaceType); - _shared_metaspaces_initialized = true; -} - -Metaspace* ClassLoaderData::ro_metaspace() { - assert(_ro_metaspace != NULL, "should already be initialized"); - return _ro_metaspace; -} - -Metaspace* ClassLoaderData::rw_metaspace() { - assert(_rw_metaspace != NULL, "should already be initialized"); - return _rw_metaspace; -} - ClassLoaderDataGraphKlassIteratorAtomic::ClassLoaderDataGraphKlassIteratorAtomic() : _next_klass(NULL) { ClassLoaderData* cld = ClassLoaderDataGraph::_head;