inline void DexCache::SetResolvedMethodType(uint32_t proto_idx, MethodType* resolved) {
DCHECK(Runtime::Current()->IsMethodHandlesEnabled());
- DCHECK_LT(proto_idx, NumResolvedMethodTypes()); // NOTE: Unchecked, i.e. not throwing AIOOB.
+ DCHECK_LT(proto_idx, GetDexFile()->NumProtoIds());
- GetResolvedMethodTypes()[proto_idx % NumResolvedMethodTypes()].store(
- MethodTypeDexCachePair(resolved, proto_idx), std::memory_order_relaxed);
-
+ MethodTypeDexCachePair::Assign(GetResolvedMethodTypes(), proto_idx, resolved,
+ NumResolvedMethodTypes());
// TODO: Fine-grained marking, so that we don't need to go through all arrays in full.
Runtime::Current()->GetHeap()->WriteBarrierEveryFieldOf(this);
}