Ensure proxy constructor is in dex cache

Bug: 17262039

Change-Id: I879341fa9c66f18ec64d6d4bf6a222a452c27739
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 4123fc6..d8f01db 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3776,6 +3776,10 @@
       proxy_class->GetDirectMethods();
   CHECK_EQ(proxy_direct_methods->GetLength(), 16);
   mirror::ArtMethod* proxy_constructor = proxy_direct_methods->Get(2);
+  // Ensure constructor is in dex cache so that we can use the dex cache to look up the overridden
+  // constructor method.
+  proxy_class->GetDexCache()->SetResolvedMethod(proxy_constructor->GetDexMethodIndex(),
+                                                proxy_constructor);
   // Clone the existing constructor of Proxy (our constructor would just invoke it so steal its
   // code_ too)
   mirror::ArtMethod* constructor = down_cast<mirror::ArtMethod*>(proxy_constructor->Clone(self));