OSDN Git Service

ART: Implement a fixed size string dex cache
authorChristina Wadsworth <cwadsworth@google.com>
Thu, 18 Aug 2016 17:37:42 +0000 (10:37 -0700)
committerChristina Wadsworth <cwadsworth@google.com>
Thu, 18 Aug 2016 23:18:36 +0000 (16:18 -0700)
commitbf44e0e5281de91f2e38a9378b94ef8c50ad9b23
treebb6e65a3434806dc58f286ee75ad3b78ba9d6c36
parentd99565069c64fefc069005286de04599dc2619b8
ART: Implement a fixed size string dex cache

Previously, the string dex cache was dex_file->NumStringIds() size, and
@ruhler found that only ~1% of that cache was ever getting filled. Since
many of these string dex caches were previously 100,000+ indices in
length, we're wasting a few hundred KB per app by storing null pointers.
The intent of this project was to reduce the space the string dex cache
is using, while not regressing on time that much. This is the first of a
few CLs, which implements the new fixed size array and disables the
compiled code so it always goes slow path. In four other CLs, I
implemented a "medium path" that regresses from the previous "fast path"
only a bit in assembly in the entrypoints. @vmarko will introduce new
compiled code in the future so that we ultimately won't be regressing on
time at all. Overall, space savings have been confirmed as on the order
of 100 KB per application.

A 4-5% slow down in art-opt on Golem, and no noticeable slow down in the
interpreter. The opt slow down should be diminished once the new
compiled code is introduced.

Test: m test-art-host

Bug: 20323084

Change-Id: Ic654a1fb9c1ae127dde59290bf36a23edb55ca8e
24 files changed:
compiler/image_writer.cc
compiler/oat_writer.cc
compiler/optimizing/code_generator_arm.cc
compiler/optimizing/code_generator_arm64.cc
compiler/optimizing/code_generator_mips.cc
compiler/optimizing/code_generator_mips64.cc
compiler/optimizing/code_generator_x86.cc
compiler/optimizing/code_generator_x86_64.cc
compiler/optimizing/sharpening.cc
patchoat/patchoat.cc
runtime/class_linker-inl.h
runtime/class_linker.cc
runtime/gc/space/image_space.cc
runtime/interpreter/interpreter_common.h
runtime/mirror/class-inl.h
runtime/mirror/class.h
runtime/mirror/dex_cache-inl.h
runtime/mirror/dex_cache.cc
runtime/mirror/dex_cache.h
runtime/mirror/dex_cache_test.cc
runtime/native/java_lang_DexCache.cc
runtime/utils/dex_cache_arrays_layout-inl.h
runtime/utils/dex_cache_arrays_layout.h
test/Android.run-test.mk