OSDN Git Service

Merge "DexCachePair : Add an Assign method."
authorNarayan Kamath <narayan@google.com>
Mon, 3 Oct 2016 13:10:42 +0000 (13:10 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Mon, 3 Oct 2016 13:10:43 +0000 (13:10 +0000)
1  2 
runtime/mirror/dex_cache-inl.h

@@@ -92,11 -89,10 +89,10 @@@ inline MethodType* DexCache::GetResolve
  
  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);
  }