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/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index fe83a66..c0886d0 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -711,7 +711,7 @@
   }
 
   ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
-  for (const DexInstructionPcPair& inst : CodeItemInstructionAccessor(&dex_file, code_item)) {
+  for (const DexInstructionPcPair& inst : CodeItemInstructionAccessor(dex_file, code_item)) {
     switch (inst->Opcode()) {
       case Instruction::CONST_STRING:
       case Instruction::CONST_STRING_JUMBO: {