summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-12-09 16:38:30 -0800
committer Mathieu Chartier <mathieuc@google.com> 2016-02-26 13:07:39 -0800
commitc5dd319c574f67d11a71f1b60ac6c34bfe93b750 (patch)
tree51de8bdd7a891478e6d22a6f53781d53290c2d20 /compiler/driver/compiler_driver.cc
parent01c30e8dbc45bdc5d922cef6e5a404be7bed0e8c (diff)
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 (cherry picked from commit 8913fc1a27df8cf3b37fd99e94d87f290591328e) Change-Id: Ifcd09230cbdc266305bc1247e0d31e7920eb353e
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index a9fec30bfe..3100b6da0f 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -384,7 +384,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() {
@@ -868,12 +870,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 {