summaryrefslogtreecommitdiff
path: root/compiler/driver
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/driver')
-rw-r--r--compiler/driver/compiler_driver.cc13
-rw-r--r--compiler/driver/compiler_driver_test.cc4
2 files changed, 10 insertions, 7 deletions
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 {
diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc
index 478588561f..00375641f3 100644
--- a/compiler/driver/compiler_driver_test.cc
+++ b/compiler/driver/compiler_driver_test.cc
@@ -250,8 +250,8 @@ class CompilerDriverProfileTest : public CompilerDriverTest {
ProfileCompilationInfo info;
for (const std::unique_ptr<const DexFile>& dex_file : dex_files) {
std::string key = ProfileCompilationInfo::GetProfileDexFileKey(dex_file->GetLocation());
- profile_info_.AddData(key, dex_file->GetLocationChecksum(), 1);
- profile_info_.AddData(key, dex_file->GetLocationChecksum(), 2);
+ profile_info_.AddMethodIndex(key, dex_file->GetLocationChecksum(), 1);
+ profile_info_.AddMethodIndex(key, dex_file->GetLocationChecksum(), 2);
}
return &profile_info_;
}