// TODO(b/204924812): Make this generic on the predefined and/or provided type. constauto parsed_value = ParseNumeric<uint32_t>(args_parts[1]); if (!parsed_value.IsSuccess()) { return Result::Failure(std::string("Invalid --assume-value value: '") + args + "'");
}
auto known_signature = AssumeValueSignatures::Lookup(class_descriptor, member_name); if (known_signature == AssumeValueSignatures::kSdkInt) {
assume_value_options.SetSdkInt(parsed_value.GetValue()); return Result::SuccessNoValue();
}
// Note that we treat unhandled assumed value members as benign, as the optimization is // strictly best-effort and shouldn't break compilation.
LOG(WARNING) << "Unhandled --assume-value member: " << args; return Result::SuccessNoValue();
}
// If the option isn't explicitly set, use the system property. Mostly used for tests. // Other uses are expected to set the required value. bool build_enabled = map.Exists(Base::AllowProfileCode)
? *map.Get(Base::AllowProfileCode)
: GetBoolProperty("dalvik.vm.allow_profile_code", false);
options->enable_profile_code_ =
com::android::art::rw::flags::enable_profile_code_rw() && build_enabled;
template <typename Map, typename Builder>
NO_INLINE void AddCompilerOptionsArgumentParserOptions(Builder& b) { // clang-format off
b.
Define("--compiler-filter=_")
.template WithType<CompilerFilter::Filter>()
.WithHelp("Select compiler filter\n" "Default: speed-profile if profile provided, speed otherwise")
.IntoKey(Map::CompilerFilter)
.Define({"--compile-art-test", "--no-compile-art-test"})
.WithValues({true, false})
.IntoKey(Map::CompileArtTest)
.Define("--huge-method-max=_")
.template WithType<unsignedint>()
.WithHelp("threshold size for a huge method for compiler filter tuning.")
.IntoKey(Map::HugeMethodMaxThreshold)
.Define("--inline-max-code-units=_")
.template WithType<unsignedint>()
.WithHelp("the maximum code units that a methodcan have to be considered for inlining.\n" "A zero value will disable inlining. Honored only by Optimizing. Has priority\n" "over the --compiler-filter option. Intended for development/experimental use.")
.IntoKey(Map::InlineMaxCodeUnitsThreshold)
.Define("--inline-max-total-instructions=_")
.template WithType<unsignedint>()
.WithHelp("the maximum number of total instructions that a method can have to be\n" "considered for inlining.")
.IntoKey(Map::InlineMaximumNumberOfTotalInstructions)
.Define("--inline-max-instructions-for-small-method=_")
.template WithType<unsignedint>()
.WithHelp("the maximum number of instructions that a method can have to be considered\n" "a small method for inlining.")
.IntoKey(Map::InlineMaxInstructionsForSmallMethod)
.Define("--inline-max-cumulated-dex-registers=_")
.template WithType<unsignedint>()
.WithHelp("the maximum number of dex registers that a method can accumulate by inlining.")
.IntoKey(Map::InlineMaxCumulatedDexRegisters)
.Define("--inline-max-recursive-calls=_")
.template WithType<unsignedint>()
.WithHelp("the maximum number of recursive calls that can be inlined.")
.IntoKey(Map::InlineMaxRecursiveCalls)
.Define({"--generate-debug-info", "-g", "--no-generate-debug-info"})
.WithValues({true, true, false})
.WithHelp("Generate (or don't generate) debug information for native debugging, such as\n" "stack unwinding information, ELF symbols and dwarf sections. If used without\n" "--debuggable it will be best effort only. Does not affect the generated\n" "code. Disabled by default.")
.IntoKey(Map::GenerateDebugInfo)
.Define({"--generate-mini-debug-info", "--no-generate-mini-debug-info"})
.WithValues({true, false})
.WithHelp("Whether or not to generate minimal amount of LZMA-compressed debug\n" "information necessary to print backtraces (disabled by default).")
.IntoKey(Map::GenerateMiniDebugInfo)
.Define({"--generate-build-id", "--no-generate-build-id"})
.WithValues({true, false})
.WithHelp("Generate GNU-compatible linker build ID ELF section with SHA-1 of the file\n" "content (and thus stable across identical builds)")
.IntoKey(Map::GenerateBuildID)
.Define({"--deduplicate-code=_"})
.template WithType<bool>()
.WithValueMap({{"false", false}, {"true", true}})
.WithHelp("enable|disable code deduplication. Deduplicated code will have an arbitrary\n" "symbol tagged with [DEDUPED].")
.IntoKey(Map::DeduplicateCode)
.Define({"--dump-timings"})
.WithHelp("Display a breakdown of where time was spent.")
.IntoKey(Map::DumpTimings)
.Define({"--dump-pass-timings"})
.WithHelp("Display a breakdown time spent in optimization passes for each compiled" " method.")
.IntoKey(Map::DumpPassTimings)
.Define("--dump-cfg=_")
.template WithType<std::string>()
.WithHelp("Dump control-flow graphs (CFGs) to specified file.")
.IntoKey(Map::DumpCFG)
.Define("--dump-cfg-append")
.WithHelp("when dumping CFGs to an existing file, append new CFG data to existing data\n" "(instead of overwriting existing data with new data, which is the default\n" "behavior). This option is only meaningful when used with --dump-cfg.")
.IntoKey(Map::DumpCFGAppend)
.Define("--verbose-methods=_")
.template WithType<ParseStringList<','>>()
.WithHelp("Restrict the dumped CFG data to methods whose name is listed.\n" "Eg: --verbose-methods=toString,hashCode")
.IntoKey(Map::VerboseMethods)
.Define("--assume-value=_")
.template WithType<AssumeValueOptions>()
.AppendValues()
.WithHelp("Optional assumed value for compiling a given field.\n" "E.g.: --assume-value=Landroid/os/Build$VERSION;->SDK_INT:23")
.IntoKey(Map::AssumeValueOpts)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.