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
diff --git a/runtime/mirror/abstract_method.cc b/runtime/mirror/abstract_method.cc
index 81c656b..91a9870 100644
--- a/runtime/mirror/abstract_method.cc
+++ b/runtime/mirror/abstract_method.cc
@@ -16,14 +16,14 @@
#include "abstract_method.h"
-#include "mirror/art_method-inl.h"
+#include "art_method-inl.h"
namespace art {
namespace mirror {
-bool AbstractMethod::CreateFromArtMethod(mirror::ArtMethod* method) {
- auto* interface_method = method->GetInterfaceMethodIfProxy();
- SetFieldObject<false>(ArtMethodOffset(), method);
+bool AbstractMethod::CreateFromArtMethod(ArtMethod* method) {
+ auto* interface_method = method->GetInterfaceMethodIfProxy(sizeof(void*));
+ SetArtMethod(method);
SetFieldObject<false>(DeclaringClassOffset(), method->GetDeclaringClass());
SetFieldObject<false>(
DeclaringClassOfOverriddenMethodOffset(), interface_method->GetDeclaringClass());
@@ -32,8 +32,12 @@
return true;
}
-mirror::ArtMethod* AbstractMethod::GetArtMethod() {
- return GetFieldObject<mirror::ArtMethod>(ArtMethodOffset());
+ArtMethod* AbstractMethod::GetArtMethod() {
+ return reinterpret_cast<ArtMethod*>(GetField64(ArtMethodOffset()));
+}
+
+void AbstractMethod::SetArtMethod(ArtMethod* method) {
+ SetField64<false>(ArtMethodOffset(), reinterpret_cast<uint64_t>(method));
}
mirror::Class* AbstractMethod::GetDeclaringClass() {