From 500c9be1f261a8a95ae7a25f4f8084f43207f313 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 25 Nov 2015 15:59:14 +0000 Subject: Enable profiled guided compilation in dex2oat - add parsing of the profile info saved during JIT. - don't compile methods which are not part of the profile info. - delete old profile hooks. - add test for reading/writing profile. The test is disable in: * interpreter modes: the test needs JIT. * no-dex2oat/no-prebuild: we only save profiling info for the primary oat file. In these modes we don't create oat files and thus nothing is saved. Bug:26080105 Change-Id: Ifdc63dc9d4b537fc79e54c3edc3ae3a462bc30fb --- compiler/driver/compiler_driver.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 1347b37fa0..a351f6d5df 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -31,11 +31,11 @@ #include "compiler.h" #include "dex_file.h" #include "driver/compiled_method_storage.h" +#include "jit/offline_profiling_info.h" #include "invoke_type.h" #include "method_reference.h" #include "mirror/class.h" // For mirror::Class::Status. #include "os.h" -#include "profiler.h" #include "runtime.h" #include "safe_map.h" #include "thread_pool.h" @@ -147,10 +147,6 @@ class CompilerDriver { return compiler_.get(); } - bool ProfilePresent() const { - return profile_present_; - } - // Are we compiling and creating an image file? bool IsBootImage() const { return boot_image_; @@ -445,6 +441,10 @@ class CompilerDriver { // Checks whether the provided method should be compiled, i.e., is in method_to_compile_. bool IsMethodToCompile(const MethodReference& method_ref) const; + // Checks whether profile guided compilation is enabled and if the method should be compiled + // according to the profile file. + bool ShouldCompileBasedOnProfile(const MethodReference& method_ref) const; + void RecordClassStatus(ClassReference ref, mirror::Class::Status status) REQUIRES(!compiled_classes_lock_); @@ -454,9 +454,6 @@ class CompilerDriver { uint16_t class_def_idx, const DexFile& dex_file) const; - // Should the compiler run on this method given profile information? - bool SkipCompilation(const std::string& method_name); - // Get memory usage during compilation. std::string GetMemoryUsageString(bool extended) const; @@ -595,9 +592,6 @@ class CompilerDriver { ThreadPool* thread_pool, TimingLogger* timings) REQUIRES(!Locks::mutator_lock_); - ProfileFile profile_file_; - bool profile_present_; - const CompilerOptions* const compiler_options_; VerificationResults* const verification_results_; DexFileToMethodInlinerMap* const method_inliner_map_; @@ -647,6 +641,9 @@ class CompilerDriver { // This option may be restricted to the boot image, depending on a flag in the implementation. std::unique_ptr> methods_to_compile_; + // Info for profile guided compilation. + std::unique_ptr profile_compilation_info_; + bool had_hard_verifier_failure_; size_t thread_count_; -- cgit v1.2.3-59-g8ed1b