Move HandleCache to HGraph.

This avoids passing the `VariableSizedHandleScope*` argument
around and eliminates HGraph::inexact_object_rti_ and its
initialization. The latter shall allow running Optimizing
gtests that do not require type information without creating
a Runtime in future. (To be implemented in a separate CL.)

Test: m test-art-host-gtest
Test: testrunner.py --host --optmizing
Test: aosp_taimen-userdebug boots.
Change-Id: I36fe9bc556c6d610d644c8c14cc74c9985a14d64
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 64aa1b9..33dbf4e 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -43,8 +43,7 @@
                              const DexCompilationUnit* outer_compilation_unit,
                              CodeGenerator* code_generator,
                              OptimizingCompilerStats* compiler_stats,
-                             ArrayRef<const uint8_t> interpreter_metadata,
-                             VariableSizedHandleScope* handles)
+                             ArrayRef<const uint8_t> interpreter_metadata)
     : graph_(graph),
       dex_file_(&graph->GetDexFile()),
       code_item_accessor_(accessor),
@@ -53,13 +52,11 @@
       code_generator_(code_generator),
       compilation_stats_(compiler_stats),
       interpreter_metadata_(interpreter_metadata),
-      handles_(handles),
       return_type_(DataType::FromShorty(dex_compilation_unit_->GetShorty()[0])) {}
 
 HGraphBuilder::HGraphBuilder(HGraph* graph,
                              const DexCompilationUnit* dex_compilation_unit,
                              const CodeItemDebugInfoAccessor& accessor,
-                             VariableSizedHandleScope* handles,
                              DataType::Type return_type)
     : graph_(graph),
       dex_file_(&graph->GetDexFile()),
@@ -68,7 +65,6 @@
       outer_compilation_unit_(nullptr),
       code_generator_(nullptr),
       compilation_stats_(nullptr),
-      handles_(handles),
       return_type_(return_type) {}
 
 bool HGraphBuilder::SkipCompilation(size_t number_of_branches) {
@@ -119,7 +115,6 @@
   SsaBuilder ssa_builder(graph_,
                          dex_compilation_unit_->GetClassLoader(),
                          dex_compilation_unit_->GetDexCache(),
-                         handles_,
                          &local_allocator);
   HInstructionBuilder instruction_builder(graph_,
                                           &block_builder,
@@ -132,7 +127,6 @@
                                           code_generator_,
                                           interpreter_metadata_,
                                           compilation_stats_,
-                                          handles_,
                                           &local_allocator);
 
   // 1) Create basic blocks and link them together. Basic blocks are left
@@ -190,7 +184,6 @@
   SsaBuilder ssa_builder(graph_,
                          dex_compilation_unit_->GetClassLoader(),
                          dex_compilation_unit_->GetDexCache(),
-                         handles_,
                          &local_allocator);
   HInstructionBuilder instruction_builder(graph_,
                                           &block_builder,
@@ -203,7 +196,6 @@
                                           code_generator_,
                                           interpreter_metadata_,
                                           compilation_stats_,
-                                          handles_,
                                           &local_allocator);
 
   // 1) Create basic blocks for the intrinsic and link them together.