summaryrefslogtreecommitdiff
path: root/src/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Brian Carlstrom <bdc@google.com> 2013-03-30 14:41:33 -0700
committer Brian Carlstrom <bdc@google.com> 2013-03-30 14:41:33 -0700
commitbf393efe476801b7f27fe6aa47691e3305552e9e (patch)
tree2bfd05752781815306c115e40aab2b5fef10dfd0 /src/compiler/driver/compiler_driver.cc
parentc404bfb072f9273beb13bf8e098e2a4aa108f18b (diff)
parentb56812165dd3a2e6eb8b85c810943b3d7bd9bfc4 (diff)
Merge branch 'dalvik-dev' of https://googleplex-android.googlesource.com/a/platform/art into fixes-for-art-build-with-mr2
Change-Id: Ie46d1f77f98b8a6f55f02b8614cb88b36b6a2d44
Diffstat (limited to 'src/compiler/driver/compiler_driver.cc')
-rw-r--r--src/compiler/driver/compiler_driver.cc80
1 files changed, 7 insertions, 73 deletions
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc
index 45d5bf1c1b..a839be7d84 100644
--- a/src/compiler/driver/compiler_driver.cc
+++ b/src/compiler/driver/compiler_driver.cc
@@ -292,7 +292,6 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet
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 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet
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 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet
}
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 @@ CompilerDriver::~CompilerDriver() {
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_);
}
@@ -415,6 +385,7 @@ CompilerDriver::~CompilerDriver() {
compiler_library_, "ArtUnInitQuickCompilerContext");
}
uninit_compiler_context(*this);
+#if 0
if (compiler_library_ != NULL) {
VLOG(compiler) << "dlclose(" << compiler_library_ << ")";
/*
@@ -427,9 +398,14 @@ CompilerDriver::~CompilerDriver() {
* However, this is not required by POSIX and we don't do it.
* See: http://b/issue?id=4998315
* What's the right thing to do here?
+ *
+ * This has now been completely disabled because mclinker was
+ * closing stdout on exit, which was affecting both quick and
+ * portable.
*/
dlclose(compiler_library_);
}
+#endif
}
CompilerTls* CompilerDriver::GetTls() {
@@ -1635,14 +1611,6 @@ void CompilerDriver::CompileDexFile(jobject class_loader, const DexFile& dex_fil
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 +1661,6 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t
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 +1678,6 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t
}
}
-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);