< prev index next >
src/hotspot/share/oops/instanceKlass.cpp
Print this page
*** 1767,1777 ****
}
// find_method looks up the name/signature in the local methods array
Method* InstanceKlass::find_method(const Symbol* name,
const Symbol* signature) const {
! return find_method_impl(name, signature, find_overpass, find_static, find_private);
}
Method* InstanceKlass::find_method_impl(const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
--- 1767,1780 ----
}
// find_method looks up the name/signature in the local methods array
Method* InstanceKlass::find_method(const Symbol* name,
const Symbol* signature) const {
! return find_method_impl(name, signature,
! OverpassLookupMode::find_overpass,
! StaticLookupMode::find_static,
! PrivateLookupMode::find_private);
}
Method* InstanceKlass::find_method_impl(const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
*** 1792,1803 ****
const Symbol* signature,
PrivateLookupMode private_mode) {
Method* const meth = InstanceKlass::find_method_impl(methods,
name,
signature,
! find_overpass,
! skip_static,
private_mode);
assert(((meth == NULL) || !meth->is_static()),
"find_instance_method should have skipped statics");
return meth;
}
--- 1795,1806 ----
const Symbol* signature,
PrivateLookupMode private_mode) {
Method* const meth = InstanceKlass::find_method_impl(methods,
name,
signature,
! OverpassLookupMode::find_overpass,
! StaticLookupMode::skip_static,
private_mode);
assert(((meth == NULL) || !meth->is_static()),
"find_instance_method should have skipped statics");
return meth;
}
*** 1851,1863 ****
const Symbol* name,
const Symbol* signature) {
return InstanceKlass::find_method_impl(methods,
name,
signature,
! find_overpass,
! find_static,
! find_private);
}
Method* InstanceKlass::find_method_impl(const Array<Method*>* methods,
const Symbol* name,
const Symbol* signature,
--- 1854,1866 ----
const Symbol* name,
const Symbol* signature) {
return InstanceKlass::find_method_impl(methods,
name,
signature,
! OverpassLookupMode::find_overpass,
! StaticLookupMode::find_static,
! PrivateLookupMode::find_private);
}
Method* InstanceKlass::find_method_impl(const Array<Method*>* methods,
const Symbol* name,
const Symbol* signature,
*** 1896,1908 ****
const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
StaticLookupMode static_mode,
PrivateLookupMode private_mode) {
! const bool skipping_overpass = (overpass_mode == skip_overpass);
! const bool skipping_static = (static_mode == skip_static);
! const bool skipping_private = (private_mode == skip_private);
const int hit = quick_search(methods, name);
if (hit != -1) {
const Method* const m = methods->at(hit);
// Do linear search to find matching signature. First, quick check
--- 1899,1911 ----
const Symbol* name,
const Symbol* signature,
OverpassLookupMode overpass_mode,
StaticLookupMode static_mode,
PrivateLookupMode private_mode) {
! const bool skipping_overpass = (overpass_mode == OverpassLookupMode::skip_overpass);
! const bool skipping_static = (static_mode == StaticLookupMode::skip_static);
! const bool skipping_private = (private_mode == PrivateLookupMode::skip_private);
const int hit = quick_search(methods, name);
if (hit != -1) {
const Method* const m = methods->at(hit);
// Do linear search to find matching signature. First, quick check
*** 1974,1990 ****
const Klass* klass = this;
while (klass != NULL) {
Method* const method = InstanceKlass::cast(klass)->find_method_impl(name,
signature,
overpass_local_mode,
! find_static,
private_mode);
if (method != NULL) {
return method;
}
klass = klass->super();
! overpass_local_mode = skip_overpass; // Always ignore overpass methods in superclasses
}
return NULL;
}
#ifdef ASSERT
--- 1977,1993 ----
const Klass* klass = this;
while (klass != NULL) {
Method* const method = InstanceKlass::cast(klass)->find_method_impl(name,
signature,
overpass_local_mode,
! StaticLookupMode::find_static,
private_mode);
if (method != NULL) {
return method;
}
klass = klass->super();
! overpass_local_mode = OverpassLookupMode::skip_overpass; // Always ignore overpass methods in superclasses
}
return NULL;
}
#ifdef ASSERT
*** 2010,2020 ****
if (default_methods() != NULL) {
m = find_method(default_methods(), name, signature);
}
// Look up interfaces
if (m == NULL) {
! m = lookup_method_in_all_interfaces(name, signature, find_defaults);
}
return m;
}
// lookup a method in all the interfaces that this class implements
--- 2013,2023 ----
if (default_methods() != NULL) {
m = find_method(default_methods(), name, signature);
}
// Look up interfaces
if (m == NULL) {
! m = lookup_method_in_all_interfaces(name, signature, DefaultsLookupMode::find_defaults);
}
return m;
}
// lookup a method in all the interfaces that this class implements
*** 2028,2038 ****
InstanceKlass *ik = NULL;
for (int i = 0; i < num_ifs; i++) {
ik = all_ifs->at(i);
Method* m = ik->lookup_method(name, signature);
if (m != NULL && m->is_public() && !m->is_static() &&
! ((defaults_mode != skip_defaults) || !m->is_default_method())) {
return m;
}
}
return NULL;
}
--- 2031,2041 ----
InstanceKlass *ik = NULL;
for (int i = 0; i < num_ifs; i++) {
ik = all_ifs->at(i);
Method* m = ik->lookup_method(name, signature);
if (m != NULL && m->is_public() && !m->is_static() &&
! ((defaults_mode != DefaultsLookupMode::skip_defaults) || !m->is_default_method())) {
return m;
}
}
return NULL;
}
< prev index next >