< prev index next >
src/share/vm/oops/instanceKlass.cpp
Print this page
*** 39,48 ****
--- 39,49 ----
#include "jvmtifiles/jvmti.h"
#include "logging/log.hpp"
#include "memory/heapInspection.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/metadataFactory.hpp"
+ #include "memory/metaspaceShared.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/fieldStreams.hpp"
#include "oops/instanceClassLoaderKlass.hpp"
#include "oops/instanceKlass.inline.hpp"
*** 1970,1984 ****
for (int i = 0; i < methods()->length(); i++) {
Method* m = methods()->at(i);
m->remove_unshareable_info();
}
- // cached_class_file might be pointing to a malloc'ed buffer allocated by
- // event-based tracing code at CDS dump time. It's not usable at runtime
- // so let's clear it.
- set_cached_class_file(NULL);
-
// do array classes also.
array_klasses_do(remove_unshareable_in_class);
}
static void restore_unshareable_in_class(Klass* k, TRAPS) {
--- 1971,1980 ----
*** 3651,3663 ****
--- 3647,3679 ----
Method* method = holder->method_with_orig_idnum(idnum);
return method;
}
#if INCLUDE_JVMTI
+ JvmtiCachedClassFileData* InstanceKlass::get_cached_class_file() {
+ if (MetaspaceShared::is_in_shared_space(_cached_class_file)) {
+ // Ignore the archived class stream data
+ return NULL;
+ } else {
+ return _cached_class_file;
+ }
+ }
+
jint InstanceKlass::get_cached_class_file_len() {
return VM_RedefineClasses::get_cached_class_file_len(_cached_class_file);
}
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() {
+ assert(this->is_shared(), "class is not shared");
+ if (MetaspaceShared::is_in_shared_space(_cached_class_file)) {
+ return _cached_class_file;
+ } else {
+ return NULL;
+ }
+ }
+ #endif
#endif
< prev index next >