From 5b8b1edc803a85bb3172560826d6a23fb23c3452 Mon Sep 17 00:00:00 2001 From: Shih-wei Liao Date: Thu, 23 Feb 2012 23:48:21 -0800 Subject: 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 --- src/compiler_llvm/compiler_llvm.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler_llvm/compiler_llvm.cc') 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_)); -- cgit v1.2.3-59-g8ed1b