ART: Convert pointer size to enum
Move away from size_t to dedicated enum (class).
Bug: 30373134
Bug: 30419309
Test: m test-art-host
Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
diff --git a/runtime/mirror/abstract_method.cc b/runtime/mirror/abstract_method.cc
index ef39132..b4dce58 100644
--- a/runtime/mirror/abstract_method.cc
+++ b/runtime/mirror/abstract_method.cc
@@ -21,7 +21,7 @@
namespace art {
namespace mirror {
-template <size_t kPointerSize, bool kTransactionActive>
+template <PointerSize kPointerSize, bool kTransactionActive>
bool AbstractMethod::CreateFromArtMethod(ArtMethod* method) {
auto* interface_method = method->GetInterfaceMethodIfProxy(kPointerSize);
SetArtMethod<kTransactionActive>(method);
@@ -33,10 +33,14 @@
return true;
}
-template bool AbstractMethod::CreateFromArtMethod<4U, false>(ArtMethod* method);
-template bool AbstractMethod::CreateFromArtMethod<4U, true>(ArtMethod* method);
-template bool AbstractMethod::CreateFromArtMethod<8U, false>(ArtMethod* method);
-template bool AbstractMethod::CreateFromArtMethod<8U, true>(ArtMethod* method);
+template bool AbstractMethod::CreateFromArtMethod<PointerSize::k32, false>(
+ ArtMethod* method);
+template bool AbstractMethod::CreateFromArtMethod<PointerSize::k32, true>(
+ ArtMethod* method);
+template bool AbstractMethod::CreateFromArtMethod<PointerSize::k64, false>(
+ ArtMethod* method);
+template bool AbstractMethod::CreateFromArtMethod<PointerSize::k64, true>(
+ ArtMethod* method);
ArtMethod* AbstractMethod::GetArtMethod() {
return reinterpret_cast<ArtMethod*>(GetField64(ArtMethodOffset()));