summaryrefslogtreecommitdiff
path: root/runtime/native_bridge_art_interface.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2015-12-03 17:38:56 -0800
committer Alex Light <allight@google.com> 2015-12-14 14:27:32 -0800
commit6286a97bea0f584342803a215550038852b24776 (patch)
tree3571735bdc691bf30e33abb65a95ada8c71a18b7 /runtime/native_bridge_art_interface.cc
parent377cb3ba2e1cfe51967e5292268a9aae71ceca8c (diff)
Combine direct_methods_ and virtual_methods_ fields of mirror::Class
This makes several parts of the overall runtime simpler and reduces the size of a class object by 32-bits. Bug: 24618811 Change-Id: I36129b52189e26898ea56fa2b7b45652e06af236
Diffstat (limited to 'runtime/native_bridge_art_interface.cc')
-rw-r--r--runtime/native_bridge_art_interface.cc19
1 files changed, 2 insertions, 17 deletions
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc
index 46cc5aaff8..61a1085c0e 100644
--- a/runtime/native_bridge_art_interface.cc
+++ b/runtime/native_bridge_art_interface.cc
@@ -45,10 +45,7 @@ static uint32_t GetNativeMethodCount(JNIEnv* env, jclass clazz) {
mirror::Class* c = soa.Decode<mirror::Class*>(clazz);
uint32_t native_method_count = 0;
- for (auto& m : c->GetDirectMethods(sizeof(void*))) {
- native_method_count += m.IsNative() ? 1u : 0u;
- }
- for (auto& m : c->GetVirtualMethods(sizeof(void*))) {
+ for (auto& m : c->GetMethods(sizeof(void*))) {
native_method_count += m.IsNative() ? 1u : 0u;
}
return native_method_count;
@@ -63,19 +60,7 @@ static uint32_t GetNativeMethods(JNIEnv* env, jclass clazz, JNINativeMethod* met
mirror::Class* c = soa.Decode<mirror::Class*>(clazz);
uint32_t count = 0;
- for (auto& m : c->GetDirectMethods(sizeof(void*))) {
- if (m.IsNative()) {
- if (count < method_count) {
- methods[count].name = m.GetName();
- methods[count].signature = m.GetShorty();
- methods[count].fnPtr = m.GetEntryPointFromJni();
- count++;
- } else {
- LOG(WARNING) << "Output native method array too small. Skipping " << PrettyMethod(&m);
- }
- }
- }
- for (auto& m : c->GetVirtualMethods(sizeof(void*))) {
+ for (auto& m : c->GetMethods(sizeof(void*))) {
if (m.IsNative()) {
if (count < method_count) {
methods[count].name = m.GetName();