Post-Quick cleanup: Remove CompilationUnit.

Change-Id: I309411b0fffaaed1e218e2c34394bdf6e2f75b48
diff --git a/compiler/compiler.h b/compiler/compiler.h
index 97c60de..487a27f 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -27,8 +27,6 @@
 }
 
 class ArtMethod;
-class Backend;
-struct CompilationUnit;
 class CompilerDriver;
 class CompiledMethod;
 class OatWriter;
@@ -46,8 +44,7 @@
 
   virtual void UnInit() const = 0;
 
-  virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file, CompilationUnit* cu)
-      const = 0;
+  virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file) const = 0;
 
   virtual CompiledMethod* Compile(const DexFile::CodeItem* code_item,
                                   uint32_t access_flags,
@@ -77,8 +74,6 @@
     return maximum_compilation_time_before_warning_;
   }
 
-  virtual void InitCompilationUnit(CompilationUnit& cu) const = 0;
-
   virtual ~Compiler() {}
 
   /*
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc
index 4836041..efddeba 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/compiler/dex/dex_to_dex_compiler.cc
@@ -327,10 +327,16 @@
     ScopedObjectAccess soa(Thread::Current());
     StackHandleScope<1> hs(soa.Self());
     ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
-    art::DexCompilationUnit unit(nullptr, class_loader, class_linker,
-                                 dex_file, code_item, class_def_idx, method_idx, access_flags,
-                                 driver->GetVerifiedMethod(&dex_file, method_idx),
-                                 hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file)));
+    art::DexCompilationUnit unit(
+        class_loader,
+        class_linker,
+        dex_file,
+        code_item,
+        class_def_idx,
+        method_idx,
+        access_flags,
+        driver->GetVerifiedMethod(&dex_file, method_idx),
+        hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file)));
     art::optimizer::DexCompiler dex_compiler(*driver, unit, dex_to_dex_compilation_level);
     dex_compiler.Compile();
     if (dex_compiler.GetQuickenedInfo().empty()) {
diff --git a/compiler/driver/dex_compilation_unit.cc b/compiler/driver/dex_compilation_unit.cc
index e458b98..b0ee448 100644
--- a/compiler/driver/dex_compilation_unit.cc
+++ b/compiler/driver/dex_compilation_unit.cc
@@ -22,8 +22,7 @@
 
 namespace art {
 
-DexCompilationUnit::DexCompilationUnit(CompilationUnit* cu,
-                                       jobject class_loader,
+DexCompilationUnit::DexCompilationUnit(jobject class_loader,
                                        ClassLinker* class_linker,
                                        const DexFile& dex_file,
                                        const DexFile::CodeItem* code_item,
@@ -32,8 +31,7 @@
                                        uint32_t access_flags,
                                        const VerifiedMethod* verified_method,
                                        Handle<mirror::DexCache> dex_cache)
-    : cu_(cu),
-      class_loader_(class_loader),
+    : class_loader_(class_loader),
       class_linker_(class_linker),
       dex_file_(&dex_file),
       code_item_(code_item),
diff --git a/compiler/driver/dex_compilation_unit.h b/compiler/driver/dex_compilation_unit.h
index 16872f4..854927d 100644
--- a/compiler/driver/dex_compilation_unit.h
+++ b/compiler/driver/dex_compilation_unit.h
@@ -30,15 +30,11 @@
 class DexCache;
 }  // namespace mirror
 class ClassLinker;
-struct CompilationUnit;
 class VerifiedMethod;
 
 class DexCompilationUnit : public DeletableArenaObject<kArenaAllocMisc> {
  public:
-  explicit DexCompilationUnit(CompilationUnit* cu);
-
-  DexCompilationUnit(CompilationUnit* cu,
-                     jobject class_loader,
+  DexCompilationUnit(jobject class_loader,
                      ClassLinker* class_linker,
                      const DexFile& dex_file,
                      const DexFile::CodeItem* code_item,
@@ -48,10 +44,6 @@
                      const VerifiedMethod* verified_method,
                      Handle<mirror::DexCache> dex_cache);
 
-  CompilationUnit* GetCompilationUnit() const {
-    return cu_;
-  }
-
   jobject GetClassLoader() const {
     return class_loader_;
   }
@@ -121,8 +113,6 @@
   }
 
  private:
-  CompilationUnit* const cu_;
-
   const jobject class_loader_;
 
   ClassLinker* const class_linker_;
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 440a282..36442fd 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1013,7 +1013,6 @@
   ClassLinker* class_linker = caller_compilation_unit_.GetClassLinker();
   Handle<mirror::DexCache> dex_cache(handles_->NewHandle(resolved_method->GetDexCache()));
   DexCompilationUnit dex_compilation_unit(
-      nullptr,
       caller_compilation_unit_.GetClassLoader(),
       class_linker,
       callee_dex_file,
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index f1c5581..ada5879 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -259,8 +259,7 @@
   explicit OptimizingCompiler(CompilerDriver* driver);
   ~OptimizingCompiler();
 
-  bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file, CompilationUnit* cu) const
-      OVERRIDE;
+  bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file) const OVERRIDE;
 
   CompiledMethod* Compile(const DexFile::CodeItem* code_item,
                           uint32_t access_flags,
@@ -283,8 +282,6 @@
         InstructionSetPointerSize(GetCompilerDriver()->GetInstructionSet())));
   }
 
-  void InitCompilationUnit(CompilationUnit& cu) const OVERRIDE;
-
   void Init() OVERRIDE;
 
   void UnInit() const OVERRIDE;
@@ -365,12 +362,8 @@
   }
 }
 
-void OptimizingCompiler::InitCompilationUnit(CompilationUnit& cu ATTRIBUTE_UNUSED) const {
-}
-
 bool OptimizingCompiler::CanCompileMethod(uint32_t method_idx ATTRIBUTE_UNUSED,
-                                          const DexFile& dex_file ATTRIBUTE_UNUSED,
-                                          CompilationUnit* cu ATTRIBUTE_UNUSED) const {
+                                          const DexFile& dex_file ATTRIBUTE_UNUSED) const {
   return true;
 }
 
@@ -662,9 +655,15 @@
   }
 
   DexCompilationUnit dex_compilation_unit(
-    nullptr, class_loader, Runtime::Current()->GetClassLinker(), dex_file, code_item,
-    class_def_idx, method_idx, access_flags,
-    nullptr, dex_cache);
+      class_loader,
+      Runtime::Current()->GetClassLinker(),
+      dex_file,
+      code_item,
+      class_def_idx,
+      method_idx,
+      access_flags,
+      /* verified_method */ nullptr,
+      dex_cache);
 
   bool requires_barrier = dex_compilation_unit.IsConstructor()
       && compiler_driver->RequiresConstructorBarrier(Thread::Current(),