Ensure proxy constructor is in dex cache
Bug: 17262039
(cherry picked from commit ae94e350f100207359b8345d8d21e78e7cfb44c4)
Change-Id: I1cfc8dac1f63b9012fa098804135be8847b1daee
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index c2a3ab7..e18c0d7 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3651,6 +3651,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));