mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8165246: [REDO] InstanceKlass::_previous_version_count goes negative
Make _has_previous_version a boolean that is set to true when previous version of a class is added or during class unloading call to purge_previous_versions Reviewed-by: gtriantafill, dcubed, sspitsyn
This commit is contained in:
parent
be0d2c98ed
commit
3c2621dbdd
4 changed files with 235 additions and 80 deletions
|
@ -709,6 +709,7 @@ class InstanceKlass: public Klass {
|
|||
|
||||
// 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 @@ public:
|
|||
}
|
||||
|
||||
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 @@ public:
|
|||
#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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue