Remove code related to compiled invoke stubs.

Note that the oat file version is now bumped to 004. A clean-oat will be
necessary after syncing this change.

Change-Id: If8875335b7fcc39b6b40c6f95de07da50da7b6b8
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc
index 169790f..93ba71b 100644
--- a/src/compiler/driver/compiler_driver.cc
+++ b/src/compiler/driver/compiler_driver.cc
@@ -292,7 +292,6 @@
       freezing_constructor_lock_("freezing constructor lock"),
       compiled_classes_lock_("compiled classes lock"),
       compiled_methods_lock_("compiled method lock"),
-      compiled_invoke_stubs_lock_("compiled invoke stubs lock"),
       compiled_proxy_stubs_lock_("compiled proxy stubs lock"),
       image_(image),
       thread_count_(thread_count),
@@ -306,9 +305,7 @@
       compiler_(NULL),
       compiler_context_(NULL),
       jni_compiler_(NULL),
-      create_invoke_stub_(NULL),
-      compiler_get_method_code_addr_(NULL),
-      compiler_get_method_invoke_stub_addr_(NULL)
+      compiler_get_method_code_addr_(NULL)
 {
   std::string compiler_so_name(MakeCompilerSoName(compiler_backend_));
   compiler_library_ = dlopen(compiler_so_name.c_str(), RTLD_LAZY);
@@ -342,29 +339,6 @@
   }
 
   if (compiler_backend_ == kPortable) {
-    create_invoke_stub_ =
-        FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateLLVMInvokeStub");
-  } else {
-    switch (instruction_set) {
-      case kArm:
-      case kThumb2:
-        create_invoke_stub_ =
-            FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateArmInvokeStub");
-        break;
-      case kMips:
-        create_invoke_stub_ =
-            FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateMipsInvokeStub");
-        break;
-      case kX86:
-        create_invoke_stub_ =
-            FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateX86InvokeStub");
-        break;
-      default:
-        LOG(FATAL) << "Unknown InstructionSet: " << instruction_set;
-    }
-  }
-
-  if (compiler_backend_ == kPortable) {
     create_proxy_stub_ = FindFunction<CreateProxyStubFn>(
         compiler_so_name, compiler_library_, "ArtCreateProxyStub");
   }
@@ -386,10 +360,6 @@
     STLDeleteValues(&compiled_methods_);
   }
   {
-    MutexLock mu(self, compiled_invoke_stubs_lock_);
-    STLDeleteValues(&compiled_invoke_stubs_);
-  }
-  {
     MutexLock mu(self, compiled_proxy_stubs_lock_);
     STLDeleteValues(&compiled_proxy_stubs_);
   }
@@ -1635,14 +1605,6 @@
   timings.AddSplit("Compile " + dex_file.GetLocation());
 }
 
-static std::string MakeInvokeStubKey(bool is_static, const char* shorty) {
-  std::string key(shorty);
-  if (is_static) {
-    key += "$";  // Must not be a shorty type character.
-  }
-  return key;
-}
-
 void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t access_flags,
                                    InvokeType invoke_type, uint32_t class_def_idx,
                                    uint32_t method_idx, jobject class_loader,
@@ -1693,13 +1655,6 @@
   uint32_t shorty_len;
   const char* shorty = dex_file.GetMethodShorty(dex_file.GetMethodId(method_idx), &shorty_len);
   bool is_static = (access_flags & kAccStatic) != 0;
-  std::string key(MakeInvokeStubKey(is_static, shorty));
-  CompiledInvokeStub* compiled_invoke_stub = FindInvokeStub(key);
-  if (compiled_invoke_stub == NULL) {
-    compiled_invoke_stub = (*create_invoke_stub_)(*this, is_static, shorty, shorty_len);
-    CHECK(compiled_invoke_stub != NULL);
-    InsertInvokeStub(key, compiled_invoke_stub);
-  }
 
   if ((compiler_backend_ == kPortable) && !is_static) {
     CompiledInvokeStub* compiled_proxy_stub = FindProxyStub(shorty);
@@ -1717,33 +1672,6 @@
   }
 }
 
-CompiledInvokeStub* CompilerDriver::FindInvokeStub(bool is_static, const char* shorty) const {
-  const std::string key(MakeInvokeStubKey(is_static, shorty));
-  return FindInvokeStub(key);
-}
-
-CompiledInvokeStub* CompilerDriver::FindInvokeStub(const std::string& key) const {
-  MutexLock mu(Thread::Current(), compiled_invoke_stubs_lock_);
-  InvokeStubTable::const_iterator it = compiled_invoke_stubs_.find(key);
-  if (it == compiled_invoke_stubs_.end()) {
-    return NULL;
-  } else {
-    DCHECK(it->second != NULL);
-    return it->second;
-  }
-}
-
-void CompilerDriver::InsertInvokeStub(const std::string& key, CompiledInvokeStub* compiled_invoke_stub) {
-  MutexLock mu(Thread::Current(), compiled_invoke_stubs_lock_);
-  InvokeStubTable::iterator it = compiled_invoke_stubs_.find(key);
-  if (it != compiled_invoke_stubs_.end()) {
-    // Someone else won the race.
-    delete compiled_invoke_stub;
-  } else {
-    compiled_invoke_stubs_.Put(key, compiled_invoke_stub);
-  }
-}
-
 CompiledInvokeStub* CompilerDriver::FindProxyStub(const char* shorty) const {
   MutexLock mu(Thread::Current(), compiled_proxy_stubs_lock_);
   ProxyStubTable::const_iterator it = compiled_proxy_stubs_.find(shorty);
diff --git a/src/compiler/driver/compiler_driver.h b/src/compiler/driver/compiler_driver.h
index c87d6f7..f398e31 100644
--- a/src/compiler/driver/compiler_driver.h
+++ b/src/compiler/driver/compiler_driver.h
@@ -122,10 +122,6 @@
   CompiledMethod* GetCompiledMethod(MethodReference ref) const
       LOCKS_EXCLUDED(compiled_methods_lock_);
 
-  CompiledInvokeStub* FindInvokeStub(bool is_static, const char* shorty) const;
-  CompiledInvokeStub* FindInvokeStub(const std::string& key) const
-      LOCKS_EXCLUDED(compiled_invoke_stubs_lock_);
-
   CompiledInvokeStub* FindProxyStub(const char* shorty) const;
 
   void AddRequiresConstructorBarrier(Thread* self, const DexFile* dex_file, size_t class_def_index);
@@ -321,9 +317,6 @@
   static void CompileClass(const ParallelCompilationManager* context, size_t class_def_index)
       LOCKS_EXCLUDED(Locks::mutator_lock_);
 
-  void InsertInvokeStub(const std::string& key, CompiledInvokeStub* compiled_invoke_stub)
-      LOCKS_EXCLUDED(compiled_invoke_stubs_lock_);
-
   void InsertProxyStub(const char* shorty, CompiledInvokeStub* compiled_proxy_stub);
 
   std::vector<const PatchInformation*> code_to_patch_;
@@ -348,10 +341,6 @@
   MethodTable compiled_methods_ GUARDED_BY(compiled_methods_lock_);
 
   typedef SafeMap<std::string, CompiledInvokeStub*> InvokeStubTable;
-  // Invocation stubs created to allow invocation of the compiled methods.
-  mutable Mutex compiled_invoke_stubs_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
-  InvokeStubTable compiled_invoke_stubs_ GUARDED_BY(compiled_invoke_stubs_lock_);
-
   typedef SafeMap<std::string, CompiledInvokeStub*> ProxyStubTable;
   // Proxy stubs created for proxy invocation delegation
   mutable Mutex compiled_proxy_stubs_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
@@ -387,9 +376,6 @@
                                            uint32_t access_flags, uint32_t method_idx,
                                            const DexFile& dex_file);
   JniCompilerFn jni_compiler_;
-  typedef CompiledInvokeStub* (*CreateInvokeStubFn)(CompilerDriver& driver, bool is_static,
-                                                    const char* shorty, uint32_t shorty_len);
-  CreateInvokeStubFn create_invoke_stub_;
 
   pthread_key_t tls_key_;
 
@@ -404,11 +390,6 @@
       (const CompilerDriver& driver, const CompiledMethod* cm, const mirror::AbstractMethod* method);
   CompilerGetMethodCodeAddrFn compiler_get_method_code_addr_;
 
-  typedef const mirror::AbstractMethod::InvokeStub* (*CompilerGetMethodInvokeStubAddrFn)
-      (const CompilerDriver& driver, const CompiledInvokeStub* cm, const mirror::AbstractMethod* method);
-  CompilerGetMethodInvokeStubAddrFn compiler_get_method_invoke_stub_addr_;
-
-
   DISALLOW_COPY_AND_ASSIGN(CompilerDriver);
 };