diff options
| author | 2012-10-11 14:46:06 -0700 | |
|---|---|---|
| committer | 2012-10-11 15:33:23 -0700 | |
| commit | 4df2bbdfe6602ce5f141b7b44028b95faa0bd8ef (patch) | |
| tree | 9c23dad1023ccd1bf710825e6115892291232dae /src/compiler_llvm/compilation_unit.cc | |
| parent | 1aae273f8827bcbfff6b00c5babd77a111852272 (diff) | |
Enable multi-threaded Quick compilation
Reuse thread-local copies of llvm context data for Quick compiler
(while continuing to regenerate fresh ones per method for Portable).
This is a transitional CL - the upcoming compiler driver change
is expected to pass pass a thread context structure to each compiler
worker thread rather than use the pthread_key mechanism.
Change-Id: I277920a5c2705748c3a9f37ceace53c903747ec2
Diffstat (limited to 'src/compiler_llvm/compilation_unit.cc')
| -rw-r--r-- | src/compiler_llvm/compilation_unit.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc index 95073ea39b..ba71aee01d 100644 --- a/src/compiler_llvm/compilation_unit.cc +++ b/src/compiler_llvm/compilation_unit.cc @@ -172,9 +172,9 @@ CompilationUnit::CompilationUnit(const CompilerLLVM* compiler_llvm, #else compiler_ = NULL; oat_compilation_unit_ = NULL; - quick_ctx_.reset(new QuickCompiler()); - context_.reset(quick_ctx_->GetLLVMContext()); - module_ = quick_ctx_->GetLLVMModule(); + llvm_info_.reset(new LLVMInfo()); + context_.reset(llvm_info_->GetLLVMContext()); + module_ = llvm_info_->GetLLVMModule(); #endif // Include the runtime function declaration @@ -211,7 +211,7 @@ CompilationUnit::~CompilationUnit() { #if defined(ART_USE_DEXLANG_FRONTEND) delete dex_lang_ctx_; #elif defined(ART_USE_QUICK_COMPILER) - llvm::LLVMContext* llvm_context = context_.release(); // Managed by quick_ctx_ + llvm::LLVMContext* llvm_context = context_.release(); // Managed by llvm_info_ CHECK(llvm_context != NULL); #endif } @@ -331,7 +331,7 @@ bool CompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) { #if defined(ART_USE_DEXLANG_FRONTEND) fpm.add(CreateGBCExpanderPass(dex_lang_ctx_->GetIntrinsicHelper(), *irb_.get())); #elif defined(ART_USE_QUICK_COMPILER) - fpm.add(CreateGBCExpanderPass(*quick_ctx_->GetIntrinsicHelper(), *irb_.get(), + fpm.add(CreateGBCExpanderPass(*llvm_info_->GetIntrinsicHelper(), *irb_.get(), compiler_, oat_compilation_unit_)); #endif fpm.add(new ::AddSuspendCheckToLoopLatchPass(irb_.get())); @@ -341,7 +341,7 @@ bool CompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) { #if defined(ART_USE_DEXLANG_FRONTEND) fpm2.add(CreateGBCExpanderPass(dex_lang_ctx_->GetIntrinsicHelper(), *irb_.get())); #elif defined(ART_USE_QUICK_COMPILER) - fpm2.add(CreateGBCExpanderPass(*quick_ctx_->GetIntrinsicHelper(), *irb_.get(), + fpm2.add(CreateGBCExpanderPass(*llvm_info_->GetIntrinsicHelper(), *irb_.get(), compiler_, oat_compilation_unit_)); #endif fpm2.add(new ::AddSuspendCheckToLoopLatchPass(irb_.get())); |