From 517a18e43b202b6803a9fe38a3940f6321b9c213 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Jul 2022 11:41:54 +0000 Subject: [PATCH] 8288360: CI: ciInstanceKlass::implementor() is not consistent for well-known classes Backport-of: 50f99c3208fc9f479cc109fb6e73d262e27026a2 --- src/hotspot/share/ci/ciInstanceKlass.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index 04f9eadb1b0..64072b15e25 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -601,8 +601,10 @@ bool ciInstanceKlass::is_leaf_type() { ciInstanceKlass* ciInstanceKlass::implementor() { ciInstanceKlass* impl = _implementor; if (impl == NULL) { - // Go into the VM to fetch the implementor. - { + if (is_shared()) { + impl = this; // assume a well-known interface never has a unique implementor + } else { + // Go into the VM to fetch the implementor. VM_ENTRY_MARK; MutexLocker ml(Compile_lock); Klass* k = get_instanceKlass()->implementor(); @@ -616,9 +618,7 @@ ciInstanceKlass* ciInstanceKlass::implementor() { } } // Memoize this result. - if (!is_shared()) { - _implementor = impl; - } + _implementor = impl; } return impl; }