--- old/src/hotspot/share/classfile/protectionDomainCache.cpp 2018-01-08 14:25:50.098846820 +0100 +++ new/src/hotspot/share/classfile/protectionDomainCache.cpp 2018-01-08 14:25:49.706846833 +0100 @@ -96,6 +96,25 @@ verify_table("Protection Domain Table"); } +oop ProtectionDomainCacheEntry::object() { + return RootAccess::oop_load(literal_addr()); +} + +oop ProtectionDomainEntry::object() { + return _pd_cache->object(); +} + +// The object_no_keepalive() calls peeks at the phantomly reachable oop without +// keeping it alive. This is okay to do in the VM thread state if it is not +// leaked out to become strongly reachable. +oop ProtectionDomainCacheEntry::object_no_keepalive() { + return RootAccess::oop_load(literal_addr()); +} + +oop ProtectionDomainEntry::object_no_keepalive() { + return _pd_cache->object_no_keepalive(); +} + void ProtectionDomainCacheEntry::verify() { guarantee(oopDesc::is_oop(literal()), "must be an oop"); } @@ -113,7 +132,7 @@ ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, Handle protection_domain) { for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) { - if (e->protection_domain() == protection_domain()) { + if (e->object_no_keepalive() == protection_domain()) { return e; } }