summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compiler_llvm.cc
diff options
context:
space:
mode:
author Shih-wei Liao <sliao@google.com> 2012-02-23 23:48:21 -0800
committer Shih-wei Liao <sliao@google.com> 2012-03-01 11:44:02 -0800
commit5b8b1edc803a85bb3172560826d6a23fb23c3452 (patch)
tree43fe7644011ad6b8c7175ee9748f5fd27e0d27af /src/compiler_llvm/compiler_llvm.cc
parent31a4a6f5717f645da6b97ccc1e420ae1e1c71ce0 (diff)
Implement Link-loading and pass 62 tests in JniInternalTest.
The passed tests include the 12 originally ARM-only tests. Now it works on x86 as well if defined(ART_USE_LLVM_COMPILER). Change-Id: I03092637fa4f0979ca77e0cac06e5d31a867e465
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
-rw-r--r--src/compiler_llvm/compiler_llvm.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index 56f0b07418..098589459f 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -55,8 +55,8 @@ llvm::Module* makeLLVMModuleContents(llvm::Module* module);
CompilerLLVM::CompilerLLVM(Compiler* compiler, InstructionSet insn_set)
-: compiler_(compiler), compiler_lock_("llvm_compiler_lock"),
- insn_set_(insn_set), cunit_counter_(0) {
+ : compiler_(compiler), compiler_lock_("llvm_compiler_lock"),
+ insn_set_(insn_set), cunit_counter_(0) {
// Initialize LLVM libraries
pthread_once(&llvm_initialized, InitializeLLVM);
@@ -69,6 +69,7 @@ CompilerLLVM::~CompilerLLVM() {
void CompilerLLVM::EnsureCompilationUnit() {
+ MutexLock GUARD(compiler_lock_);
DCHECK_NE(llvm_initialized, PTHREAD_ONCE_INIT);
if (cunit_.get() == NULL) {
cunit_.reset(new CompilationUnit(insn_set_));