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_method.h b/runtime/art_method.h
index 8f09cc6..51b6576 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -73,6 +73,10 @@
   ALWAYS_INLINE mirror::Class* GetDeclaringClassUnchecked()
       REQUIRES_SHARED(Locks::mutator_lock_);
 
+  mirror::CompressedReference<mirror::Object>* GetDeclaringClassAddressWithoutBarrier() {
+    return declaring_class_.AddressWithoutBarrier();
+  }
+
   void SetDeclaringClass(ObjPtr<mirror::Class> new_declaring_class)
       REQUIRES_SHARED(Locks::mutator_lock_);