--- a/hotspot/src/share/vm/oops/instanceKlass.hpp Wed Sep 07 15:21:45 2016 +0200
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp Wed Sep 07 15:25:21 2016 -0400
@@ -709,6 +709,7 @@
// RedefineClasses() support for previous versions:
void add_previous_version(instanceKlassHandle ikh, int emcp_method_count);
+ void purge_previous_version_list();
InstanceKlass* previous_versions() const { return _previous_versions; }
#else
@@ -768,10 +769,15 @@
}
private:
- static int _previous_version_count;
+ static bool _has_previous_versions;
public:
- static void purge_previous_versions(InstanceKlass* ik);
- static bool has_previous_versions() { return _previous_version_count > 0; }
+ static void purge_previous_versions(InstanceKlass* ik) {
+ if (ik->has_been_redefined()) {
+ ik->purge_previous_version_list();
+ }
+ }
+
+ static bool has_previous_versions_and_reset();
// JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
void set_cached_class_file(JvmtiCachedClassFileData *data) {
@@ -792,7 +798,7 @@
#else // INCLUDE_JVMTI
static void purge_previous_versions(InstanceKlass* ik) { return; };
- static bool has_previous_versions() { return false; }
+ static bool has_previous_versions_and_reset() { return false; }
void set_cached_class_file(JvmtiCachedClassFileData *data) {
assert(data == NULL, "unexpected call with JVMTI disabled");