diff options
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); |