summaryrefslogtreecommitdiff
path: root/src/compiler/codegen
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-10-12 07:35:41 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-10-12 07:35:42 -0700
commit4fe0ef28ed58502a3652e827f5931df0b45cf39c (patch)
tree5fa390e59abda86faac886284611d3f94ca614b5 /src/compiler/codegen
parent9958daab2a4b0c26482698ac74d3035600115faf (diff)
parent4df2bbdfe6602ce5f141b7b44028b95faa0bd8ef (diff)
Merge "Enable multi-threaded Quick compilation" into dalvik-dev
Diffstat (limited to 'src/compiler/codegen')
-rw-r--r--src/compiler/codegen/MethodBitcode.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index 58678a0acb..cf07ea45c3 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -170,11 +170,20 @@ void createLocFromValue(CompilationUnit* cUnit, llvm::Value* val)
}
void initIR(CompilationUnit* cUnit)
{
- QuickCompiler* quick = cUnit->quick_compiler;
- cUnit->context = quick->GetLLVMContext();
- cUnit->module = quick->GetLLVMModule();
- cUnit->intrinsic_helper = quick->GetIntrinsicHelper();
- cUnit->irb = quick->GetIRBuilder();
+ LLVMInfo* llvmInfo = cUnit->llvm_info;
+ if (llvmInfo == NULL) {
+ CompilerTls* tls = cUnit->compiler->GetTls();
+ CHECK(tls != NULL);
+ llvmInfo = static_cast<LLVMInfo*>(tls->GetLLVMInfo());
+ if (llvmInfo == NULL) {
+ llvmInfo = new LLVMInfo();
+ tls->SetLLVMInfo(llvmInfo);
+ }
+ }
+ cUnit->context = llvmInfo->GetLLVMContext();
+ cUnit->module = llvmInfo->GetLLVMModule();
+ cUnit->intrinsic_helper = llvmInfo->GetIntrinsicHelper();
+ cUnit->irb = llvmInfo->GetIRBuilder();
}
const char* llvmSSAName(CompilationUnit* cUnit, int ssaReg) {