summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-11-10 11:08:06 -0800
committerMathieu Chartier <mathieuc@google.com>2014-11-18 12:27:37 -0800
commit2d7210188805292e463be4bcf7a133b654d7e0ea (patch)
tree7705a3bf841ae44b2396728fa22ed0b5dcb44dbf /compiler/image_writer.h
parente0491682d101c69bf88c3c24a965312129cbfa38 (diff)
downloadandroid_art-2d7210188805292e463be4bcf7a133b654d7e0ea.tar.gz
android_art-2d7210188805292e463be4bcf7a133b654d7e0ea.tar.bz2
android_art-2d7210188805292e463be4bcf7a133b654d7e0ea.zip
Change 64 bit ArtMethod fields to be pointer sized
Changed the 64 bit entrypoint and gc map fields in ArtMethod to be pointer sized. This saves a large amount of memory on 32 bit systems. Reduces ArtMethod size by 16 bytes on 32 bit. Total number of ArtMethod on low memory mako: 169957 Image size: 49203 methods -> 787248 image size reduction. Zygote space size: 1070 methods -> 17120 size reduction. App methods: ~120k -> 2 MB savings. Savings per app on low memory mako: 125K+ per app (less active apps -> more image methods per app). Savings depend on how often the shared methods are on dirty pages vs shared. TODO in another CL, delete gc map field from ArtMethod since we should be able to get it from the Oat method header. Bug: 17643507 Change-Id: Ie9508f05907a9f693882d4d32a564460bf273ee8 (cherry picked from commit e832e64a7e82d7f72aedbd7d798fb929d458ee8f)
Diffstat (limited to 'compiler/image_writer.h')
-rw-r--r--compiler/image_writer.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/image_writer.h b/compiler/image_writer.h
index 12171451ae..2fec0aa82d 100644
--- a/compiler/image_writer.h
+++ b/compiler/image_writer.h
@@ -47,7 +47,8 @@ class ImageWriter FINAL {
portable_imt_conflict_trampoline_offset_(0), portable_resolution_trampoline_offset_(0),
portable_to_interpreter_bridge_offset_(0), quick_generic_jni_trampoline_offset_(0),
quick_imt_conflict_trampoline_offset_(0), quick_resolution_trampoline_offset_(0),
- quick_to_interpreter_bridge_offset_(0), compile_pic_(compile_pic) {
+ quick_to_interpreter_bridge_offset_(0), compile_pic_(compile_pic),
+ target_ptr_size_(InstructionSetPointerSize(compiler_driver_.GetInstructionSet())) {
CHECK_NE(image_begin, 0U);
}
@@ -224,6 +225,9 @@ class ImageWriter FINAL {
uint32_t quick_to_interpreter_bridge_offset_;
const bool compile_pic_;
+ // Size of pointers on the target architecture.
+ size_t target_ptr_size_;
+
friend class FixupVisitor;
friend class FixupClassVisitor;
DISALLOW_COPY_AND_ASSIGN(ImageWriter);