diff options
| author | 2012-03-01 21:21:25 -0800 | |
|---|---|---|
| committer | 2012-03-01 21:21:26 -0800 | |
| commit | 480c5734d2bf5bceace1d5db96c41ea6ba328273 (patch) | |
| tree | 22745353684e846bb93b21bde4799e89421a9b44 /src/compiler_llvm/compiler_llvm.cc | |
| parent | ffb465f23d9549dd591e6aa62e9250523cb00233 (diff) | |
| parent | ce1190657a66a414e8e6a79cf9bcf6ddeae0d934 (diff) | |
Merge "Remove MutexLock from the argument. Use AssertHeld instead." into dalvik-dev
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
| -rw-r--r-- | src/compiler_llvm/compiler_llvm.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 345872e3ee..1edbd46df2 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -84,8 +84,9 @@ CompilerLLVM::~CompilerLLVM() { } -void CompilerLLVM::EnsureCompilationUnit(MutexLock& GUARD) { +void CompilerLLVM::EnsureCompilationUnit() { DCHECK_NE(llvm_initialized, PTHREAD_ONCE_INIT); + compiler_lock_.AssertHeld(); if (curr_cunit_ != NULL) { return; @@ -113,7 +114,7 @@ void CompilerLLVM::EnsureCompilationUnit(MutexLock& GUARD) { void CompilerLLVM::MaterializeRemainder() { MutexLock GUARD(compiler_lock_); if (curr_cunit_ != NULL) { - Materialize(GUARD); + Materialize(); } } @@ -121,12 +122,14 @@ void CompilerLLVM::MaterializeRemainder() { void CompilerLLVM::MaterializeIfThresholdReached() { MutexLock GUARD(compiler_lock_); if (curr_cunit_ != NULL && curr_cunit_->IsMaterializeThresholdReached()) { - Materialize(GUARD); + Materialize(); } } -void CompilerLLVM::Materialize(MutexLock& GUARD) { +void CompilerLLVM::Materialize() { + compiler_lock_.AssertHeld(); + DCHECK(curr_cunit_ != NULL); DCHECK(!curr_cunit_->IsMaterialized()); @@ -147,7 +150,7 @@ CompiledMethod* CompilerLLVM:: CompileDexMethod(OatCompilationUnit* oat_compilation_unit) { MutexLock GUARD(compiler_lock_); - EnsureCompilationUnit(GUARD); + EnsureCompilationUnit(); UniquePtr<MethodCompiler> method_compiler( new MethodCompiler(curr_cunit_, compiler_, oat_compilation_unit)); @@ -160,7 +163,7 @@ CompiledMethod* CompilerLLVM:: CompileNativeMethod(OatCompilationUnit* oat_compilation_unit) { MutexLock GUARD(compiler_lock_); - EnsureCompilationUnit(GUARD); + EnsureCompilationUnit(); UniquePtr<JniCompiler> jni_compiler( new JniCompiler(curr_cunit_, *compiler_, oat_compilation_unit)); @@ -173,7 +176,7 @@ CompiledInvokeStub* CompilerLLVM::CreateInvokeStub(bool is_static, char const *shorty) { MutexLock GUARD(compiler_lock_); - EnsureCompilationUnit(GUARD); + EnsureCompilationUnit(); UniquePtr<UpcallCompiler> upcall_compiler( new UpcallCompiler(curr_cunit_, *compiler_)); |