Refactor image writer

Aim to have common functions for copying references and pointers.
Required for adding support for faster image fixups.

Test: test-art-host -j32

Bug: 34927277
Bug: 34928633
Change-Id: Ia654efc483b332eea3535570496bfeccd7c635ee
diff --git a/runtime/art_field.h b/runtime/art_field.h
index 75dd981..666ed8a 100644
--- a/runtime/art_field.h
+++ b/runtime/art_field.h
@@ -47,6 +47,10 @@
   void SetDeclaringClass(ObjPtr<mirror::Class> new_declaring_class)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  mirror::CompressedReference<mirror::Object>* GetDeclaringClassAddressWithoutBarrier() {
+    return declaring_class_.AddressWithoutBarrier();
+  }
+
   uint32_t GetAccessFlags() REQUIRES_SHARED(Locks::mutator_lock_);
 
   void SetAccessFlags(uint32_t new_access_flags) REQUIRES_SHARED(Locks::mutator_lock_) {