OSDN Git Service

Check for constructor first when installing tracing stubs.
authorJeff Hao <jeffhao@google.com>
Tue, 19 Aug 2014 17:17:36 +0000 (10:17 -0700)
committerJeff Hao <jeffhao@google.com>
Tue, 19 Aug 2014 17:30:49 +0000 (10:30 -0700)
Addresses comments in
https://android-review.googlesource.com/#/c/104383/ made after the commit.

Bug: 16386215

(cherry picked from commit 5afe466c027c6ac821bf7c9a88cd7de5260a639b)

Change-Id: Ic81161d0b96a0633c4c534a93172cff59312fa61

runtime/instrumentation.cc

index d5c6e4f..47d35f3 100644 (file)
@@ -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.<init>.
+  // Don't stub Proxy.<init>. 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;