diff options
| author | Mathieu Chartier <mathieuc@google.com> | 2015-04-22 13:56:20 -0700 |
|---|---|---|
| committer | Mathieu Chartier <mathieuc@google.com> | 2015-05-29 18:45:49 -0700 |
| commit | e401d146407d61eeb99f8d6176b2ac13c4df1e33 (patch) | |
| tree | 17927f9bfe7d2041b5942c89832d55f9dedb24c5 /runtime/reflection_test.cc | |
| parent | 2006b7b9b8e32722bd0d640c62549d8a0ac624b6 (diff) | |
| download | art-e401d146407d61eeb99f8d6176b2ac13c4df1e33.tar.gz art-e401d146407d61eeb99f8d6176b2ac13c4df1e33.tar.bz2 art-e401d146407d61eeb99f8d6176b2ac13c4df1e33.zip | |
Move mirror::ArtMethod to native
Optimizing + quick tests are passing, devices boot.
TODO: Test and fix bugs in mips64.
Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.
Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
Diffstat (limited to 'runtime/reflection_test.cc')
| -rw-r--r-- | runtime/reflection_test.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index 36e444a061..6f17e7d42c 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -20,8 +20,8 @@ #include <limits.h> #include "ScopedLocalRef.h" +#include "art_method-inl.h" #include "common_compiler_test.h" -#include "mirror/art_method-inl.h" #include "scoped_thread_state_change.h" namespace art { @@ -81,7 +81,7 @@ class ReflectionTest : public CommonCompilerTest { return soa.AddLocalReference<jclass>(c); } - void ReflectionTestMakeExecutable(mirror::ArtMethod** method, + void ReflectionTestMakeExecutable(ArtMethod** method, mirror::Object** receiver, bool is_static, const char* method_name, const char* method_signature) @@ -107,8 +107,8 @@ class ReflectionTest : public CommonCompilerTest { class_loader); CHECK(c != nullptr); - *method = is_static ? c->FindDirectMethod(method_name, method_signature) - : c->FindVirtualMethod(method_name, method_signature); + *method = is_static ? c->FindDirectMethod(method_name, method_signature, sizeof(void*)) + : c->FindVirtualMethod(method_name, method_signature, sizeof(void*)); CHECK(method != nullptr); if (is_static) { @@ -130,7 +130,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeNopMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "nop", "()V"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -139,7 +139,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeIdentityByteMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(B)B"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -164,7 +164,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeIdentityIntMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(I)I"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -189,7 +189,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeIdentityDoubleMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(D)D"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -214,7 +214,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumIntIntMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(II)I"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -243,7 +243,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumIntIntIntMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(III)I"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -282,7 +282,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumIntIntIntIntMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIII)I"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -326,7 +326,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumIntIntIntIntIntMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIIII)I"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -375,7 +375,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumDoubleDoubleMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DD)D"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -409,7 +409,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumDoubleDoubleDoubleMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDD)D"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -436,7 +436,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumDoubleDoubleDoubleDoubleMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDD)D"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -466,7 +466,7 @@ class ReflectionTest : public CommonCompilerTest { void InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(bool is_static) { ScopedObjectAccess soa(env_); - mirror::ArtMethod* method; + ArtMethod* method; mirror::Object* receiver; ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDDD)D"); ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -515,7 +515,7 @@ TEST_F(ReflectionTest, StaticMainMethod) { mirror::Class* klass = class_linker_->FindClass(soa.Self(), "LMain;", class_loader); ASSERT_TRUE(klass != nullptr); - mirror::ArtMethod* method = klass->FindDirectMethod("main", "([Ljava/lang/String;)V"); + ArtMethod* method = klass->FindDirectMethod("main", "([Ljava/lang/String;)V", sizeof(void*)); ASSERT_TRUE(method != nullptr); // Start runtime. |
