From d5ce6a80d6795ada9f47600287706135481cbb4b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 16 Sep 2015 17:12:55 -0700 Subject: [PATCH] ART: Skip image visitor in OatWriter for VerifyAtRuntime There's no use running the visitor, and it will force-resolve all methods. Avoid the overhead. Reduces boot image compile time in verify-at-runtime mode from 1.25s to 1s (on the host, in -j4 mode). Bug: 24103765 Change-Id: Icdc3be628fed0c9bda01cf5f24fe377f23c571a9 --- compiler/oat_writer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 4ddd457ac..c96b1715d 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -1123,7 +1123,11 @@ size_t OatWriter::InitOatCodeDexFiles(size_t offset) { } while (false) VISIT(InitCodeMethodVisitor); - if (compiler_driver_->IsImage()) { + // InitImageMethodVisitor visits all methods, resolves them (failing if one cannot be resolved, + // which is a bad sign for a working boot image), and then install entrypoints. + // In case of VerifyAtRuntime, there won't be code, and we do not want to resolve the methods + // (this has been skipped in the driver for performance). + if (compiler_driver_->IsImage() && !compiler_driver_->GetCompilerOptions().VerifyAtRuntime()) { VISIT(InitImageMethodVisitor); } -- 2.11.0