From 2ea157fee1b9c77bf87b5e617b6c2477cfde3e95 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Tue, 3 Dec 2019 19:31:20 +0300 Subject: [PATCH] 8227467: Better class method invocations Reviewed-by: thartmann, dholmes, ahgross --- src/hotspot/share/classfile/javaClasses.cpp | 2 +- src/hotspot/share/code/dependencies.cpp | 2 +- src/hotspot/share/oops/instanceKlass.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index 8035b3ccd2d..db1a629a4dc 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -3162,7 +3162,7 @@ oop java_lang_reflect_RecordComponent::create(InstanceKlass* holder, RecordCompo char* sig = NEW_RESOURCE_ARRAY(char, sig_len); jio_snprintf(sig, sig_len, "%c%c%s", JVM_SIGNATURE_FUNC, JVM_SIGNATURE_ENDFUNC, type->as_C_string()); TempNewSymbol full_sig = SymbolTable::new_symbol(sig); - accessor_method = holder->find_instance_method(name, full_sig); + accessor_method = holder->find_instance_method(name, full_sig, Klass::find_private); } if (accessor_method != NULL) { diff --git a/src/hotspot/share/code/dependencies.cpp b/src/hotspot/share/code/dependencies.cpp index d9c1f471ac5..04cfbc90058 100644 --- a/src/hotspot/share/code/dependencies.cpp +++ b/src/hotspot/share/code/dependencies.cpp @@ -1207,7 +1207,7 @@ class ClassHierarchyWalker { ClassHierarchyWalker wf(_participants, _num_participants); Klass* w = wf.find_witness_subtype(k); if (w != NULL) { - Method* wm = InstanceKlass::cast(w)->find_instance_method(_name, _signature); + Method* wm = InstanceKlass::cast(w)->find_instance_method(_name, _signature, Klass::skip_private); if (!Dependencies::is_concrete_method(wm, w)) { // Found a concrete subtype 'w' which does not override abstract method 'm'. // Bail out because 'm' could be called with 'w' as receiver (leading to an diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index 6f5345ac4e2..93c3d6dcc57 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -610,11 +610,11 @@ public: // find a local method, but skip static methods Method* find_instance_method(const Symbol* name, const Symbol* signature, - PrivateLookupMode private_mode = find_private) const; + PrivateLookupMode private_mode) const; static Method* find_instance_method(const Array* methods, const Symbol* name, const Symbol* signature, - PrivateLookupMode private_mode = find_private); + PrivateLookupMode private_mode); // find a local method (returns NULL if not found) Method* find_local_method(const Symbol* name,