From 39c3bfbd03d85c63cfbe69f17ce5800ccc7d6c13 Mon Sep 17 00:00:00 2001 From: Dave Allison Date: Tue, 28 Jan 2014 18:33:52 -0800 Subject: Make use of profiling information for dex2oat If the profile file exists, the compiler driver will read it and store the data in an internal map. Then, when we want to work out whether to compile a method or not, the map is consulted and if the method shows up with a high enough percentage of use we compile it. The profile file itself is created by installd and is writeable by the app. The file is in /data/dalvik-cache/profiles and is named by the package name. This also modifies the profiler itself to: 1. Only count runnable threads (not suspended threads) in the profile 2. Use system properties to allow tuning of the profile parameters 3. Merge profiles from multiple processes using file locking. Bug: 12877748 Change-Id: Iab2f3a327a2860db2a80d5724277d6c626227f2b Conflicts: compiler/dex/frontend.cc compiler/dex/mir_analysis.cc compiler/dex/verification_results.cc compiler/driver/compiler_driver.cc dex2oat/dex2oat.cc runtime/class_linker.cc runtime/runtime.cc runtime/runtime.h --- compiler/driver/compiler_options.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/driver/compiler_options.h') diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 39738ab049..0cca1e9705 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -23,6 +23,7 @@ class CompilerOptions { public: enum CompilerFilter { kInterpretOnly, // Compile nothing. + kProfiled, // Compile based on profile. kSpace, // Maximize space savings. kBalanced, // Try to get the best performance return on compilation investment. kSpeed, // Maximize runtime performance. @@ -30,7 +31,11 @@ class CompilerOptions { }; // Guide heuristics to determine whether to compile method if profile data not available. +#if ART_SMALL_MODE + static const CompilerFilter kDefaultCompilerFilter = kProfiled; +#else static const CompilerFilter kDefaultCompilerFilter = kSpeed; +#endif static const size_t kDefaultHugeMethodThreshold = 10000; static const size_t kDefaultLargeMethodThreshold = 600; static const size_t kDefaultSmallMethodThreshold = 60; -- cgit v1.2.3-59-g8ed1b