diff options
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
-rw-r--r-- | src/compiler_llvm/compiler_llvm.cc | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 95e9803f68..6c8188ef6f 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -225,8 +225,8 @@ const void* CompilerLLVM::GetMethodCodeAddr(const CompiledMethod* cm) const { const Method::InvokeStub* CompilerLLVM:: GetMethodInvokeStubAddr(const CompiledInvokeStub* cm) const { - return elf_loader_->GetMethodInvokeStubAddr(cm->GetStubElfIndex(), - cm->GetInvokeStubElfFuncIndex()); + return elf_loader_->GetMethodInvokeStubAddr(cm->GetElfIndex(), + cm->GetElfFuncIndex()); } @@ -282,12 +282,21 @@ CompiledInvokeStub* CompilerLLVM::CreateInvokeStub(bool is_static, UniquePtr<StubCompiler> stub_compiler( new StubCompiler(curr_cunit_, *compiler_)); - CompiledInvokeStub* compiled_stub = new CompiledInvokeStub(curr_cunit_->GetElfIndex()); + return stub_compiler->CreateInvokeStub(is_static, shorty); +} + + +CompiledInvokeStub* CompilerLLVM::CreateProxyStub(char const *shorty) { + MutexLock GUARD(compiler_lock_); - compiled_stub->SetInvokeStub(stub_compiler->CreateInvokeStub(is_static, shorty)); - compiled_stub->SetProxyStub(stub_compiler->CreateProxyStub(is_static, shorty)); + EnsureCompilationUnit(); + + MutexLock GUARD_CUNIT(curr_cunit_->cunit_lock_); - return compiled_stub; + UniquePtr<StubCompiler> stub_compiler( + new StubCompiler(curr_cunit_, *compiler_)); + + return stub_compiler->CreateProxyStub(shorty); } } // namespace compiler_llvm @@ -349,14 +358,25 @@ extern "C" art::CompiledMethod* ArtJniCompileMethod(art::Compiler& compiler, return result; } -extern "C" art::CompiledInvokeStub* ArtCreateInvokeStub(art::Compiler& compiler, bool is_static, - const char* shorty, uint32_t shorty_len) { +extern "C" art::CompiledInvokeStub* ArtCreateInvokeStub(art::Compiler& compiler, + bool is_static, + const char* shorty, + uint32_t shorty_len) { art::compiler_llvm::CompilerLLVM* compiler_llvm = ContextOf(compiler); art::CompiledInvokeStub* result = compiler_llvm->CreateInvokeStub(is_static, shorty); compiler_llvm->MaterializeIfThresholdReached(); return result; } +extern "C" art::CompiledInvokeStub* ArtCreateProxyStub(art::Compiler& compiler, + const char* shorty, + uint32_t shorty_len) { + art::compiler_llvm::CompilerLLVM* compiler_llvm = ContextOf(compiler); + art::CompiledInvokeStub* result = compiler_llvm->CreateProxyStub(shorty); + compiler_llvm->MaterializeIfThresholdReached(); + return result; +} + extern "C" void compilerLLVMSetBitcodeFileName(art::Compiler& compiler, std::string const& filename) { ContextOf(compiler)->SetBitcodeFileName(filename); |