diff -r f41793b5b83f -r 1a7b57d02107 src/hotspot/share/oops/instanceKlass.cpp --- a/src/hotspot/share/oops/instanceKlass.cpp Thu Feb 21 17:50:27 2019 -0800 +++ b/src/hotspot/share/oops/instanceKlass.cpp Thu Feb 21 17:07:35 2019 -0800 @@ -2353,6 +2353,7 @@ #if INCLUDE_JVMTI guarantee(_breakpoints == NULL, "must be"); guarantee(_previous_versions == NULL, "must be"); + _cached_class_file = NULL; #endif _init_thread = NULL; @@ -2509,7 +2510,7 @@ } // deallocate the cached class file - if (_cached_class_file != NULL && !MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) { + if (_cached_class_file != NULL) { os::free(_cached_class_file); _cached_class_file = NULL; } @@ -3970,12 +3971,7 @@ #if INCLUDE_JVMTI JvmtiCachedClassFileData* InstanceKlass::get_cached_class_file() { - if (MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) { - // Ignore the archived class stream data - return NULL; - } else { - return _cached_class_file; - } + return _cached_class_file; } jint InstanceKlass::get_cached_class_file_len() { @@ -3985,19 +3981,4 @@ unsigned char * InstanceKlass::get_cached_class_file_bytes() { return VM_RedefineClasses::get_cached_class_file_bytes(_cached_class_file); } - -#if INCLUDE_CDS -JvmtiCachedClassFileData* InstanceKlass::get_archived_class_data() { - if (DumpSharedSpaces) { - return _cached_class_file; - } else { - assert(this->is_shared(), "class should be shared"); - if (MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) { - return _cached_class_file; - } else { - return NULL; - } - } -} #endif -#endif