mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
Merge
This commit is contained in:
commit
3bbda04f98
466 changed files with 20319 additions and 9994 deletions
|
@ -1434,6 +1434,12 @@ Method* InstanceKlass::find_instance_method(
|
|||
return meth;
|
||||
}
|
||||
|
||||
// find_instance_method looks up the name/signature in the local methods array
|
||||
// and skips over static methods
|
||||
Method* InstanceKlass::find_instance_method(Symbol* name, Symbol* signature) {
|
||||
return InstanceKlass::find_instance_method(methods(), name, signature);
|
||||
}
|
||||
|
||||
// find_method looks up the name/signature in the local methods array
|
||||
Method* InstanceKlass::find_method(
|
||||
Array<Method*>* methods, Symbol* name, Symbol* signature) {
|
||||
|
@ -1446,6 +1452,12 @@ Method* InstanceKlass::find_method_impl(
|
|||
return hit >= 0 ? methods->at(hit): NULL;
|
||||
}
|
||||
|
||||
bool InstanceKlass::method_matches(Method* m, Symbol* signature, bool skipping_overpass, bool skipping_static) {
|
||||
return (m->signature() == signature) &&
|
||||
(!skipping_overpass || !m->is_overpass()) &&
|
||||
(!skipping_static || !m->is_static());
|
||||
}
|
||||
|
||||
// Used directly for default_methods to find the index into the
|
||||
// default_vtable_indices, and indirectly by find_method
|
||||
// find_method_index looks in the local methods array to return the index
|
||||
|
@ -1460,13 +1472,10 @@ int InstanceKlass::find_method_index(
|
|||
int hit = binary_search(methods, name);
|
||||
if (hit != -1) {
|
||||
Method* m = methods->at(hit);
|
||||
|
||||
// Do linear search to find matching signature. First, quick check
|
||||
// for common case, ignoring overpasses if requested.
|
||||
if ((m->signature() == signature) &&
|
||||
(!skipping_overpass || !m->is_overpass()) &&
|
||||
(!skipping_static || !m->is_static())) {
|
||||
return hit;
|
||||
}
|
||||
if (method_matches(m, signature, skipping_overpass, skipping_static)) return hit;
|
||||
|
||||
// search downwards through overloaded methods
|
||||
int i;
|
||||
|
@ -1474,22 +1483,14 @@ int InstanceKlass::find_method_index(
|
|||
Method* m = methods->at(i);
|
||||
assert(m->is_method(), "must be method");
|
||||
if (m->name() != name) break;
|
||||
if ((m->signature() == signature) &&
|
||||
(!skipping_overpass || !m->is_overpass()) &&
|
||||
(!skipping_static || !m->is_static())) {
|
||||
return i;
|
||||
}
|
||||
if (method_matches(m, signature, skipping_overpass, skipping_static)) return i;
|
||||
}
|
||||
// search upwards
|
||||
for (i = hit + 1; i < methods->length(); ++i) {
|
||||
Method* m = methods->at(i);
|
||||
assert(m->is_method(), "must be method");
|
||||
if (m->name() != name) break;
|
||||
if ((m->signature() == signature) &&
|
||||
(!skipping_overpass || !m->is_overpass()) &&
|
||||
(!skipping_static || !m->is_static())) {
|
||||
return i;
|
||||
}
|
||||
if (method_matches(m, signature, skipping_overpass, skipping_static)) return i;
|
||||
}
|
||||
// not found
|
||||
#ifdef ASSERT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue