summaryrefslogtreecommitdiffstats
path: root/runtime/verifier
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-05-18 20:50:12 -0700
committerAndreas Gampe <agampe@google.com>2015-05-19 14:03:29 -0700
commitf177dd6b9943e5b111b1e06d22a16cd2d01c89c5 (patch)
treef3fb2b5e3f3d975f54063929a9bf8e8fc0831570 /runtime/verifier
parentce70082da8a4e63c280c2f049a67b38acc82ee1a (diff)
downloadart-f177dd6b9943e5b111b1e06d22a16cd2d01c89c5.zip
art-f177dd6b9943e5b111b1e06d22a16cd2d01c89c5.tar.gz
art-f177dd6b9943e5b111b1e06d22a16cd2d01c89c5.tar.bz2
ART: Change huge-method warning in verifier
Change the logging to be included in the took-a-long-time warning, instead of being a non-descriptive standalone. This should reduce the noise. Bug: 21149450 (cherry picked from commit a4f5bf6ea99d6b3095a4ca261352729633bc44c5) Change-Id: Ia4493dd12f54a8452a46541f6da86530584016ea
Diffstat (limited to 'runtime/verifier')
-rw-r--r--runtime/verifier/method_verifier.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 475fe8b..1b1bc54 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -286,6 +286,13 @@ MethodVerifier::FailureKind MethodVerifier::VerifyClass(Thread* self,
}
}
+static bool IsLargeMethod(const DexFile::CodeItem* const code_item) {
+ uint16_t registers_size = code_item->registers_size_;
+ uint32_t insns_size = code_item->insns_size_in_code_units_;
+
+ return registers_size * insns_size > 4*1024*1024;
+}
+
MethodVerifier::FailureKind MethodVerifier::VerifyMethod(Thread* self, uint32_t method_idx,
const DexFile* dex_file,
Handle<mirror::DexCache> dex_cache,
@@ -329,7 +336,8 @@ MethodVerifier::FailureKind MethodVerifier::VerifyMethod(Thread* self, uint32_t
uint64_t duration_ns = NanoTime() - start_ns;
if (duration_ns > MsToNs(100)) {
LOG(WARNING) << "Verification of " << PrettyMethod(method_idx, *dex_file)
- << " took " << PrettyDuration(duration_ns);
+ << " took " << PrettyDuration(duration_ns)
+ << (IsLargeMethod(code_item) ? " (large method)" : "");
}
}
return result;
@@ -1211,10 +1219,6 @@ bool MethodVerifier::VerifyCodeFlow() {
uint16_t registers_size = code_item_->registers_size_;
uint32_t insns_size = code_item_->insns_size_in_code_units_;
- if (registers_size * insns_size > 4*1024*1024) {
- LOG(WARNING) << "warning: method is huge (regs=" << registers_size
- << " insns_size=" << insns_size << ")";
- }
/* Create and initialize table holding register status */
reg_table_.Init(kTrackCompilerInterestPoints,
insn_flags_.get(),