--- old/src/hotspot/share/classfile/dictionary.cpp 2020-08-05 15:53:49.334198514 -0700 +++ new/src/hotspot/share/classfile/dictionary.cpp 2020-08-05 15:53:48.982185264 -0700 @@ -321,6 +321,16 @@ return (entry != NULL) ? entry->instance_klass() : NULL; } +InstanceKlass* Dictionary::replace_class(int index, unsigned hash, + Symbol* name, InstanceKlass* k) { + DictionaryEntry* entry = get_entry(index, hash, name); + assert(entry != NULL, "InstanceKlass k should exist in dictionary"); + + InstanceKlass** addr = entry->klass_addr(); + InstanceKlass* old = *addr; + *addr = k; + return old; +} void Dictionary::add_protection_domain(int index, unsigned int hash, InstanceKlass* klass,