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/debug/elf_debug_loc_writer.h b/compiler/debug/elf_debug_loc_writer.h
index 34c2919..9ea9f01 100644
--- a/compiler/debug/elf_debug_loc_writer.h
+++ b/compiler/debug/elf_debug_loc_writer.h
@@ -149,7 +149,7 @@
     DCHECK_LT(stack_map_index, dex_register_maps.size());
     DexRegisterMap dex_register_map = dex_register_maps[stack_map_index];
     DCHECK(dex_register_map.IsValid());
-    CodeItemDataAccessor accessor(method_info->dex_file, method_info->code_item);
+    CodeItemDataAccessor accessor(*method_info->dex_file, method_info->code_item);
     reg_lo = dex_register_map.GetDexRegisterLocation(
         vreg, accessor.RegistersSize(), code_info, encoding);
     if (is64bitValue) {