src/share/vm/interpreter/linkResolver.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/interpreter/linkResolver.cpp Mon Mar 31 12:03:57 2014
--- new/src/share/vm/interpreter/linkResolver.cpp Mon Mar 31 12:03:56 2014
*** 241,251 ****
--- 241,252 ----
// According to JVM spec. $5.4.3c & $5.4.3d
// Look up method in klasses, including static methods
// Then look up local default methods
void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS) {
Method* result_oop = klass->uncached_lookup_method(name, signature);
+ // Ignore overpasses so statics can be found during resolution
+ Method* result_oop = klass->uncached_lookup_method(name, signature, true);
// JDK 8, JVMS 5.4.3.4: Interface method resolution should
// ignore static and non-public methods of java.lang.Object,
// like clone, finalize, registerNatives.
if (in_imethod_resolve &&
*** 254,263 ****
--- 255,270 ----
(result_oop->is_static() || !result_oop->is_public()) &&
result_oop->method_holder() == SystemDictionary::Object_klass()) {
result_oop = NULL;
}
+ // Before considering default methods, check for an overpass in the
+ // current class if a method has not been found.
+ if (result_oop == NULL) {
+ result_oop = InstanceKlass::cast(klass())->find_method(name, signature);
+ }
+
if (result_oop == NULL) {
Array<Method*>* default_methods = InstanceKlass::cast(klass())->default_methods();
if (default_methods != NULL) {
result_oop = InstanceKlass::find_method(default_methods, name, signature);
}
*** 274,288 ****
--- 281,295 ----
}
// returns first instance method
// Looks up method in classes, then looks up local default methods
void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) {
! Method* result_oop = klass->uncached_lookup_method(name, signature, false);
result = methodHandle(THREAD, result_oop);
while (!result.is_null() && result->is_static() && result->method_holder()->super() != NULL) {
KlassHandle super_klass = KlassHandle(THREAD, result->method_holder()->super());
! result = methodHandle(THREAD, super_klass->uncached_lookup_method(name, signature, false));
}
if (result.is_null()) {
Array<Method*>* default_methods = InstanceKlass::cast(klass())->default_methods();
if (default_methods != NULL) {
*** 300,310 ****
--- 307,317 ----
Symbol* signature = resolved_method->signature();
// First check in default method array
if (!resolved_method->is_abstract() &&
(InstanceKlass::cast(klass())->default_methods() != NULL)) {
! int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature, false);
if (index >= 0 ) {
vtable_index = InstanceKlass::cast(klass())->default_vtable_indices()->at(index);
}
}
if (vtable_index == Method::invalid_vtable_index) {
src/share/vm/interpreter/linkResolver.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File