summaryrefslogtreecommitdiffstats
path: root/runtime/native_bridge_art_interface.cc
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 /runtime/native_bridge_art_interface.cc
parente0491682d101c69bf88c3c24a965312129cbfa38 (diff)
downloadart-2d7210188805292e463be4bcf7a133b654d7e0ea.tar.gz
art-2d7210188805292e463be4bcf7a133b654d7e0ea.tar.bz2
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 'runtime/native_bridge_art_interface.cc')
-rw-r--r--runtime/native_bridge_art_interface.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc
index c2c6b12037..ffadfc61a7 100644
--- a/runtime/native_bridge_art_interface.cc
+++ b/runtime/native_bridge_art_interface.cc
@@ -72,7 +72,7 @@ static uint32_t GetNativeMethods(JNIEnv* env, jclass clazz, JNINativeMethod* met
if (count < method_count) {
methods[count].name = m->GetName();
methods[count].signature = m->GetShorty();
- methods[count].fnPtr = const_cast<void*>(m->GetNativeMethod());
+ methods[count].fnPtr = m->GetEntryPointFromJni();
count++;
} else {
LOG(WARNING) << "Output native method array too small. Skipping " << PrettyMethod(m);
@@ -85,7 +85,7 @@ static uint32_t GetNativeMethods(JNIEnv* env, jclass clazz, JNINativeMethod* met
if (count < method_count) {
methods[count].name = m->GetName();
methods[count].signature = m->GetShorty();
- methods[count].fnPtr = const_cast<void*>(m->GetNativeMethod());
+ methods[count].fnPtr = m->GetEntryPointFromJni();
count++;
} else {
LOG(WARNING) << "Output native method array too small. Skipping " << PrettyMethod(m);