Clean up CodeItemAccessors and Compact/StandardDexFile

Change constructor to use a reference to a dex file.

Remove duplicated logic for GetCodeItemSize.

Bug: 63756964
Test: test-art-host
Change-Id: I69af8b93abdf6bdfa4454e16db8f4e75883bca46
diff --git a/compiler/compiler.cc b/compiler/compiler.cc
index 60977b6..7c7ae71 100644
--- a/compiler/compiler.cc
+++ b/compiler/compiler.cc
@@ -47,7 +47,7 @@
    * Dalvik uses 16-bit uints for instruction and register counts.  We'll limit to a quarter
    * of that, which also guarantees we cannot overflow our 16-bit internal Quick SSA name space.
    */
-  CodeItemDataAccessor accessor(&dex_file, &code_item);
+  CodeItemDataAccessor accessor(dex_file, &code_item);
   if (accessor.InsnsSizeInCodeUnits() >= UINT16_MAX / 4) {
     LOG(INFO) << "Method exceeds compiler instruction limit: "
               << accessor.InsnsSizeInCodeUnits()