summaryrefslogtreecommitdiffstats
path: root/vm/Jni.c
diff options
context:
space:
mode:
authorJim Huang <jserv@0xlab.org>2010-09-13 20:04:09 +0800
committerSteve Kondik <shade@chemlab.org>2010-11-20 02:14:14 -0500
commit51ab0adb191273f9e28441724f1384c31779c125 (patch)
tree6d8586ff48142d7f59f8b4056a61b54c21da0bcc /vm/Jni.c
parent27ed151a61235e67a22629df8b66a01bc16e4502 (diff)
downloadandroid_dalvik-froyo.tar.gz
android_dalvik-froyo.tar.bz2
android_dalvik-froyo.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 'vm/Jni.c')
-rw-r--r--vm/Jni.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm/Jni.c b/vm/Jni.c
index 6692f3bb5..9ce2f8026 100644
--- a/vm/Jni.c
+++ b/vm/Jni.c
@@ -4255,6 +4255,7 @@ void dvmLateEnableCheckedJni(void)
/*
* Not supported.
*/
+DVM_EXPORT
jint JNI_GetDefaultJavaVMInitArgs(void* vm_args)
{
return JNI_ERR;
@@ -4265,6 +4266,7 @@ jint JNI_GetDefaultJavaVMInitArgs(void* vm_args)
*
* We always have zero or one.
*/
+DVM_EXPORT
jint JNI_GetCreatedJavaVMs(JavaVM** vmBuf, jsize bufLen, jsize* nVMs)
{
if (gDvm.vmList != NULL) {
@@ -4286,6 +4288,7 @@ jint JNI_GetCreatedJavaVMs(JavaVM** vmBuf, jsize bufLen, jsize* nVMs)
* The current thread becomes the main VM thread. We return immediately,
* which effectively means the caller is executing in a native method.
*/
+DVM_EXPORT
jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args)
{
const JavaVMInitArgs* args = (JavaVMInitArgs*) vm_args;