8227467: Better class method invocations

Reviewed-by: thartmann, dholmes, ahgross
This commit is contained in:
Vladimir Ivanov 2019-12-03 19:31:20 +03:00
parent 72c7b49b0a
commit 2ea157fee1
3 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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<Method*>* 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,