diff options
| author | 2013-07-21 22:07:55 -0700 | |
|---|---|---|
| committer | 2013-07-21 22:24:33 -0700 | |
| commit | 4560248d4c85cade7f4fc7b30c3fb41b95a04a7f (patch) | |
| tree | 2f2b5f0a80f98431594e89f50b7e02539224051d /compiler | |
| parent | 75b13a9cb4df1dee19c459341df1697e196f20f7 (diff) | |
Move TimingLogger creation to dex2oat
Change-Id: I4fdb6afd4ce2ac0d91c6c968893606d593b6ea18
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 18 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.h | 8 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver_test.cc | 5 |
3 files changed, 12 insertions, 19 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 6558f8acfe..b1b205e067 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -335,7 +335,7 @@ extern "C" void compilerLLVMSetBitcodeFileName(art::CompilerDriver& driver, CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet instruction_set, bool image, DescriptorSet* image_classes, - size_t thread_count, bool dump_stats, bool dump_timings) + size_t thread_count, bool dump_stats) : compiler_backend_(compiler_backend), instruction_set_(instruction_set), freezing_constructor_lock_("freezing constructor lock"), @@ -347,7 +347,6 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet start_ns_(0), stats_(new AOTCompilationStats), dump_stats_(dump_stats), - dump_timings_(dump_timings), compiler_library_(NULL), compiler_(NULL), compiler_context_(NULL), @@ -495,20 +494,12 @@ const std::vector<uint8_t>* CompilerDriver::CreateInterpreterToQuickEntry() cons } void CompilerDriver::CompileAll(jobject class_loader, - const std::vector<const DexFile*>& dex_files) { + const std::vector<const DexFile*>& dex_files, + TimingLogger& timings) { DCHECK(!Runtime::Current()->IsStarted()); - UniquePtr<ThreadPool> thread_pool(new ThreadPool(thread_count_)); - TimingLogger timings("compiler", false); - PreCompile(class_loader, dex_files, *thread_pool.get(), timings); - Compile(class_loader, dex_files, *thread_pool.get(), timings); - - if (dump_timings_ && timings.GetTotalNs() > MsToNs(1000)) { - LOG(INFO) << Dumpable<TimingLogger>(timings); - } - if (dump_stats_) { stats_->Dump(); } @@ -537,7 +528,7 @@ static bool IsDexToDexCompilationAllowed(mirror::ClassLoader* class_loader, return klass->IsVerified(); } -void CompilerDriver::CompileOne(const mirror::AbstractMethod* method) { +void CompilerDriver::CompileOne(const mirror::AbstractMethod* method, TimingLogger& timings) { DCHECK(!Runtime::Current()->IsStarted()); Thread* self = Thread::Current(); jobject jclass_loader; @@ -560,7 +551,6 @@ void CompilerDriver::CompileOne(const mirror::AbstractMethod* method) { dex_files.push_back(dex_file); UniquePtr<ThreadPool> thread_pool(new ThreadPool(1U)); - TimingLogger timings("CompileOne", false); PreCompile(jclass_loader, dex_files, *thread_pool.get(), timings); uint32_t method_idx = method->GetDexMethodIndex(); diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 902fda7f0c..1799057ea6 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -72,15 +72,16 @@ class CompilerDriver { // classes. explicit CompilerDriver(CompilerBackend compiler_backend, InstructionSet instruction_set, bool image, DescriptorSet* image_classes, - size_t thread_count, bool dump_stats, bool dump_timings); + size_t thread_count, bool dump_stats); ~CompilerDriver(); - void CompileAll(jobject class_loader, const std::vector<const DexFile*>& dex_files) + void CompileAll(jobject class_loader, const std::vector<const DexFile*>& dex_files, + TimingLogger& timings) LOCKS_EXCLUDED(Locks::mutator_lock_); // Compile a single Method - void CompileOne(const mirror::AbstractMethod* method) + void CompileOne(const mirror::AbstractMethod* method, TimingLogger& timings) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); InstructionSet GetInstructionSet() const { @@ -362,7 +363,6 @@ class CompilerDriver { UniquePtr<AOTCompilationStats> stats_; bool dump_stats_; - bool dump_timings_; typedef void (*CompilerCallbackFn)(CompilerDriver& driver); typedef MutexLock* (*CompilerMutexLockFn)(CompilerDriver& driver); diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 6a160f75c6..78cacaf08e 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -36,7 +36,10 @@ namespace art { class CompilerDriverTest : public CommonTest { protected: void CompileAll(jobject class_loader) LOCKS_EXCLUDED(Locks::mutator_lock_) { - compiler_driver_->CompileAll(class_loader, Runtime::Current()->GetCompileTimeClassPath(class_loader)); + TimingLogger timings("CompilerDriverTest::CompileAll", false); + compiler_driver_->CompileAll(class_loader, + Runtime::Current()->GetCompileTimeClassPath(class_loader), + timings); MakeAllExecutable(class_loader); } |