From c6f41b5b3ca3d7ac3c12ad3995ffef4e831973a0 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 4 Dec 2015 15:38:50 -0800 Subject: Add support for LZ4 compressed image files Added dex2oat option --image-format=(store|lz4). Using lz4 means that the main image section (all data other than header and bitmap) are stored in a compressed state. N5 results: Boot image size: 8067128 -> 2827605 Decompression time 18.93ms Decompression rate: 426MB/s Patchoat is not currently supported since it maps the source image directly. In order to support compressed images we would need to recompress the output image and then write it back out to a file. Also there are not many cases where we would want to patch a compressed image since they are going to be dirty memory when uncompressed anyways. Might as well just patch as we are loading. Bug: 22858531 Change-Id: I8c54ccf73408273011161a61bb891736735074d9 --- compiler/common_compiler_test.cc | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'compiler/common_compiler_test.cc') diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index e6cc50cc5e..3901e25949 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -189,21 +189,33 @@ void CommonCompilerTest::SetUp() { } timer_.reset(new CumulativeLogger("Compilation times")); - compiler_driver_.reset(new CompilerDriver(compiler_options_.get(), - verification_results_.get(), - method_inliner_map_.get(), - compiler_kind_, instruction_set, - instruction_set_features_.get(), - true, - GetImageClasses(), - GetCompiledClasses(), - GetCompiledMethods(), - 2, true, true, "", false, timer_.get(), -1, "")); + CreateCompilerDriver(compiler_kind_, instruction_set); } // We typically don't generate an image in unit tests, disable this optimization by default. compiler_driver_->SetSupportBootImageFixup(false); } +void CommonCompilerTest::CreateCompilerDriver(Compiler::Kind kind, InstructionSet isa) { + compiler_driver_.reset(new CompilerDriver(compiler_options_.get(), + verification_results_.get(), + method_inliner_map_.get(), + kind, + isa, + instruction_set_features_.get(), + true, + GetImageClasses(), + GetCompiledClasses(), + GetCompiledMethods(), + 2, + true, + true, + "", + false, + timer_.get(), + -1, + "")); +} + void CommonCompilerTest::SetUpRuntimeOptions(RuntimeOptions* options) { CommonRuntimeTest::SetUpRuntimeOptions(options); -- cgit v1.2.3-59-g8ed1b