OSDN Git Service

Address review comments for change 25352fc06c84cdab8a2ab.
authorNarayan Kamath <narayan@google.com>
Mon, 3 Oct 2016 10:33:01 +0000 (11:33 +0100)
committerNarayan Kamath <narayan@google.com>
Mon, 3 Oct 2016 10:33:29 +0000 (11:33 +0100)
Test: make test-art-host
Bug: 30550796

Change-Id: Ic689e4c9bee691f03703288c3b12634a26841140

runtime/class_linker_test.cc
runtime/mirror/dex_cache-inl.h

index 593702d..451b752 100644 (file)
@@ -1328,7 +1328,7 @@ TEST_F(ClassLinkerMethodHandlesTest, TestResolveMethodTypes) {
   // This is the MethodType corresponding to the prototype of
   // String MethodTypes# method1(String).
   // Its RType = Ljava/lang/String;
-  // Its PTypes = { Ljava/langString; }
+  // Its PTypes = { Ljava/lang/String; }
   Handle<mirror::MethodType> method1_type = hs.NewHandle(
       class_linker_->ResolveMethodType(dex_file, method1_id.proto_idx_, dex_cache, class_loader));
 
index 41692da..0fa6d6b 100644 (file)
@@ -92,7 +92,7 @@ inline MethodType* DexCache::GetResolvedMethodType(uint32_t proto_idx) {
 
 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);