From 7f76761d8705b7aa5b1fdd2fc1ebb80250992f4c Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Thu, 1 Mar 2012 18:54:49 +0800 Subject: Cleanup LLVM code generation code. Materialize the bitcode in the end of CompileClass, so that the code generation time won't be calculated in method compilation time. Change-Id: I1e2bd0b23bcb5c55bd966a31b1df0b8b34922f94 --- src/compiler_llvm/compiler_llvm.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/compiler_llvm/compiler_llvm.h') diff --git a/src/compiler_llvm/compiler_llvm.h b/src/compiler_llvm/compiler_llvm.h index 208edfcd22..3c653a3669 100644 --- a/src/compiler_llvm/compiler_llvm.h +++ b/src/compiler_llvm/compiler_llvm.h @@ -56,7 +56,9 @@ class CompilerLLVM { ~CompilerLLVM(); - void MaterializeEveryCompilationUnit(); + void MaterializeIfThresholdReached(); + + void MaterializeRemainder(); Compiler* GetCompiler() const { return compiler_; @@ -81,21 +83,25 @@ class CompilerLLVM { CompiledInvokeStub* CreateInvokeStub(bool is_static, char const *shorty); private: - void EnsureCompilationUnit(); + void EnsureCompilationUnit(MutexLock& GUARD); - void MaterializeCompilationUnit(); + void Materialize(MutexLock& GUARD); - void MaterializeCompilationUnitSafePoint(); + bool IsBitcodeFileNameAvailable() const { + return !bitcode_filename_.empty(); + } Compiler* compiler_; + public: Mutex compiler_lock_; + private: InstructionSet insn_set_; - UniquePtr cunit_; + CompilationUnit* curr_cunit_; - unsigned cunit_counter_; + std::vector cunits_; std::string elf_filename_; -- cgit v1.2.3-59-g8ed1b