OSDN Git Service

Use GCC visibility to reduce the size of libdvm by 10% android-x86-2.2
authorJim Huang <jserv@0xlab.org>
Mon, 13 Sep 2010 12:04:09 +0000 (20:04 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 12 Nov 2010 09:09:02 +0000 (17:09 +0800)
commitca4fd209d67b9e783f7ad8a1512aa85aa2aba083
tree86651f8810a5207303139aed8b46dd38a5248e9f
parent8a4e069c98bef81740e54ab873b9d4991e4b2382
Use GCC visibility to reduce the size of libdvm by 10%

Originally, libdvm exports many ELF symbols, but Zygote and other
applications don't really depend on all of them.  This change hides
most of the symbols which would have previously (and unnecessarily)
been public.  This means, it improves load time of libdvm, and the
link optimizer could produce better code as well.

The technique is applied in the "Performance" profile.

Reference experimental results of Qualcomm MSM7x25: (524 MHz)

[before]
(1) number of ELF symbols (when WITH_JIT=true)
  # arm-eabi-nm --dynamic ./system/lib/libdvm.so | grep "T " | wc -l
  1222
(2) dlopen/dlsym time
  76906 us
(3) code size
  ./system/lib/libdvm.so 601480 bytes

[after]
(1) number of ELF symbols (when WITH_JIT=true)
  # arm-eabi-nm --dynamic ./system/lib/libdvm.so | grep "T " | wc -l
  58
(2) dlopen/dlsym time
  72296 us
(3) code size
  ./system/lib/libdvm.so 540016 bytes

* dlopen/dlsym time: the time consumption from dlopen "libdvm" to
                     dlsym "dvmPrepForDexOpt"

Change-Id: I47fcf0da1acd970ff136378661360d3328c9c6c0
dalvikdefines.h [new file with mode: 0644]
libdex/Android.mk
libdex/OptInvocation.c
libdex/ZipArchive.c
vm/Dvm.mk
vm/Init.c
vm/Jni.c
vm/analysis/DexOptimize.c