diff options
author | Ian Rogers <irogers@google.com> | 2014-10-28 18:12:55 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-10-28 18:36:32 -0700 |
commit | ded66a01f81812e0129d17c3d08d5eda18433062 (patch) | |
tree | 74a3f7bad1c020b0136d6c173633a361a479f5cb /runtime/class_linker.cc | |
parent | e0205d519dd417f749243b42b8711dfa313e5390 (diff) | |
download | android_art-ded66a01f81812e0129d17c3d08d5eda18433062.tar.gz android_art-ded66a01f81812e0129d17c3d08d5eda18433062.tar.bz2 android_art-ded66a01f81812e0129d17c3d08d5eda18433062.zip |
Move MethodHelper::GetReturnType to mirror::ArtMethod.
Also, fix missing handle in HasSameSignatureWithDifferentClassLoaders.
Change-Id: I9e1ffd09be950ecc8346fc3c485760d82d9ecab3
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index a6ff530760..e4d9baaff4 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4051,13 +4051,10 @@ static void CheckProxyMethod(Handle<mirror::ArtMethod> method, CHECK(prototype->HasSameDexCacheResolvedTypes(method.Get())); CHECK_EQ(prototype->GetDexMethodIndex(), method->GetDexMethodIndex()); - StackHandleScope<2> hs(Thread::Current()); - MethodHelper mh(hs.NewHandle(method.Get())); - MethodHelper mh2(hs.NewHandle(prototype.Get())); CHECK_STREQ(method->GetName(), prototype->GetName()); CHECK_STREQ(method->GetShorty(), prototype->GetShorty()); // More complex sanity - via dex cache - CHECK_EQ(mh.GetReturnType(), mh2.GetReturnType()); + CHECK_EQ(method->GetInterfaceMethodIfProxy()->GetReturnType(), prototype->GetReturnType()); } static bool CanWeInitializeClass(mirror::Class* klass, bool can_init_statics, @@ -4322,7 +4319,8 @@ bool ClassLinker::ValidateSuperClassDescriptors(Handle<mirror::Class> klass) { return true; } // Begin with the methods local to the superclass. - StackHandleScope<2> hs(Thread::Current()); + Thread* self = Thread::Current(); + StackHandleScope<2> hs(self); MutableMethodHelper mh(hs.NewHandle<mirror::ArtMethod>(nullptr)); MutableMethodHelper super_mh(hs.NewHandle<mirror::ArtMethod>(nullptr)); if (klass->HasSuperClass() && @@ -4331,7 +4329,7 @@ bool ClassLinker::ValidateSuperClassDescriptors(Handle<mirror::Class> klass) { mh.ChangeMethod(klass->GetVTableEntry(i)); super_mh.ChangeMethod(klass->GetSuperClass()->GetVTableEntry(i)); if (mh.GetMethod() != super_mh.GetMethod() && - !mh.HasSameSignatureWithDifferentClassLoaders(&super_mh)) { + !mh.HasSameSignatureWithDifferentClassLoaders(self, &super_mh)) { ThrowLinkageError(klass.Get(), "Class %s method %s resolves differently in superclass %s", PrettyDescriptor(klass.Get()).c_str(), @@ -4348,7 +4346,7 @@ bool ClassLinker::ValidateSuperClassDescriptors(Handle<mirror::Class> klass) { mh.ChangeMethod(klass->GetIfTable()->GetMethodArray(i)->GetWithoutChecks(j)); super_mh.ChangeMethod(klass->GetIfTable()->GetInterface(i)->GetVirtualMethod(j)); if (mh.GetMethod() != super_mh.GetMethod() && - !mh.HasSameSignatureWithDifferentClassLoaders(&super_mh)) { + !mh.HasSameSignatureWithDifferentClassLoaders(self, &super_mh)) { ThrowLinkageError(klass.Get(), "Class %s method %s resolves differently in interface %s", PrettyDescriptor(klass.Get()).c_str(), |