summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/driver/compiler_options.cc')
-rw-r--r--compiler/driver/compiler_options.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index 6f39488cc7..cde6ae9330 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -20,11 +20,11 @@
#include <string_view>
#include "android-base/stringprintf.h"
-#include "android-base/strings.h"
#include "arch/instruction_set.h"
#include "arch/instruction_set_features.h"
#include "base/runtime_debug.h"
+#include "base/string_view_cpp20.h"
#include "base/variant_map.h"
#include "class_linker.h"
#include "cmdline_parser.h"
@@ -42,8 +42,6 @@ CompilerOptions::CompilerOptions()
: compiler_filter_(CompilerFilter::kDefaultCompilerFilter),
huge_method_threshold_(kDefaultHugeMethodThreshold),
large_method_threshold_(kDefaultLargeMethodThreshold),
- small_method_threshold_(kDefaultSmallMethodThreshold),
- tiny_method_threshold_(kDefaultTinyMethodThreshold),
num_dex_methods_threshold_(kDefaultNumDexMethodsThreshold),
inline_max_code_units_(kUnsetInlineMaxCodeUnits),
instruction_set_(kRuntimeISA == InstructionSet::kArm ? InstructionSet::kThumb2 : kRuntimeISA),
@@ -78,6 +76,7 @@ CompilerOptions::CompilerOptions()
deduplicate_code_(true),
count_hotness_in_compiled_code_(false),
resolve_startup_const_strings_(false),
+ initialize_app_image_classes_(false),
check_profiled_methods_(ProfileMethodsCheck::kNone),
max_image_block_size_(std::numeric_limits<uint32_t>::max()),
register_allocation_strategy_(RegisterAllocator::kRegisterAllocatorDefault),
@@ -186,18 +185,23 @@ bool CompilerOptions::IsMethodVerifiedWithoutFailures(uint32_t method_idx,
}
bool CompilerOptions::IsCoreImageFilename(const std::string& boot_image_filename) {
+ std::string_view filename(boot_image_filename);
+ size_t colon_pos = filename.find(':');
+ if (colon_pos != std::string_view::npos) {
+ filename = filename.substr(0u, colon_pos);
+ }
// Look for "core.art" or "core-*.art".
- if (android::base::EndsWith(boot_image_filename, "core.art")) {
+ if (EndsWith(filename, "core.art")) {
return true;
}
- if (!android::base::EndsWith(boot_image_filename, ".art")) {
+ if (!EndsWith(filename, ".art")) {
return false;
}
- size_t slash_pos = boot_image_filename.rfind('/');
+ size_t slash_pos = filename.rfind('/');
if (slash_pos == std::string::npos) {
- return android::base::StartsWith(boot_image_filename, "core-");
+ return StartsWith(filename, "core-");
}
- return boot_image_filename.compare(slash_pos + 1, 5u, "core-") == 0;
+ return filename.compare(slash_pos + 1, 5u, "core-") == 0;
}
} // namespace art