mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8227467: Better class method invocations
Reviewed-by: thartmann, dholmes, ahgross
This commit is contained in:
parent
72c7b49b0a
commit
2ea157fee1
3 changed files with 4 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue