summaryrefslogtreecommitdiff
path: root/runtime/parsed_options.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/parsed_options.cc')
-rw-r--r--runtime/parsed_options.cc75
1 files changed, 59 insertions, 16 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index 4d2448293c..7df765fe29 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -82,6 +82,7 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
DCHECK_EQ(hiddenapi_policy_valuemap.size(),
static_cast<size_t>(hiddenapi::EnforcementPolicy::kMax) + 1);
+ // clang-format off
parser_builder->
SetCategory("standard")
.Define({"-classpath _", "-cp _"})
@@ -183,6 +184,10 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.IntoKey(M::Image)
.Define("-Xforcejitzygote")
.IntoKey(M::ForceJitZygote)
+ .Define("-Xallowinmemorycompilation")
+ .WithHelp("Allows compiling the boot classpath in memory when the given boot image is"
+ "unusable. This option is set by default for Zygote.")
+ .IntoKey(M::AllowInMemoryCompilation)
.Define("-Xprimaryzygote")
.IntoKey(M::PrimaryZygote)
.Define("-Xbootclasspath-locations:_")
@@ -245,6 +250,7 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.WithValueMap({{"false", false}, {"true", true}})
.IntoKey(M::DumpNativeStackOnSigQuit)
.Define("-XX:MadviseRandomAccess:_")
+ .WithHelp("Deprecated option")
.WithType<bool>()
.WithValueMap({{"false", false}, {"true", true}})
.IntoKey(M::MadviseRandomAccess)
@@ -351,6 +357,12 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.IntoKey(M::MethodTraceFileSize)
.Define("-Xmethod-trace-stream")
.IntoKey(M::MethodTraceStreaming)
+ .Define("-Xmethod-trace-clock:_")
+ .WithType<TraceClockSource>()
+ .WithValueMap({{"threadcpuclock", TraceClockSource::kThreadCpu},
+ {"wallclock", TraceClockSource::kWall},
+ {"dualclock", TraceClockSource::kDual}})
+ .IntoKey(M::MethodTraceClock)
.Define("-Xcompiler:_")
.WithType<std::string>()
.IntoKey(M::Compiler)
@@ -464,18 +476,44 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize
.WithType<bool>()
.WithValueMap({{"false", false}, {"true", true}})
.IntoKey(M::PerfettoJavaHeapStackProf);
-
- FlagBase::AddFlagsToCmdlineParser(parser_builder.get());
-
- parser_builder->Ignore({
- "-ea", "-da", "-enableassertions", "-disableassertions", "--runtime-arg", "-esa",
- "-dsa", "-enablesystemassertions", "-disablesystemassertions", "-Xrs", "-Xint:_",
- "-Xdexopt:_", "-Xnoquithandler", "-Xjnigreflimit:_", "-Xgenregmap", "-Xnogenregmap",
- "-Xverifyopt:_", "-Xcheckdexsum", "-Xincludeselectedop", "-Xjitop:_",
- "-Xincludeselectedmethod",
- "-Xjitblocking", "-Xjitmethod:_", "-Xjitclass:_", "-Xjitoffset:_",
- "-Xjitosrthreshold:_", "-Xjitconfig:_", "-Xjitcheckcg", "-Xjitverbose", "-Xjitprofile",
- "-Xjitdisableopt", "-Xjitsuspendpoll", "-XX:mainThreadStackSize=_"})
+ // clang-format on
+
+ FlagBase::AddFlagsToCmdlineParser(parser_builder.get());
+
+ parser_builder
+ ->Ignore({"-ea",
+ "-da",
+ "-enableassertions",
+ "-disableassertions",
+ "--runtime-arg",
+ "-esa",
+ "-dsa",
+ "-enablesystemassertions",
+ "-disablesystemassertions",
+ "-Xrs",
+ "-Xint:_",
+ "-Xdexopt:_",
+ "-Xnoquithandler",
+ "-Xjnigreflimit:_",
+ "-Xgenregmap",
+ "-Xnogenregmap",
+ "-Xverifyopt:_",
+ "-Xcheckdexsum",
+ "-Xincludeselectedop",
+ "-Xjitop:_",
+ "-Xincludeselectedmethod",
+ "-Xjitblocking",
+ "-Xjitmethod:_",
+ "-Xjitclass:_",
+ "-Xjitoffset:_",
+ "-Xjitosrthreshold:_",
+ "-Xjitconfig:_",
+ "-Xjitcheckcg",
+ "-Xjitverbose",
+ "-Xjitprofile",
+ "-Xjitdisableopt",
+ "-Xjitsuspendpoll",
+ "-XX:mainThreadStackSize=_"})
.IgnoreUnrecognized(ignore_unrecognized)
.OrderCategories({"standard", "extended", "Dalvik", "ART"});
@@ -637,6 +675,7 @@ bool ParsedOptions::DoParse(const RuntimeOptions& options,
using M = RuntimeArgumentMap;
RuntimeArgumentMap args = parser->ReleaseArgumentsMap();
+ bool use_default_bootclasspath = true;
// -help, -showversion, etc.
if (args.Exists(M::Help)) {
@@ -650,6 +689,7 @@ bool ParsedOptions::DoParse(const RuntimeOptions& options,
Exit(0);
} else if (args.Exists(M::BootClassPath)) {
LOG(INFO) << "setting boot class path to " << args.Get(M::BootClassPath)->Join();
+ use_default_bootclasspath = false;
}
if (args.GetOrDefault(M::Interpret)) {
@@ -732,12 +772,15 @@ bool ParsedOptions::DoParse(const RuntimeOptions& options,
Exit(0);
}
// If `boot.art` exists in the ART APEX, it will be used. Otherwise, Everything will be JITed.
- args.Set(M::Image,
- ParseStringList<':'>{{"boot.art!/apex/com.android.art/etc/boot-image.prof",
- "/nonx/boot-framework.art!/system/etc/boot-image.prof"}});
+ args.Set(M::Image, ParseStringList<':'>::Split(GetJitZygoteBootImageLocation()));
+ }
+
+ if (args.Exists(M::Zygote)) {
+ args.Set(M::AllowInMemoryCompilation, Unit());
}
- if (!args.Exists(M::CompilerCallbacksPtr) && !args.Exists(M::Image)) {
+ if (!args.Exists(M::CompilerCallbacksPtr) && !args.Exists(M::Image) &&
+ use_default_bootclasspath) {
const bool deny_art_apex_data_files = args.Exists(M::DenyArtApexDataFiles);
std::string image_locations =
GetDefaultBootImageLocation(GetAndroidRoot(), deny_art_apex_data_files);