summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-08-27 00:37:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-08-27 00:37:27 +0000
commit709368e616791209b02d39adb6da5e55782cb45f (patch)
tree3862ab57e95a0e0c0ccf1844fdd2af308685d1f8 /compiler
parent2cdd2f2f4c18de88c0daeddec362c0471d823b0b (diff)
parent8e219ae27624116b6d23e858fb21e93342f81d66 (diff)
downloadandroid_art-709368e616791209b02d39adb6da5e55782cb45f.tar.gz
android_art-709368e616791209b02d39adb6da5e55782cb45f.tar.bz2
android_art-709368e616791209b02d39adb6da5e55782cb45f.zip
Merge "Reduce interpret-only compile time."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/driver/compiler_driver.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index d1458bcf08..ec3955b1f5 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -61,6 +61,8 @@
namespace art {
+static constexpr bool kTimeCompileMethod = !kIsDebugBuild;
+
static double Percentage(size_t x, size_t y) {
return 100.0 * (static_cast<double>(x)) / (static_cast<double>(x + y));
}
@@ -2024,7 +2026,7 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t
const DexFile& dex_file,
DexToDexCompilationLevel dex_to_dex_compilation_level) {
CompiledMethod* compiled_method = NULL;
- uint64_t start_ns = NanoTime();
+ uint64_t start_ns = kTimeCompileMethod ? NanoTime() : 0;
if ((access_flags & kAccNative) != 0) {
// Are we interpreting only and have support for generic JNI down calls?
@@ -2052,10 +2054,12 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t
dex_to_dex_compilation_level);
}
}
- uint64_t duration_ns = NanoTime() - start_ns;
- if (duration_ns > MsToNs(compiler_->GetMaximumCompilationTimeBeforeWarning()) && !kIsDebugBuild) {
- LOG(WARNING) << "Compilation of " << PrettyMethod(method_idx, dex_file)
- << " took " << PrettyDuration(duration_ns);
+ if (kTimeCompileMethod) {
+ uint64_t duration_ns = NanoTime() - start_ns;
+ if (duration_ns > MsToNs(compiler_->GetMaximumCompilationTimeBeforeWarning())) {
+ LOG(WARNING) << "Compilation of " << PrettyMethod(method_idx, dex_file)
+ << " took " << PrettyDuration(duration_ns);
+ }
}
Thread* self = Thread::Current();