diff options
| author | 2012-10-12 07:35:41 -0700 | |
|---|---|---|
| committer | 2012-10-12 07:35:42 -0700 | |
| commit | 4fe0ef28ed58502a3652e827f5931df0b45cf39c (patch) | |
| tree | 5fa390e59abda86faac886284611d3f94ca614b5 /src/compiler.h | |
| parent | 9958daab2a4b0c26482698ac74d3035600115faf (diff) | |
| parent | 4df2bbdfe6602ce5f141b7b44028b95faa0bd8ef (diff) | |
Merge "Enable multi-threaded Quick compilation" into dalvik-dev
Diffstat (limited to 'src/compiler.h')
| -rw-r--r-- | src/compiler.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/compiler.h b/src/compiler.h index c5f19f7be9..5e9dbd77b5 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -40,6 +40,22 @@ class CompilationContext; class OatCompilationUnit; class TimingLogger; +// Thread-local storage compiler worker threads +class CompilerTls { +#if defined(ART_USE_QUICK_COMPILER) + public: + CompilerTls() : llvm_info_(NULL) {} + ~CompilerTls() {} + + void* GetLLVMInfo() { return llvm_info_; } + + void SetLLVMInfo(void* llvm_info) { llvm_info_ = llvm_info; } + + private: + void* llvm_info_; +#endif +}; + class Compiler { public: // Create a compiler targeting the requested "instruction_set". @@ -72,6 +88,8 @@ class Compiler { return image_; } + CompilerTls* GetTls(); + // Stub to throw AbstractMethodError static ByteArray* CreateAbstractMethodErrorStub(InstructionSet instruction_set) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -347,6 +365,8 @@ class Compiler { const char* shorty, uint32_t shorty_len); CreateInvokeStubFn create_invoke_stub_; + pthread_key_t tls_key_; + #if defined(ART_USE_LLVM_COMPILER) typedef CompiledInvokeStub* (*CreateProxyStubFn) (Compiler& compiler, const char* shorty, uint32_t shorty_len); |