Refactor code for unresolved field entrypoint.

- Do macro magic to avoid source code duplication.
- Do not fetch the referrer from the assembly, but
  from the C entrypoint instead.

Test: test-art-host test-art-target

Change-Id: Ib139c94bc8f74686640cad538ba75dc56fa00e1d
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index 25fd727..06c11f5 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -254,5 +254,10 @@
   return result;
 }
 
+ArtMethod* GetCalleeSaveOuterMethod(Thread* self, Runtime::CalleeSaveType type) {
+  ScopedAssertNoThreadSuspension ants(__FUNCTION__);
+  ArtMethod** sp = self->GetManagedStack()->GetTopQuickFrame();
+  return DoGetCalleeSaveMethodOuterCallerAndPc(sp, type).first;
+}
 
 }  // namespace art