diff --git a/art/runtime/gc/space/image_space.cc b/art/runtime/gc/space/image_space.cc index f765f0e168..610d839675 100644 --- a/art/runtime/gc/space/image_space.cc +++ b/art/runtime/gc/space/image_space.cc @@ -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); } diff --git a/art/runtime/parsed_options.cc b/art/runtime/parsed_options.cc index 2d75860996..d3d508f587 100644 --- a/art/runtime/parsed_options.cc +++ b/art/runtime/parsed_options.cc @@ -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 diff --git a/art/runtime/parsed_options.h b/art/runtime/parsed_options.h index aab58a47e1..5a2dae4ae1 100644 --- a/art/runtime/parsed_options.h +++ b/art/runtime/parsed_options.h @@ -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_; diff --git a/art/runtime/runtime.cc b/art/runtime/runtime.cc index 3e05187d07..17b2bfb784 100644 --- a/art/runtime/runtime.cc +++ b/art/runtime/runtime.cc @@ -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_; diff --git a/art/runtime/runtime.h b/art/runtime/runtime.h index 9e53472831..bacb8e98b7 100644 --- a/art/runtime/runtime.h +++ b/art/runtime/runtime.h @@ -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_;