diff options
author | Jim Huang <jserv@0xlab.org> | 2010-09-13 20:04:09 +0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-11-20 02:14:14 -0500 |
commit | 51ab0adb191273f9e28441724f1384c31779c125 (patch) | |
tree | 6d8586ff48142d7f59f8b4056a61b54c21da0bcc /dalvikdefines.h | |
parent | 27ed151a61235e67a22629df8b66a01bc16e4502 (diff) | |
download | android_dalvik-froyo-stable.tar.gz android_dalvik-froyo-stable.tar.bz2 android_dalvik-froyo-stable.zip |
Use GCC visibility to reduce the size of libdvm by 10%froyo-stablefroyo
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
Diffstat (limited to 'dalvikdefines.h')
-rw-r--r-- | dalvikdefines.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dalvikdefines.h b/dalvikdefines.h new file mode 100644 index 000000000..4329fcf94 --- /dev/null +++ b/dalvikdefines.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Dalvik implementation specific definitions. + */ + +#ifndef _DALVIK_DEFINES_H +#define _DALVIK_DEFINES_H + +#if defined(ANDROID) + +/* Use GCC visibility */ +#define DVM_EXPORT __attribute__((visibility("default"))) +#define DEX_EXPORT DVM_EXPORT + +#else + +#define DVM_EXPORT +#define DEX_EXPORT + +#endif + +#endif /* ! _DALVIK_DEFINES_H */ |