ART: Some Quick cleanup

Make several fields const in CompilationUnit. May benefit some Mir2Lir
code that repeats tests, and in general immutability is good.

Remove compiler_internals.h and refactor some other headers to reduce
overly broad imports (and thus forced recompiles on changes).

Change-Id: I898405907c68923581373b5981d8a85d2e5d185a
diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h
index 34585c1..e7182a9 100644
--- a/compiler/dex/compiler_ir.h
+++ b/compiler/dex/compiler_ir.h
@@ -17,31 +17,25 @@
 #ifndef ART_COMPILER_DEX_COMPILER_IR_H_
 #define ART_COMPILER_DEX_COMPILER_IR_H_
 
+#include "jni.h"
 #include <string>
 #include <vector>
 
-#include "compiler_enums.h"
-#include "driver/compiler_driver.h"
-#include "utils/scoped_arena_allocator.h"
 #include "base/timing_logger.h"
+#include "invoke_type.h"
+#include "safe_map.h"
 #include "utils/arena_allocator.h"
+#include "utils/scoped_arena_allocator.h"
 
 namespace art {
 
 class Backend;
 class ClassLinker;
+class CompilerDriver;
 class MIRGraph;
 
-/*
- * TODO: refactoring pass to move these (and other) typedefs towards usage style of runtime to
- * add type safety (see runtime/offsets.h).
- */
-typedef uint32_t DexOffset;          // Dex offset in code units.
-typedef uint16_t NarrowDexOffset;    // For use in structs, Dex offsets range from 0 .. 0xffff.
-typedef uint32_t CodeOffset;         // Native code offset in bytes.
-
 struct CompilationUnit {
-  explicit CompilationUnit(ArenaPool* pool);
+  CompilationUnit(ArenaPool* pool, InstructionSet isa, CompilerDriver* driver, ClassLinker* linker);
   ~CompilationUnit();
 
   void StartTimingSplit(const char* label);
@@ -52,30 +46,20 @@
    * Fields needed/generated by common frontend and generally used throughout
    * the compiler.
   */
-  CompilerDriver* compiler_driver;
-  ClassLinker* class_linker;           // Linker to resolve fields and methods.
-  const DexFile* dex_file;             // DexFile containing the method being compiled.
-  jobject class_loader;                // compiling method's class loader.
-  uint16_t class_def_idx;              // compiling method's defining class definition index.
-  uint32_t method_idx;                 // compiling method's index into method_ids of DexFile.
-  uint32_t access_flags;               // compiling method's access flags.
-  InvokeType invoke_type;              // compiling method's invocation type.
-  const char* shorty;                  // compiling method's shorty.
-  uint32_t disable_opt;                // opt_control_vector flags.
-  uint32_t enable_debug;               // debugControlVector flags.
+  CompilerDriver* const compiler_driver;
+  ClassLinker* const class_linker;        // Linker to resolve fields and methods.
+  const DexFile* dex_file;                // DexFile containing the method being compiled.
+  jobject class_loader;                   // compiling method's class loader.
+  uint16_t class_def_idx;                 // compiling method's defining class definition index.
+  uint32_t method_idx;                    // compiling method's index into method_ids of DexFile.
+  uint32_t access_flags;                  // compiling method's access flags.
+  InvokeType invoke_type;                 // compiling method's invocation type.
+  const char* shorty;                     // compiling method's shorty.
+  uint32_t disable_opt;                   // opt_control_vector flags.
+  uint32_t enable_debug;                  // debugControlVector flags.
   bool verbose;
-  const Compiler* compiler;
-  InstructionSet instruction_set;
-  bool target64;
-
-  const InstructionSetFeatures* GetInstructionSetFeatures() {
-    return compiler_driver->GetInstructionSetFeatures();
-  }
-
-  // If non-empty, apply optimizer/debug flags only to matching methods.
-  std::string compiler_method_match;
-  // Flips sense of compiler_method_match - apply flags if doesn't match.
-  bool compiler_flip_match;
+  const InstructionSet instruction_set;
+  const bool target64;
 
   // TODO: move memory management to mir_graph, or just switch to using standard containers.
   ArenaAllocator arena;