summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-12-15 21:36:16 -0800
committer Ian Rogers <irogers@google.com> 2012-12-15 22:36:34 -0800
commit4c5b265e66bebf890b6f9e53cddeb512774b1613 (patch)
tree8278a6619b4dc4ec6009dcac01cf3fd4046108cb /src
parent2933d538b45cae733349b81a6a1d4a6f4dc9d3ec (diff)
Test and fixes for invoke-interface on java.lang.Object methods.
Bug: 7614818 Change-Id: I704596cf3d36887e6d6d589cb3ec89e31d5b8901
Diffstat (limited to 'src')
-rw-r--r--src/class_linker.cc12
-rw-r--r--src/object.cc6
-rw-r--r--src/object.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc
index ca8a53287a..6fc6a3d5d6 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -3603,11 +3603,11 @@ Class* ClassLinker::ResolveType(const DexFile& dex_file,
}
AbstractMethod* ClassLinker::ResolveMethod(const DexFile& dex_file,
- uint32_t method_idx,
- DexCache* dex_cache,
- ClassLoader* class_loader,
- const AbstractMethod* referrer,
- InvokeType type) {
+ uint32_t method_idx,
+ DexCache* dex_cache,
+ ClassLoader* class_loader,
+ const AbstractMethod* referrer,
+ InvokeType type) {
DCHECK(dex_cache != NULL);
// Check for hit in the dex cache.
AbstractMethod* resolved = dex_cache->GetResolvedMethod(method_idx);
@@ -3630,6 +3630,7 @@ AbstractMethod* ClassLinker::ResolveMethod(const DexFile& dex_file,
break;
case kInterface:
resolved = klass->FindInterfaceMethod(dex_cache, method_idx);
+ DCHECK(resolved == NULL || resolved->GetDeclaringClass()->IsInterface());
break;
case kSuper: // Fall-through.
case kVirtual:
@@ -3649,6 +3650,7 @@ AbstractMethod* ClassLinker::ResolveMethod(const DexFile& dex_file,
break;
case kInterface:
resolved = klass->FindInterfaceMethod(name, signature);
+ DCHECK(resolved == NULL || resolved->GetDeclaringClass()->IsInterface());
break;
case kSuper: // Fall-through.
case kVirtual:
diff --git a/src/object.cc b/src/object.cc
index df42f8cce1..8565c386d7 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -1098,7 +1098,7 @@ AbstractMethod* Class::FindVirtualMethodForInterface(AbstractMethod* method) {
return NULL;
}
-AbstractMethod* Class::FindInterfaceMethod(const StringPiece& name, const StringPiece& signature) const {
+AbstractMethod* Class::FindInterfaceMethod(const StringPiece& name, const StringPiece& signature) const {
// Check the current class before checking the interfaces.
AbstractMethod* method = FindDeclaredVirtualMethod(name, signature);
if (method != NULL) {
@@ -1108,7 +1108,7 @@ AbstractMethod* Class::FindInterfaceMethod(const StringPiece& name, const Strin
int32_t iftable_count = GetIfTableCount();
IfTable* iftable = GetIfTable();
for (int32_t i = 0; i < iftable_count; i++) {
- method = iftable->GetInterface(i)->FindVirtualMethod(name, signature);
+ method = iftable->GetInterface(i)->FindDeclaredVirtualMethod(name, signature);
if (method != NULL) {
return method;
}
@@ -1126,7 +1126,7 @@ AbstractMethod* Class::FindInterfaceMethod(const DexCache* dex_cache, uint32_t d
int32_t iftable_count = GetIfTableCount();
IfTable* iftable = GetIfTable();
for (int32_t i = 0; i < iftable_count; i++) {
- method = iftable->GetInterface(i)->FindVirtualMethod(dex_cache, dex_method_idx);
+ method = iftable->GetInterface(i)->FindDeclaredVirtualMethod(dex_cache, dex_method_idx);
if (method != NULL) {
return method;
}
diff --git a/src/object.h b/src/object.h
index ecd086b9fd..0eea8c38b1 100644
--- a/src/object.h
+++ b/src/object.h
@@ -986,7 +986,7 @@ class MANAGED AbstractMethod : public Object {
ObjectArray<StaticStorageBase>* dex_cache_initialized_static_storage_;
// short cuts to declaring_class_->dex_cache_ member for fast compiled code access
- ObjectArray<Class>* dex_cache_resolved_methods_;
+ ObjectArray<AbstractMethod>* dex_cache_resolved_methods_;
// short cuts to declaring_class_->dex_cache_ member for fast compiled code access
ObjectArray<Class>* dex_cache_resolved_types_;