summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-04-12 05:08:49 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-04-12 05:08:49 +0000
commit38a50121f8cc73cabec72eef17e320c557c164d9 (patch)
treede8a489b39dd4ddc7db9035db5912adcb020b0be /compiler/driver/compiler_driver.h
parent7b91439f21c8042ce5b1f180a6e625001ccf3f73 (diff)
parentda802f86c4361c23e827b88573583ee91f0edede (diff)
Merge changes I6c800641,Ia0a05c93 into pi-dev
* changes: ART: Fix core image detection Fix running some run-tests with -Xjitthreshold:0
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index fffa3b345f..a5462eefe2 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -371,9 +371,18 @@ class CompilerDriver {
// Is `boot_image_filename` the name of a core image (small boot
// image used for ART testing only)?
static bool IsCoreImageFilename(const std::string& boot_image_filename) {
- // TODO: This is under-approximating...
- return android::base::EndsWith(boot_image_filename, "core.art")
- || android::base::EndsWith(boot_image_filename, "core-optimizing.art");
+ // Look for "core.art" or "core-*.art".
+ if (android::base::EndsWith(boot_image_filename, "core.art")) {
+ return true;
+ }
+ if (!android::base::EndsWith(boot_image_filename, ".art")) {
+ return false;
+ }
+ size_t slash_pos = boot_image_filename.rfind('/');
+ if (slash_pos == std::string::npos) {
+ return android::base::StartsWith(boot_image_filename, "core-");
+ }
+ return boot_image_filename.compare(slash_pos + 1, 5u, "core-") == 0;
}
optimizer::DexToDexCompiler& GetDexToDexCompiler() {