From 5afe466c027c6ac821bf7c9a88cd7de5260a639b Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Tue, 19 Aug 2014 10:17:36 -0700 Subject: [PATCH] Check for constructor first when installing tracing stubs. Addresses comments in https://android-review.googlesource.com/#/c/104383/ made after the commit. Bug: 16386215 Change-Id: I0e59b8507f601fd6508fbda8d24dd3c98ead1537 --- runtime/instrumentation.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc index 9c6f8c4ef..5988d71f4 100644 --- a/runtime/instrumentation.cc +++ b/runtime/instrumentation.cc @@ -121,11 +121,9 @@ void Instrumentation::InstallStubsForMethod(mirror::ArtMethod* method) { // Do not change stubs for these methods. return; } - std::string temp; - // Note that the Proxy class itself is not a proxy class. - if (strcmp(method->GetDeclaringClass()->GetDescriptor(&temp), "Ljava/lang/reflect/Proxy;") == 0 && - method->IsConstructor()) { - // Do not stub Proxy.. + // Don't stub Proxy.. Note that the Proxy class itself is not a proxy class. + if (method->IsConstructor() && + method->GetDeclaringClass()->DescriptorEquals("Ljava/lang/reflect/Proxy;")) { return; } const void* new_portable_code; -- 2.11.0