summaryrefslogtreecommitdiff
path: root/runtime/mirror/dex_cache-inl.h
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2018-05-14 08:53:38 +0100
committer Orion Hodson <oth@google.com> 2018-05-14 16:49:55 +0100
commit06d10a78506fae7e033795cda7b1d9d0e1f1fff5 (patch)
tree91f94a605395776710f3d14298613a803158f3aa /runtime/mirror/dex_cache-inl.h
parent93d301397c83b08f6fc165847a3d518e1031f392 (diff)
ART: Add dex::ProtoIndex
Test: m -j32 test-art-host Change-Id: Ic2d2a7a43be1b8590b97cdf3729200b043ffc6a3
Diffstat (limited to 'runtime/mirror/dex_cache-inl.h')
-rw-r--r--runtime/mirror/dex_cache-inl.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 7a4876c412..72f1443dfa 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -127,23 +127,23 @@ inline void DexCache::ClearResolvedType(dex::TypeIndex type_idx) {
}
}
-inline uint32_t DexCache::MethodTypeSlotIndex(uint32_t proto_idx) {
+inline uint32_t DexCache::MethodTypeSlotIndex(dex::ProtoIndex proto_idx) {
DCHECK(Runtime::Current()->IsMethodHandlesEnabled());
- DCHECK_LT(proto_idx, GetDexFile()->NumProtoIds());
- const uint32_t slot_idx = proto_idx % kDexCacheMethodTypeCacheSize;
+ DCHECK_LT(proto_idx.index_, GetDexFile()->NumProtoIds());
+ const uint32_t slot_idx = proto_idx.index_ % kDexCacheMethodTypeCacheSize;
DCHECK_LT(slot_idx, NumResolvedMethodTypes());
return slot_idx;
}
-inline MethodType* DexCache::GetResolvedMethodType(uint32_t proto_idx) {
+inline MethodType* DexCache::GetResolvedMethodType(dex::ProtoIndex proto_idx) {
return GetResolvedMethodTypes()[MethodTypeSlotIndex(proto_idx)].load(
- std::memory_order_relaxed).GetObjectForIndex(proto_idx);
+ std::memory_order_relaxed).GetObjectForIndex(proto_idx.index_);
}
-inline void DexCache::SetResolvedMethodType(uint32_t proto_idx, MethodType* resolved) {
+inline void DexCache::SetResolvedMethodType(dex::ProtoIndex proto_idx, MethodType* resolved) {
DCHECK(resolved != nullptr);
GetResolvedMethodTypes()[MethodTypeSlotIndex(proto_idx)].store(
- MethodTypeDexCachePair(resolved, proto_idx), std::memory_order_relaxed);
+ MethodTypeDexCachePair(resolved, proto_idx.index_), std::memory_order_relaxed);
// TODO: Fine-grained marking, so that we don't need to go through all arrays in full.
Runtime::Current()->GetHeap()->WriteBarrierEveryFieldOf(this);
}