Add support for invoke-static in optimizing compiler.

Support is limited to calls without parameters and returning
void. For simplicity, we currently follow the Quick ABI.

Change-Id: I54805161141b7eac5959f1cae0dc138dd0b2e8a5
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 334b185..d19c40c 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -62,17 +62,31 @@
     nullptr, class_loader, art::Runtime::Current()->GetClassLinker(), dex_file, code_item,
     class_def_idx, method_idx, access_flags, driver.GetVerifiedMethod(&dex_file, method_idx));
 
+  // For testing purposes, we put a special marker on method names that should be compiled
+  // with this compiler. This makes sure we're not regressing.
+  bool shouldCompile = dex_compilation_unit.GetSymbol().find("00024opt_00024") != std::string::npos;
+
   ArenaPool pool;
   ArenaAllocator arena(&pool);
-  HGraphBuilder builder(&arena);
+  HGraphBuilder builder(&arena, &dex_compilation_unit, &dex_file);
   HGraph* graph = builder.BuildGraph(*code_item);
   if (graph == nullptr) {
+    if (shouldCompile) {
+      LOG(FATAL) << "Could not build graph in optimizing compiler";
+    }
     return nullptr;
   }
 
   InstructionSet instruction_set = driver.GetInstructionSet();
+  // The optimizing compiler currently does not have a Thumb2 assembler.
+  if (instruction_set == kThumb2) {
+    instruction_set = kArm;
+  }
   CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, instruction_set);
   if (codegen == nullptr) {
+    if (shouldCompile) {
+      LOG(FATAL) << "Could not find code generator for optimizing compiler";
+    }
     return nullptr;
   }
 
@@ -90,7 +104,7 @@
                             instruction_set,
                             allocator.GetMemory(),
                             codegen->GetFrameSize(),
-                            0, /* GPR spill mask, unused */
+                            codegen->GetCoreSpillMask(),
                             0, /* FPR spill mask, unused */
                             mapping_table,
                             vmap_table,