summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dex2oat/driver/compiler_driver_test.cc6
-rw-r--r--dex2oat/linker/image_writer.cc4
-rw-r--r--runtime/class_linker-inl.h11
-rw-r--r--runtime/class_linker.cc21
-rw-r--r--runtime/entrypoints/entrypoint_utils-inl.h3
-rw-r--r--runtime/interpreter/mterp/mterp.cc2
-rw-r--r--runtime/mirror/dex_cache-inl.h39
-rw-r--r--runtime/mirror/dex_cache.cc21
-rw-r--r--runtime/mirror/dex_cache.h26
-rw-r--r--runtime/verifier/method_verifier.cc3
-rw-r--r--test/497-inlining-and-class-loader/clear_dex_cache.cc4
-rw-r--r--tools/cpp-define-generator/asm_defines.def1
-rw-r--r--tools/cpp-define-generator/mirror_dex_cache.def34
13 files changed, 59 insertions, 116 deletions
diff --git a/dex2oat/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc
index 3096fc31b9..65aa88869f 100644
--- a/dex2oat/driver/compiler_driver_test.cc
+++ b/dex2oat/driver/compiler_driver_test.cc
@@ -137,11 +137,9 @@ TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) {
}
EXPECT_TRUE(dex_cache->StaticMethodSize() == dex_cache->NumResolvedMethods()
|| dex.NumMethodIds() == dex_cache->NumResolvedMethods());
- auto* cl = Runtime::Current()->GetClassLinker();
- auto pointer_size = cl->GetImagePointerSize();
for (size_t i = 0; i < dex_cache->NumResolvedMethods(); i++) {
// FIXME: This is outdated for hash-based method array.
- ArtMethod* method = dex_cache->GetResolvedMethod(i, pointer_size);
+ ArtMethod* method = dex_cache->GetResolvedMethod(i);
EXPECT_TRUE(method != nullptr) << "method_idx=" << i
<< " " << dex.GetMethodDeclaringClassDescriptor(dex.GetMethodId(i))
<< " " << dex.GetMethodName(dex.GetMethodId(i));
@@ -153,7 +151,7 @@ TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) {
|| dex.NumFieldIds() == dex_cache->NumResolvedFields());
for (size_t i = 0; i < dex_cache->NumResolvedFields(); i++) {
// FIXME: This is outdated for hash-based field array.
- ArtField* field = dex_cache->GetResolvedField(i, cl->GetImagePointerSize());
+ ArtField* field = dex_cache->GetResolvedField(i);
EXPECT_TRUE(field != nullptr) << "field_idx=" << i
<< " " << dex.GetFieldDeclaringClassDescriptor(dex.GetFieldId(i))
<< " " << dex.GetFieldName(dex.GetFieldId(i));
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index 857d6b0a51..d8973d4eda 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -1115,14 +1115,14 @@ void ImageWriter::ClearDexCache(ObjPtr<mirror::DexCache> dex_cache) {
for (size_t slot_idx = 0, num = dex_cache->NumResolvedMethods(); slot_idx != num; ++slot_idx) {
mirror::MethodDexCachePair invalid(nullptr,
mirror::MethodDexCachePair::InvalidIndexForSlot(slot_idx));
- mirror::DexCache::SetNativePairPtrSize(resolved_methods, slot_idx, invalid, target_ptr_size_);
+ mirror::DexCache::SetNativePair(resolved_methods, slot_idx, invalid);
}
// Clear fields.
mirror::FieldDexCacheType* resolved_fields = dex_cache->GetResolvedFields();
for (size_t slot_idx = 0, num = dex_cache->NumResolvedFields(); slot_idx != num; ++slot_idx) {
mirror::FieldDexCachePair invalid(nullptr,
mirror::FieldDexCachePair::InvalidIndexForSlot(slot_idx));
- mirror::DexCache::SetNativePairPtrSize(resolved_fields, slot_idx, invalid, target_ptr_size_);
+ mirror::DexCache::SetNativePair(resolved_fields, slot_idx, invalid);
}
// Clear types.
mirror::TypeDexCacheType* resolved_types = dex_cache->GetResolvedTypes();
diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h
index 81784fb416..69f5a77a25 100644
--- a/runtime/class_linker-inl.h
+++ b/runtime/class_linker-inl.h
@@ -288,8 +288,7 @@ inline bool ClassLinker::CheckInvokeClassMismatch(ObjPtr<mirror::DexCache> dex_c
inline ArtMethod* ClassLinker::LookupResolvedMethod(uint32_t method_idx,
ObjPtr<mirror::DexCache> dex_cache,
ObjPtr<mirror::ClassLoader> class_loader) {
- PointerSize pointer_size = image_pointer_size_;
- ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx, pointer_size);
+ ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx);
if (resolved == nullptr) {
const DexFile& dex_file = *dex_cache->GetDexFile();
const dex::MethodId& method_id = dex_file.GetMethodId(method_idx);
@@ -311,7 +310,7 @@ inline ArtMethod* ClassLinker::GetResolvedMethod(uint32_t method_idx, ArtMethod*
// We do not need the read barrier for getting the DexCache for the initial resolved method
// lookup as both from-space and to-space copies point to the same native resolved methods array.
ArtMethod* resolved_method = referrer->GetDexCache<kWithoutReadBarrier>()->GetResolvedMethod(
- method_idx, image_pointer_size_);
+ method_idx);
if (resolved_method == nullptr) {
return nullptr;
}
@@ -354,7 +353,7 @@ inline ArtMethod* ClassLinker::ResolveMethod(Thread* self,
// We do not need the read barrier for getting the DexCache for the initial resolved method
// lookup as both from-space and to-space copies point to the same native resolved methods array.
ArtMethod* resolved_method = referrer->GetDexCache<kWithoutReadBarrier>()->GetResolvedMethod(
- method_idx, image_pointer_size_);
+ method_idx);
DCHECK(resolved_method == nullptr || !resolved_method->IsRuntimeMethod());
if (UNLIKELY(resolved_method == nullptr)) {
referrer = referrer->GetInterfaceMethodIfProxy(image_pointer_size_);
@@ -422,7 +421,7 @@ inline ArtField* ClassLinker::LookupResolvedField(uint32_t field_idx,
// We do not need the read barrier for getting the DexCache for the initial resolved field
// lookup as both from-space and to-space copies point to the same native resolved fields array.
ArtField* field = referrer->GetDexCache<kWithoutReadBarrier>()->GetResolvedField(
- field_idx, image_pointer_size_);
+ field_idx);
if (field == nullptr) {
ObjPtr<mirror::ClassLoader> class_loader = referrer->GetDeclaringClass()->GetClassLoader();
field = LookupResolvedField(field_idx, referrer->GetDexCache(), class_loader, is_static);
@@ -437,7 +436,7 @@ inline ArtField* ClassLinker::ResolveField(uint32_t field_idx,
// We do not need the read barrier for getting the DexCache for the initial resolved field
// lookup as both from-space and to-space copies point to the same native resolved fields array.
ArtField* resolved_field = referrer->GetDexCache<kWithoutReadBarrier>()->GetResolvedField(
- field_idx, image_pointer_size_);
+ field_idx);
if (UNLIKELY(resolved_field == nullptr)) {
StackHandleScope<2> hs(Thread::Current());
ObjPtr<mirror::Class> referring_class = referrer->GetDeclaringClass();
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 6641f80299..290d5c1fa9 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -5401,14 +5401,14 @@ bool ClassLinker::InitializeClass(Thread* self,
for (size_t i = 0; i < num_static_fields; ++i) {
ArtField* field = klass->GetStaticField(i);
const uint32_t field_idx = field->GetDexFieldIndex();
- ArtField* resolved_field = dex_cache->GetResolvedField(field_idx, image_pointer_size_);
+ ArtField* resolved_field = dex_cache->GetResolvedField(field_idx);
if (resolved_field == nullptr) {
// Populating cache of a dex file which defines `klass` should always be allowed.
DCHECK(!hiddenapi::ShouldDenyAccessToMember(
field,
hiddenapi::AccessContext(class_loader.Get(), dex_cache.Get()),
hiddenapi::AccessMethod::kNone));
- dex_cache->SetResolvedField(field_idx, field, image_pointer_size_);
+ dex_cache->SetResolvedField(field_idx, field);
} else {
DCHECK_EQ(field, resolved_field);
}
@@ -7640,7 +7640,7 @@ class ClassLinker::LinkInterfaceMethodsHelper {
// Check that there are no stale methods are in the dex cache array.
auto* resolved_methods = klass_->GetDexCache()->GetResolvedMethods();
for (size_t i = 0, count = klass_->GetDexCache()->NumResolvedMethods(); i < count; ++i) {
- auto pair = mirror::DexCache::GetNativePairPtrSize(resolved_methods, i, pointer_size);
+ auto pair = mirror::DexCache::GetNativePair(resolved_methods, i);
ArtMethod* m = pair.object;
CHECK(move_table_.find(m) == move_table_.end() ||
// The original versions of copied methods will still be present so allow those too.
@@ -8992,7 +8992,7 @@ ArtMethod* ClassLinker::FindResolvedMethod(ObjPtr<mirror::Class> klass,
<< "DexFile referrer: " << dex_file.GetLocation()
<< " ClassLoader: " << DescribeLoaders(class_loader, "");
// Be a good citizen and update the dex cache to speed subsequent calls.
- dex_cache->SetResolvedMethod(method_idx, resolved, image_pointer_size_);
+ dex_cache->SetResolvedMethod(method_idx, resolved);
// Disable the following invariant check as the verifier breaks it. b/73760543
// const DexFile::MethodId& method_id = dex_file.GetMethodId(method_idx);
// DCHECK(LookupResolvedType(method_id.class_idx_, dex_cache, class_loader) != nullptr)
@@ -9045,8 +9045,7 @@ ArtMethod* ClassLinker::ResolveMethod(uint32_t method_idx,
DCHECK(dex_cache != nullptr);
DCHECK(referrer == nullptr || !referrer->IsProxyMethod());
// Check for hit in the dex cache.
- PointerSize pointer_size = image_pointer_size_;
- ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx, pointer_size);
+ ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx);
Thread::PoisonObjectPointersIfDebug();
DCHECK(resolved == nullptr || !resolved->IsRuntimeMethod());
bool valid_dex_cache_method = resolved != nullptr;
@@ -9136,7 +9135,7 @@ ArtMethod* ClassLinker::ResolveMethod(uint32_t method_idx,
ArtMethod* ClassLinker::ResolveMethodWithoutInvokeType(uint32_t method_idx,
Handle<mirror::DexCache> dex_cache,
Handle<mirror::ClassLoader> class_loader) {
- ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx, image_pointer_size_);
+ ArtMethod* resolved = dex_cache->GetResolvedMethod(method_idx);
Thread::PoisonObjectPointersIfDebug();
if (resolved != nullptr) {
DCHECK(!resolved->IsRuntimeMethod());
@@ -9190,7 +9189,7 @@ ArtField* ClassLinker::ResolveField(uint32_t field_idx,
bool is_static) {
DCHECK(dex_cache != nullptr);
DCHECK(!Thread::Current()->IsExceptionPending()) << Thread::Current()->GetException()->Dump();
- ArtField* resolved = dex_cache->GetResolvedField(field_idx, image_pointer_size_);
+ ArtField* resolved = dex_cache->GetResolvedField(field_idx);
Thread::PoisonObjectPointersIfDebug();
if (resolved != nullptr) {
return resolved;
@@ -9216,7 +9215,7 @@ ArtField* ClassLinker::ResolveFieldJLS(uint32_t field_idx,
Handle<mirror::DexCache> dex_cache,
Handle<mirror::ClassLoader> class_loader) {
DCHECK(dex_cache != nullptr);
- ArtField* resolved = dex_cache->GetResolvedField(field_idx, image_pointer_size_);
+ ArtField* resolved = dex_cache->GetResolvedField(field_idx);
Thread::PoisonObjectPointersIfDebug();
if (resolved != nullptr) {
return resolved;
@@ -9266,7 +9265,7 @@ ArtField* ClassLinker::FindResolvedField(ObjPtr<mirror::Class> klass,
}
if (resolved != nullptr) {
- dex_cache->SetResolvedField(field_idx, resolved, image_pointer_size_);
+ dex_cache->SetResolvedField(field_idx, resolved);
}
return resolved;
@@ -9293,7 +9292,7 @@ ArtField* ClassLinker::FindResolvedFieldJLS(ObjPtr<mirror::Class> klass,
}
if (resolved != nullptr) {
- dex_cache->SetResolvedField(field_idx, resolved, image_pointer_size_);
+ dex_cache->SetResolvedField(field_idx, resolved);
}
return resolved;
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h
index a31be0006d..0b96573f5b 100644
--- a/runtime/entrypoints/entrypoint_utils-inl.h
+++ b/runtime/entrypoints/entrypoint_utils-inl.h
@@ -607,8 +607,7 @@ EXPLICIT_FIND_METHOD_FROM_CODE_TYPED_TEMPLATE_DECL(kInterface);
inline ArtField* FindFieldFast(uint32_t field_idx, ArtMethod* referrer, FindFieldType type,
size_t expected_size) {
ScopedAssertNoThreadSuspension ants(__FUNCTION__);
- ArtField* resolved_field =
- referrer->GetDexCache()->GetResolvedField(field_idx, kRuntimePointerSize);
+ ArtField* resolved_field = referrer->GetDexCache()->GetResolvedField(field_idx);
if (UNLIKELY(resolved_field == nullptr)) {
return nullptr;
}
diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc
index 7e31184060..5927c92555 100644
--- a/runtime/interpreter/mterp/mterp.cc
+++ b/runtime/interpreter/mterp/mterp.cc
@@ -771,7 +771,7 @@ ALWAYS_INLINE bool MterpFieldAccessFast(Instruction* inst,
// Try to find the desired field in DexCache.
uint32_t field_idx = kIsStatic ? inst->VRegB_21c() : inst->VRegC_22c();
- ArtField* field = dex_cache->GetResolvedField(field_idx, kRuntimePointerSize);
+ ArtField* field = dex_cache->GetResolvedField(field_idx);
if (LIKELY(field != nullptr)) {
bool visibly_initialized = !kIsStatic || field->GetDeclaringClass()->IsVisiblyInitialized();
if (LIKELY(visibly_initialized)) {
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 7736f47066..1ca42024f4 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -63,12 +63,11 @@ inline T* DexCachePair<T>::GetObjectForIndex(uint32_t idx) {
}
template <typename T>
-inline void NativeDexCachePair<T>::Initialize(std::atomic<NativeDexCachePair<T>>* dex_cache,
- PointerSize pointer_size) {
+inline void NativeDexCachePair<T>::Initialize(std::atomic<NativeDexCachePair<T>>* dex_cache) {
NativeDexCachePair<T> first_elem;
first_elem.object = nullptr;
first_elem.index = InvalidIndexForSlot(0);
- DexCache::SetNativePairPtrSize(dex_cache, 0, first_elem, pointer_size);
+ DexCache::SetNativePair(dex_cache, 0, first_elem);
}
inline uint32_t DexCache::ClassSize(PointerSize pointer_size) {
@@ -244,17 +243,15 @@ inline uint32_t DexCache::FieldSlotIndex(uint32_t field_idx) {
return slot_idx;
}
-inline ArtField* DexCache::GetResolvedField(uint32_t field_idx, PointerSize ptr_size) {
- DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), ptr_size);
- auto pair = GetNativePairPtrSize(GetResolvedFields(), FieldSlotIndex(field_idx), ptr_size);
+inline ArtField* DexCache::GetResolvedField(uint32_t field_idx) {
+ auto pair = GetNativePair(GetResolvedFields(), FieldSlotIndex(field_idx));
return pair.GetObjectForIndex(field_idx);
}
-inline void DexCache::SetResolvedField(uint32_t field_idx, ArtField* field, PointerSize ptr_size) {
- DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), ptr_size);
+inline void DexCache::SetResolvedField(uint32_t field_idx, ArtField* field) {
DCHECK(field != nullptr);
FieldDexCachePair pair(field, field_idx);
- SetNativePairPtrSize(GetResolvedFields(), FieldSlotIndex(field_idx), pair, ptr_size);
+ SetNativePair(GetResolvedFields(), FieldSlotIndex(field_idx), pair);
}
inline uint32_t DexCache::MethodSlotIndex(uint32_t method_idx) {
@@ -264,25 +261,20 @@ inline uint32_t DexCache::MethodSlotIndex(uint32_t method_idx) {
return slot_idx;
}
-inline ArtMethod* DexCache::GetResolvedMethod(uint32_t method_idx, PointerSize ptr_size) {
- DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), ptr_size);
- auto pair = GetNativePairPtrSize(GetResolvedMethods(), MethodSlotIndex(method_idx), ptr_size);
+inline ArtMethod* DexCache::GetResolvedMethod(uint32_t method_idx) {
+ auto pair = GetNativePair(GetResolvedMethods(), MethodSlotIndex(method_idx));
return pair.GetObjectForIndex(method_idx);
}
-inline void DexCache::SetResolvedMethod(uint32_t method_idx,
- ArtMethod* method,
- PointerSize ptr_size) {
- DCHECK_EQ(Runtime::Current()->GetClassLinker()->GetImagePointerSize(), ptr_size);
+inline void DexCache::SetResolvedMethod(uint32_t method_idx, ArtMethod* method) {
DCHECK(method != nullptr);
MethodDexCachePair pair(method, method_idx);
- SetNativePairPtrSize(GetResolvedMethods(), MethodSlotIndex(method_idx), pair, ptr_size);
+ SetNativePair(GetResolvedMethods(), MethodSlotIndex(method_idx), pair);
}
template <typename T>
-NativeDexCachePair<T> DexCache::GetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array,
- size_t idx,
- PointerSize ptr_size ATTRIBUTE_UNUSED) {
+NativeDexCachePair<T> DexCache::GetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array,
+ size_t idx) {
if (kRuntimePointerSize == PointerSize::k64) {
auto* array = reinterpret_cast<std::atomic<ConversionPair64>*>(pair_array);
ConversionPair64 value = AtomicLoadRelaxed16B(&array[idx]);
@@ -296,10 +288,9 @@ NativeDexCachePair<T> DexCache::GetNativePairPtrSize(std::atomic<NativeDexCacheP
}
template <typename T>
-void DexCache::SetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array,
- size_t idx,
- NativeDexCachePair<T> pair,
- PointerSize ptr_size ATTRIBUTE_UNUSED) {
+void DexCache::SetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array,
+ size_t idx,
+ NativeDexCachePair<T> pair) {
if (kRuntimePointerSize == PointerSize::k64) {
auto* array = reinterpret_cast<std::atomic<ConversionPair64>*>(pair_array);
ConversionPair64 v(reinterpret_cast64<uint64_t>(pair.object), pair.index);
diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc
index 20f4a40353..1b9558e6df 100644
--- a/runtime/mirror/dex_cache.cc
+++ b/runtime/mirror/dex_cache.cc
@@ -54,7 +54,6 @@ void DexCache::InitializeNativeFields(const DexFile* dex_file, LinearAlloc* line
ScopedAssertNoThreadSuspension sants(__FUNCTION__);
Thread* self = Thread::Current();
- const PointerSize image_pointer_size = kRuntimePointerSize;
size_t num_strings = std::min<size_t>(kDexCacheStringCacheSize, dex_file->NumStringIds());
size_t num_types = std::min<size_t>(kDexCacheTypeCacheSize, dex_file->NumTypeIds());
@@ -94,12 +93,12 @@ void DexCache::InitializeNativeFields(const DexFile* dex_file, LinearAlloc* line
CHECK(types[i].load(std::memory_order_relaxed).object.IsNull());
}
for (size_t i = 0; i < num_methods; ++i) {
- CHECK_EQ(GetNativePairPtrSize(methods, i, image_pointer_size).index, 0u);
- CHECK(GetNativePairPtrSize(methods, i, image_pointer_size).object == nullptr);
+ CHECK_EQ(GetNativePair(methods, i).index, 0u);
+ CHECK(GetNativePair(methods, i).object == nullptr);
}
for (size_t i = 0; i < num_fields; ++i) {
- CHECK_EQ(GetNativePairPtrSize(fields, i, image_pointer_size).index, 0u);
- CHECK(GetNativePairPtrSize(fields, i, image_pointer_size).object == nullptr);
+ CHECK_EQ(GetNativePair(fields, i).index, 0u);
+ CHECK(GetNativePair(fields, i).object == nullptr);
}
for (size_t i = 0; i < num_method_types; ++i) {
CHECK_EQ(method_types[i].load(std::memory_order_relaxed).index, 0u);
@@ -116,10 +115,10 @@ void DexCache::InitializeNativeFields(const DexFile* dex_file, LinearAlloc* line
mirror::TypeDexCachePair::Initialize(types);
}
if (fields != nullptr) {
- mirror::FieldDexCachePair::Initialize(fields, image_pointer_size);
+ mirror::FieldDexCachePair::Initialize(fields);
}
if (methods != nullptr) {
- mirror::MethodDexCachePair::Initialize(methods, image_pointer_size);
+ mirror::MethodDexCachePair::Initialize(methods);
}
if (method_types != nullptr) {
mirror::MethodTypeDexCachePair::Initialize(method_types);
@@ -147,7 +146,7 @@ void DexCache::ResetNativeFields() {
void DexCache::VisitReflectiveTargets(ReflectiveValueVisitor* visitor) {
bool wrote = false;
for (size_t i = 0; i < NumResolvedFields(); i++) {
- auto pair(GetNativePairPtrSize(GetResolvedFields(), i, kRuntimePointerSize));
+ auto pair(GetNativePair(GetResolvedFields(), i));
if (pair.index == FieldDexCachePair::InvalidIndexForSlot(i)) {
continue;
}
@@ -159,12 +158,12 @@ void DexCache::VisitReflectiveTargets(ReflectiveValueVisitor* visitor) {
} else {
pair.object = new_val;
}
- SetNativePairPtrSize(GetResolvedFields(), i, pair, kRuntimePointerSize);
+ SetNativePair(GetResolvedFields(), i, pair);
wrote = true;
}
}
for (size_t i = 0; i < NumResolvedMethods(); i++) {
- auto pair(GetNativePairPtrSize(GetResolvedMethods(), i, kRuntimePointerSize));
+ auto pair(GetNativePair(GetResolvedMethods(), i));
if (pair.index == MethodDexCachePair::InvalidIndexForSlot(i)) {
continue;
}
@@ -176,7 +175,7 @@ void DexCache::VisitReflectiveTargets(ReflectiveValueVisitor* visitor) {
} else {
pair.object = new_val;
}
- SetNativePairPtrSize(GetResolvedMethods(), i, pair, kRuntimePointerSize);
+ SetNativePair(GetResolvedMethods(), i, pair);
wrote = true;
}
}
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index 2a16879efa..dd05dddc46 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -97,7 +97,7 @@ template <typename T> struct PACKED(2 * __SIZEOF_POINTER__) NativeDexCachePair {
NativeDexCachePair(const NativeDexCachePair<T>&) = default;
NativeDexCachePair& operator=(const NativeDexCachePair<T>&) = default;
- static void Initialize(std::atomic<NativeDexCachePair<T>>* dex_cache, PointerSize pointer_size);
+ static void Initialize(std::atomic<NativeDexCachePair<T>>* dex_cache);
static uint32_t InvalidIndexForSlot(uint32_t slot) {
// Since the cache size is a power of two, 0 will always map to slot 0.
@@ -297,20 +297,16 @@ class MANAGED DexCache final : public Object {
void ClearResolvedType(dex::TypeIndex type_idx) REQUIRES_SHARED(Locks::mutator_lock_);
- ALWAYS_INLINE ArtMethod* GetResolvedMethod(uint32_t method_idx, PointerSize ptr_size)
+ ALWAYS_INLINE ArtMethod* GetResolvedMethod(uint32_t method_idx)
REQUIRES_SHARED(Locks::mutator_lock_);
- ALWAYS_INLINE void SetResolvedMethod(uint32_t method_idx,
- ArtMethod* resolved,
- PointerSize ptr_size)
+ ALWAYS_INLINE void SetResolvedMethod(uint32_t method_idx, ArtMethod* resolved)
REQUIRES_SHARED(Locks::mutator_lock_);
- // Pointer sized variant, used for patching.
- ALWAYS_INLINE ArtField* GetResolvedField(uint32_t idx, PointerSize ptr_size)
+ ALWAYS_INLINE ArtField* GetResolvedField(uint32_t idx)
REQUIRES_SHARED(Locks::mutator_lock_);
- // Pointer sized variant, used for patching.
- ALWAYS_INLINE void SetResolvedField(uint32_t idx, ArtField* field, PointerSize ptr_size)
+ ALWAYS_INLINE void SetResolvedField(uint32_t idx, ArtField* field)
REQUIRES_SHARED(Locks::mutator_lock_);
MethodType* GetResolvedMethodType(dex::ProtoIndex proto_idx) REQUIRES_SHARED(Locks::mutator_lock_);
@@ -450,15 +446,13 @@ class MANAGED DexCache final : public Object {
void SetLocation(ObjPtr<String> location) REQUIRES_SHARED(Locks::mutator_lock_);
template <typename T>
- static NativeDexCachePair<T> GetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array,
- size_t idx,
- PointerSize ptr_size);
+ static NativeDexCachePair<T> GetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array,
+ size_t idx);
template <typename T>
- static void SetNativePairPtrSize(std::atomic<NativeDexCachePair<T>>* pair_array,
- size_t idx,
- NativeDexCachePair<T> pair,
- PointerSize ptr_size);
+ static void SetNativePair(std::atomic<NativeDexCachePair<T>>* pair_array,
+ size_t idx,
+ NativeDexCachePair<T> pair);
static size_t PreResolvedStringsSize(size_t num_strings) {
return sizeof(GcRoot<mirror::String>) * num_strings;
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index f0f60e2b0c..57614299e0 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -3909,9 +3909,8 @@ ArtMethod* MethodVerifier<kVerifierDebug>::ResolveMethodAndCheckAccess(
ObjPtr<mirror::Class> klass = klass_type.GetClass();
const RegType& referrer = GetDeclaringClass();
ClassLinker* class_linker = GetClassLinker();
- PointerSize pointer_size = class_linker->GetImagePointerSize();
- ArtMethod* res_method = dex_cache_->GetResolvedMethod(dex_method_idx, pointer_size);
+ ArtMethod* res_method = dex_cache_->GetResolvedMethod(dex_method_idx);
if (res_method == nullptr) {
res_method = class_linker->FindResolvedMethod(
klass, dex_cache_.Get(), class_loader_.Get(), dex_method_idx);
diff --git a/test/497-inlining-and-class-loader/clear_dex_cache.cc b/test/497-inlining-and-class-loader/clear_dex_cache.cc
index 6c6a08f0dc..36ec4eb65c 100644
--- a/test/497-inlining-and-class-loader/clear_dex_cache.cc
+++ b/test/497-inlining-and-class-loader/clear_dex_cache.cc
@@ -48,7 +48,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env,
CHECK(array != nullptr);
ObjPtr<mirror::Array> decoded_array = soa.Decode<mirror::Array>(array);
for (size_t i = 0; i != num_methods; ++i) {
- auto pair = mirror::DexCache::GetNativePairPtrSize(methods, i, kRuntimePointerSize);
+ auto pair = mirror::DexCache::GetNativePair(methods, i);
uint32_t index = pair.index;
ArtMethod* method = pair.object;
if (sizeof(void*) == 4) {
@@ -87,7 +87,7 @@ extern "C" JNIEXPORT void JNICALL Java_Main_restoreResolvedMethods(
method = reinterpret_cast64<ArtMethod*>(long_array->Get(2u * i + 1u));
}
mirror::MethodDexCachePair pair(method, index);
- mirror::DexCache::SetNativePairPtrSize(methods, i, pair, kRuntimePointerSize);
+ mirror::DexCache::SetNativePair(methods, i, pair);
}
}
diff --git a/tools/cpp-define-generator/asm_defines.def b/tools/cpp-define-generator/asm_defines.def
index a64676f134..fb011a2ba3 100644
--- a/tools/cpp-define-generator/asm_defines.def
+++ b/tools/cpp-define-generator/asm_defines.def
@@ -25,7 +25,6 @@
#include "lockword.def"
#include "mirror_array.def"
#include "mirror_class.def"
-#include "mirror_dex_cache.def"
#include "mirror_object.def"
#include "mirror_string.def"
#include "osr.def"
diff --git a/tools/cpp-define-generator/mirror_dex_cache.def b/tools/cpp-define-generator/mirror_dex_cache.def
deleted file mode 100644
index 5272e86846..0000000000
--- a/tools/cpp-define-generator/mirror_dex_cache.def
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#if ASM_DEFINE_INCLUDE_DEPENDENCIES
-#include "mirror/dex_cache.h"
-#endif
-
-ASM_DEFINE(METHOD_DEX_CACHE_SIZE_MINUS_ONE,
- art::mirror::DexCache::kDexCacheMethodCacheSize - 1)
-ASM_DEFINE(MIRROR_DEX_CACHE_RESOLVED_METHODS_OFFSET,
- art::mirror::DexCache::ResolvedMethodsOffset().Int32Value())
-ASM_DEFINE(STRING_DEX_CACHE_ELEMENT_SIZE,
- sizeof(art::mirror::StringDexCachePair))
-ASM_DEFINE(STRING_DEX_CACHE_ELEMENT_SIZE_SHIFT,
- art::WhichPowerOf2(sizeof(art::mirror::StringDexCachePair)))
-ASM_DEFINE(STRING_DEX_CACHE_HASH_BITS,
- art::LeastSignificantBit(art::mirror::DexCache::kDexCacheStringCacheSize))
-ASM_DEFINE(STRING_DEX_CACHE_SIZE_MINUS_ONE,
- art::mirror::DexCache::kDexCacheStringCacheSize - 1)
-ASM_DEFINE(METHOD_DEX_CACHE_HASH_BITS,
- art::LeastSignificantBit(art::mirror::DexCache::kDexCacheMethodCacheSize))