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/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 90446b0..33f64d9 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -17,6 +17,7 @@
#include "concurrent_copying.h"
#include "art_field-inl.h"
+#include "base/enums.h"
#include "base/histogram-inl.h"
#include "base/stl_util.h"
#include "base/systrace.h"
@@ -1588,7 +1589,7 @@
ArtMethod* method = gc_root_source->GetArtMethod();
LOG(INTERNAL_FATAL) << "gc root in method " << method << " " << PrettyMethod(method);
RootPrinter root_printer;
- method->VisitRoots(root_printer, sizeof(void*));
+ method->VisitRoots(root_printer, kRuntimePointerSize);
}
ref->GetLockWord(false).Dump(LOG(INTERNAL_FATAL));
region_space_->DumpNonFreeRegions(LOG(INTERNAL_FATAL));
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 9f54f1c..e276137 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -23,6 +23,7 @@
#include <vector>
#include "base/bounded_fifo.h"
+#include "base/enums.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/mutex-inl.h"
@@ -430,7 +431,7 @@
<< " first_ref_field_offset="
<< (holder_->IsClass()
? holder_->AsClass()->GetFirstReferenceStaticFieldOffset(
- sizeof(void*))
+ kRuntimePointerSize)
: holder_->GetClass()->GetFirstReferenceInstanceFieldOffset())
<< " num_of_ref_fields="
<< (holder_->IsClass()