Revert "Revert "Fix issue with proxy invocation on default methods""

This reverts commit daf58c80d42f024aae0cb94ebd2c0bd61ebbf240.

Bug: 27621360
Change-Id: I56fccf19ae80451be4c316ba14911c667cbe9e47
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 24986253..7005aa5 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -653,13 +653,13 @@
   JValue tmp_value;
   ShadowFrame* deopt_frame = self->PopStackedShadowFrame(
       StackedShadowFrameType::kSingleFrameDeoptimizationShadowFrame, false);
-  const DexFile::CodeItem* code_item = method->GetCodeItem();
-  DCHECK(code_item != nullptr) << PrettyMethod(method);
   ManagedStack fragment;
 
   DCHECK(!method->IsNative()) << PrettyMethod(method);
   uint32_t shorty_len = 0;
-  auto* non_proxy_method = method->GetInterfaceMethodIfProxy(sizeof(void*));
+  ArtMethod* non_proxy_method = method->GetInterfaceMethodIfProxy(sizeof(void*));
+  const DexFile::CodeItem* code_item = non_proxy_method->GetCodeItem();
+  DCHECK(code_item != nullptr) << PrettyMethod(method);
   const char* shorty = non_proxy_method->GetShorty(&shorty_len);
 
   JValue result;