[art] ART: add checkboot option for JavaVM
if product was configured to avoid checking boot, we do not wipe the entire dalvik cache when boot accident occurs
This commit is contained in:
@ -448,7 +448,7 @@ ImageSpace* ImageSpace::Create(const char* image_location,
|
||||
&has_system, &cache_filename, &dalvik_cache_exists,
|
||||
&has_cache, &is_global_cache);
|
||||
|
||||
if (Runtime::Current()->IsZygote()) {
|
||||
if (Runtime::Current()->IsZygote() && Runtime::Current()->IsCheckBoot()) {
|
||||
MarkZygoteStart(image_isa);
|
||||
}
|
||||
|
||||
|
||||
@ -227,6 +227,7 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
|
||||
|
||||
compiler_callbacks_ = nullptr;
|
||||
is_zygote_ = false;
|
||||
check_boot_ = true;
|
||||
must_relocate_ = kDefaultMustRelocate;
|
||||
dex2oat_enabled_ = true;
|
||||
image_dex2oat_enabled_ = true;
|
||||
@ -309,6 +310,8 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize
|
||||
}
|
||||
} else if (StartsWith(option, "-Xcheck:jni")) {
|
||||
check_jni_ = true;
|
||||
} else if (StartsWith(option, "-Xcheckboot")) {
|
||||
check_boot_ = false;
|
||||
} else if (StartsWith(option, "-Xrunjdwp:") || StartsWith(option, "-agentlib:jdwp=")) {
|
||||
std::string tail(option.substr(option[1] == 'X' ? 10 : 15));
|
||||
// TODO: move parsing logic out of Dbg
|
||||
|
||||
@ -44,6 +44,7 @@ class ParsedOptions {
|
||||
std::string class_path_string_;
|
||||
std::string image_;
|
||||
bool check_jni_;
|
||||
bool check_boot_;
|
||||
std::string jni_trace_;
|
||||
std::string native_bridge_library_filename_;
|
||||
CompilerCallbacks* compiler_callbacks_;
|
||||
|
||||
@ -691,6 +691,7 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
|
||||
patchoat_executable_ = options->patchoat_executable_;
|
||||
must_relocate_ = options->must_relocate_;
|
||||
is_zygote_ = options->is_zygote_;
|
||||
check_boot_ = options->check_boot_;
|
||||
is_explicit_gc_disabled_ = options->is_explicit_gc_disabled_;
|
||||
dex2oat_enabled_ = options->dex2oat_enabled_;
|
||||
image_dex2oat_enabled_ = options->image_dex2oat_enabled_;
|
||||
|
||||
@ -122,6 +122,10 @@ class Runtime {
|
||||
return is_zygote_;
|
||||
}
|
||||
|
||||
bool IsCheckBoot() const {
|
||||
return check_boot_;
|
||||
}
|
||||
|
||||
bool IsExplicitGcDisabled() const {
|
||||
return is_explicit_gc_disabled_;
|
||||
}
|
||||
@ -537,6 +541,7 @@ class Runtime {
|
||||
|
||||
CompilerCallbacks* compiler_callbacks_;
|
||||
bool is_zygote_;
|
||||
bool check_boot_;
|
||||
bool must_relocate_;
|
||||
bool is_concurrent_gc_enabled_;
|
||||
bool is_explicit_gc_disabled_;
|
||||
|
||||
Reference in New Issue
Block a user