summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compiler_llvm.cc
diff options
context:
space:
mode:
author Logan Chien <loganchien@google.com> 2012-03-02 11:57:34 +0800
committer Shih-wei Liao <sliao@google.com> 2012-03-01 21:11:24 -0800
commitce1190657a66a414e8e6a79cf9bcf6ddeae0d934 (patch)
treeed4593bbfd1cab11ffdd72bea3b6b3a0b153b5dd /src/compiler_llvm/compiler_llvm.cc
parent71ac99485e79ad7eb1ba3ea2d404d53bb5784c13 (diff)
Remove MutexLock from the argument. Use AssertHeld instead.
Change-Id: I43beab4cf30cbb6b2d3c383d492240d4a1ac8068
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
-rw-r--r--src/compiler_llvm/compiler_llvm.cc17
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_));