From ace0dc1dd5480ad458e622085e51583653853fb9 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 20 Jan 2016 13:33:13 -0800 Subject: ART: Add option to ensure deterministic compilation To ensure reliable stable generation of a boot image, add a flag for forced determinism, trading compile time for a deterministic output. We have to run certain passes in the compiler-driver single-threaded. It is also necessary to try to make the heap layout deterministic. Switch to nonconcurrent GC, use the free-list implementation for LOS, and try to allocate the main space at a known location. This is best effort at the moment. To allow the compiler phase to be parallelized, const-strings need to be created beforehand. The identity hashcode seed needs to be pinned. Besides the Dex object we also need to null the DexFile pointer in dex caches. For classes, we need to remove the clinit thread ID. Fix oatdump alignment padding accounting. Bug: 26687569 Change-Id: Ia82120e8f715bb3691d861817b12778ac677355a --- compiler/driver/compiler_options.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_options.cc') diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index 2644528e56..d5667ad19a 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -46,7 +46,8 @@ CompilerOptions::CompilerOptions() abort_on_hard_verifier_failure_(false), init_failure_output_(nullptr), dump_cfg_file_name_(""), - dump_cfg_append_(false) { + dump_cfg_append_(false), + force_determinism_(false) { } CompilerOptions::~CompilerOptions() { @@ -75,7 +76,8 @@ CompilerOptions::CompilerOptions(CompilerFilter compiler_filter, std::ostream* init_failure_output, bool abort_on_hard_verifier_failure, const std::string& dump_cfg_file_name, - bool dump_cfg_append + bool dump_cfg_append, + bool force_determinism ) : // NOLINT(whitespace/parens) compiler_filter_(compiler_filter), huge_method_threshold_(huge_method_threshold), @@ -100,7 +102,8 @@ CompilerOptions::CompilerOptions(CompilerFilter compiler_filter, abort_on_hard_verifier_failure_(abort_on_hard_verifier_failure), init_failure_output_(init_failure_output), dump_cfg_file_name_(dump_cfg_file_name), - dump_cfg_append_(dump_cfg_append) { + dump_cfg_append_(dump_cfg_append), + force_determinism_(force_determinism) { } void CompilerOptions::ParseHugeMethodMax(const StringPiece& option, UsageFn Usage) { -- cgit v1.2.3-59-g8ed1b