summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2018-03-19 19:46:27 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-03-19 19:46:27 +0000
commit99ddca5a98d360853c5c4a0d402cd16453ca83b0 (patch)
tree1d2a3e56b8a60a7d9884aa68d5655d65cd693b00 /compiler/driver/compiler_driver.h
parentf9635aab3f2db9b1b13184e8146530a53246b82c (diff)
parentbe0c7cfdbb2b73d6beb1284fdedb8e07766630e9 (diff)
Merge "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 8db892bf18..46d8373c52 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 dash_pos = boot_image_filename.find_last_of("-/");
+ if (dash_pos == std::string::npos || boot_image_filename[dash_pos] != '-') {
+ return false;
+ }
+ return (dash_pos >= 4u) && (boot_image_filename.compare(dash_pos - 4u, 4u, "core") == 0);
}
optimizer::DexToDexCompiler& GetDexToDexCompiler() {