From 8913fc1a27df8cf3b37fd99e94d87f290591328e Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 9 Dec 2015 16:38:30 -0800 Subject: Add and use loaded class profiling Class profiling is a way to keep track of which classes are resolved. From here the compiler can use this information to generate a smaller app image. TODO: Add tests for profile stuff. Bug: 22858531 Change-Id: I91ccd686394cc2517512f66abb0e277f3d26d4da --- compiler/driver/compiler_driver.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 8ef1f28130..d13800be14 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -382,7 +382,9 @@ CompilerDriver::CompilerDriver( compiler_->Init(); - CHECK_EQ(boot_image_, image_classes_.get() != nullptr); + if (boot_image_) { + CHECK(image_classes_.get() != nullptr) << "Expected image classes for boot image"; + } } CompilerDriver::~CompilerDriver() { @@ -866,12 +868,13 @@ void CompilerDriver::PreCompile(jobject class_loader, } bool CompilerDriver::IsImageClass(const char* descriptor) const { - if (!IsBootImage()) { - // NOTE: Currently only reachable from InitImageMethodVisitor for the app image case. - return true; - } else { + if (image_classes_ != nullptr) { + // If we have a set of image classes, use those. return image_classes_->find(descriptor) != image_classes_->end(); } + // No set of image classes, assume we include all the classes. + // NOTE: Currently only reachable from InitImageMethodVisitor for the app image case. + return !IsBootImage(); } bool CompilerDriver::IsClassToCompile(const char* descriptor) const { -- cgit v1.2.3-59-g8ed1b