OSDN Git Service

Introduce VDEX file, use it for DEX files
authorDavid Brazdil <dbrazdil@google.com>
Thu, 1 Sep 2016 10:06:18 +0000 (11:06 +0100)
committerDavid Brazdil <dbrazdil@google.com>
Mon, 12 Sep 2016 13:39:07 +0000 (14:39 +0100)
commit7b49e6cade09bc65b3b5f22d45fc9d0a7184e4f2
tree36bb77d376708ba0f054c9820f4b7ed51437fbb2
parent3bac5443975cd6312e7c6282b94014db25f369d7
Introduce VDEX file, use it for DEX files

This patch introduces a new output file called VDEX. In the future,
VDEX files will store pre-validated DEX files which do not need to be
re-extracted and re-verified when recompiling, e.g. due to new
profiling information or after a system update.

With this CL, the OatWriter writes DEX files into the VDEX and the
rest of its output into OAT. The OatFile class and related classes
are updated to load the VDEX at runtime and mmap the DEX file section
from it. Patchoat creates symlinks to the source VDEX files in the
target directory or copies the files if passed in as file descriptors.

The feature can be disabled by setting the environment variable
ART_ENABLE_VDEX to false.

Test: m test-art-host
Bug: 30937355
Change-Id: I54dcaececf6814c258c80524ec15e2e2ef69c8dd
19 files changed:
build/Android.common_build.mk
build/art.go
compiler/image_test.cc
compiler/oat_test.cc
compiler/oat_writer.cc
compiler/oat_writer.h
dex2oat/dex2oat.cc
oatdump/oatdump.cc
patchoat/patchoat.cc
runtime/Android.bp
runtime/globals.h
runtime/image.h
runtime/oat_file.cc
runtime/oat_file.h
runtime/oat_file_assistant.cc
runtime/utils.cc
runtime/utils.h
runtime/vdex_file.cc [new file with mode: 0644]
runtime/vdex_file.h [new file with mode: 0644]