Get SEA fibonacci running in interpreter mode.

Android.mk: Added new file to build.
compile_driver.cc: Moved SE_IR usage test in the block
         protected by bool compile, which is enabled by
         adding a sepatate test in IsCnadidateForCompilation.
class_linker.cc: Added check in NeedsInterpreter to enable SEA_IR.
art_method-inl.h: DIsabled check in SEA_IR mode.
method_verifier.cc: Added check for SEA_IR mode.
method_verifier.h: Chenged IsCandidateForCompilation signature to
         allow testing the function name (for SEA_IR selective
         compilation).
dot_gen.h: Updated ART file API usage to altest version.
sea_ir/frontend.cc: Passing function symbol name to CompileMethod.
instruction_Nodes.h: Added  accessor for method index for
         InvokeStatic IR node.
sea.cc: Added additional IR SignatureNode for function calls (extra
         Method parameter). Fixed UnnamedConstant constant value.
sea.h: Passing function_name to GenerateLLVM.
type_inference_visitor.cc: Aded type for first (placeholder) method
         parameter.

Change-Id: I295858ea0761a3dffb36f35748d8b93d4919d6a9
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 039e7bc..d79066f 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1614,6 +1614,13 @@
     // No code: need interpreter.
     return true;
   }
+#ifdef ART_SEA_IR_MODE
+  ScopedObjectAccess soa(Thread::Current());
+  if (std::string::npos != PrettyMethod(method).find("fibonacci")) {
+    LOG(INFO) << "Found " << PrettyMethod(method);
+    return false;
+  }
+#endif
   // If interpreter mode is enabled, every method (except native and proxy) must
   // be run with interpreter.
   return Runtime::Current()->GetInstrumentation()->InterpretOnly() &&
diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h
index 4d8aa6f..224b2ba 100644
--- a/runtime/mirror/art_method-inl.h
+++ b/runtime/mirror/art_method-inl.h
@@ -49,7 +49,12 @@
 }
 
 inline uint32_t ArtMethod::GetDexMethodIndex() const {
+#ifdef ART_SEA_IR_MODE
+  // TODO: Re-add this check for (PORTABLE + SMALL + ) SEA IR when PORTABLE IS fixed!
+  // DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous());
+#else
   DCHECK(GetDeclaringClass()->IsLoaded() || GetDeclaringClass()->IsErroneous());
+#endif
   return GetField32(OFFSET_OF_OBJECT_MEMBER(ArtMethod, method_dex_index_), false);
 }
 
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index dcc9f90..4d2f36f 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -1048,7 +1048,7 @@
   // Compute information for compiler.
   if (Runtime::Current()->IsCompiler()) {
     MethodReference ref(dex_file_, dex_method_idx_);
-    bool compile = IsCandidateForCompilation(code_item_, method_access_flags_);
+    bool compile = IsCandidateForCompilation(ref, method_access_flags_);
     if (compile) {
       /* Generate a register map and add it to the method. */
       UniquePtr<const std::vector<uint8_t> > map(GenerateGcMap());
@@ -4178,8 +4178,14 @@
   return result;
 }
 
-bool MethodVerifier::IsCandidateForCompilation(const DexFile::CodeItem* code_item,
+bool MethodVerifier::IsCandidateForCompilation(MethodReference& method_ref,
                                                const uint32_t access_flags) {
+#ifdef ART_SEA_IR_MODE
+    bool use_sea = Runtime::Current()->IsSeaIRMode();
+    use_sea = use_sea && (std::string::npos != PrettyMethod(
+                          method_ref.dex_method_index, *(method_ref.dex_file)).find("fibonacci"));
+    if (use_sea) return true;
+#endif
   // Don't compile class initializers, ever.
   if (((access_flags & kAccConstructor) != 0) && ((access_flags & kAccStatic) != 0)) {
     return false;
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 6171943..241e1d4 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -239,7 +239,7 @@
   // Describe VRegs at the given dex pc.
   std::vector<int32_t> DescribeVRegs(uint32_t dex_pc);
 
-  static bool IsCandidateForCompilation(const DexFile::CodeItem* code_item,
+  static bool IsCandidateForCompilation(MethodReference& method_ref,
                                         const uint32_t access_flags);
 
  private: