From a5b09a67034e57a6e10231dd4bd92f4cb50b824c Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 17 Nov 2016 15:21:22 -0800 Subject: ART: Add dex::TypeIndex Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a --- runtime/mirror/class-inl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/mirror/class-inl.h') diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index 9a6d60e0ad..aa5da2e83b 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -372,7 +372,7 @@ inline bool Class::ResolvedFieldAccessTest(ObjPtr access_to, // to access the field if the FieldId specifies an accessible subclass of the declaring // class rather than the declaring class itself. ObjPtr referrer_dex_cache = use_referrers_cache ? this->GetDexCache() : dex_cache; - uint32_t class_idx = referrer_dex_cache->GetDexFile()->GetFieldId(field_idx).class_idx_; + dex::TypeIndex class_idx = referrer_dex_cache->GetDexFile()->GetFieldId(field_idx).class_idx_; // The referenced class has already been resolved with the field, but may not be in the dex // cache. Use LookupResolveType here to search the class table if it is not in the dex cache. // should be no thread suspension due to the class being resolved. @@ -410,7 +410,7 @@ inline bool Class::ResolvedMethodAccessTest(ObjPtr access_to, // to access the method if the MethodId specifies an accessible subclass of the declaring // class rather than the declaring class itself. ObjPtr referrer_dex_cache = use_referrers_cache ? this->GetDexCache() : dex_cache; - uint32_t class_idx = referrer_dex_cache->GetDexFile()->GetMethodId(method_idx).class_idx_; + dex::TypeIndex class_idx = referrer_dex_cache->GetDexFile()->GetMethodId(method_idx).class_idx_; // The referenced class has already been resolved with the method, but may not be in the dex // cache. ObjPtr dex_access_to = Runtime::Current()->GetClassLinker()->LookupResolvedType( @@ -894,7 +894,8 @@ inline void Class::InitializeClassVisitor::operator()(ObjPtr obj, klass->SetClassSize(class_size_); klass->SetPrimitiveType(Primitive::kPrimNot); // Default to not being primitive. klass->SetDexClassDefIndex(DexFile::kDexNoIndex16); // Default to no valid class def index. - klass->SetDexTypeIndex(DexFile::kDexNoIndex16); // Default to no valid type index. + klass->SetDexTypeIndex(dex::TypeIndex(DexFile::kDexNoIndex16)); // Default to no valid type + // index. // Default to force slow path until initialized. klass->SetObjectSizeAllocFastPath(std::numeric_limits::max()); } -- cgit v1.2.3-59-g8ed1b