diff options
-rw-r--r-- | compiler/optimizing/reference_type_propagation.cc | 2 | ||||
-rw-r--r-- | oatdump/oatdump.cc | 2 | ||||
-rw-r--r-- | runtime/art_field-inl.h | 2 | ||||
-rw-r--r-- | runtime/art_field.cc | 5 | ||||
-rw-r--r-- | runtime/art_field.h | 2 | ||||
-rw-r--r-- | runtime/class_linker.cc | 4 | ||||
-rw-r--r-- | runtime/mirror/object.cc | 4 | ||||
-rw-r--r-- | runtime/verifier/method_verifier.cc | 4 |
8 files changed, 14 insertions, 11 deletions
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc index 7246129e25..d84f14acc0 100644 --- a/compiler/optimizing/reference_type_propagation.cc +++ b/compiler/optimizing/reference_type_propagation.cc @@ -612,7 +612,7 @@ void ReferenceTypePropagation::RTPVisitor::UpdateFieldAccessTypeInfo(HInstructio // The field is unknown only during tests. if (info.GetField() != nullptr) { - klass = info.GetField()->LookupType(); + klass = info.GetField()->LookupResolvedType(); } SetClassAsTypeInfo(instr, klass, /* is_exact */ false); diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 2c15087612..1b4485b233 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -2269,7 +2269,7 @@ class ImageDumper { os << StringPrintf("null %s\n", PrettyDescriptor(field->GetTypeDescriptor()).c_str()); } else { // Grab the field type without causing resolution. - ObjPtr<mirror::Class> field_type = field->LookupType(); + ObjPtr<mirror::Class> field_type = field->LookupResolvedType(); if (field_type != nullptr) { PrettyObjectValue(os, field_type, value); } else { diff --git a/runtime/art_field-inl.h b/runtime/art_field-inl.h index 4a328e8d60..ae81ee8470 100644 --- a/runtime/art_field-inl.h +++ b/runtime/art_field-inl.h @@ -299,7 +299,7 @@ inline bool ArtField::IsPrimitiveType() REQUIRES_SHARED(Locks::mutator_lock_) { return GetTypeAsPrimitiveType() != Primitive::kPrimNot; } -inline ObjPtr<mirror::Class> ArtField::LookupType() { +inline ObjPtr<mirror::Class> ArtField::LookupResolvedType() { ScopedAssertNoThreadSuspension ants(__FUNCTION__); const uint32_t field_index = GetDexFieldIndex(); ObjPtr<mirror::Class> declaring_class = GetDeclaringClass(); diff --git a/runtime/art_field.cc b/runtime/art_field.cc index bc728f4476..54746a3685 100644 --- a/runtime/art_field.cc +++ b/runtime/art_field.cc @@ -45,7 +45,10 @@ void ArtField::SetOffset(MemberOffset num_bytes) { ObjPtr<mirror::Class> ArtField::ProxyFindSystemClass(const char* descriptor) { DCHECK(GetDeclaringClass()->IsProxyClass()); - return Runtime::Current()->GetClassLinker()->FindSystemClass(Thread::Current(), descriptor); + ObjPtr<mirror::Class> klass = Runtime::Current()->GetClassLinker()->LookupClass( + Thread::Current(), descriptor, /* class_loader */ nullptr); + DCHECK(klass != nullptr); + return klass; } ObjPtr<mirror::String> ArtField::ResolveGetStringName(Thread* self, diff --git a/runtime/art_field.h b/runtime/art_field.h index 866bf0bc70..a6f050810f 100644 --- a/runtime/art_field.h +++ b/runtime/art_field.h @@ -205,7 +205,7 @@ class ArtField FINAL { bool IsPrimitiveType() REQUIRES_SHARED(Locks::mutator_lock_); - ObjPtr<mirror::Class> LookupType() REQUIRES_SHARED(Locks::mutator_lock_); + ObjPtr<mirror::Class> LookupResolvedType() REQUIRES_SHARED(Locks::mutator_lock_); ObjPtr<mirror::Class> ResolveType() REQUIRES_SHARED(Locks::mutator_lock_); size_t FieldSize() REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index e5bb7862cb..71b6378c81 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -8659,10 +8659,10 @@ jobject ClassLinker::CreateWellKnownClassLoader(Thread* self, DCHECK_EQ(h_dex_element_class.Get(), element_file_field->GetDeclaringClass()); ArtField* cookie_field = jni::DecodeArtField(WellKnownClasses::dalvik_system_DexFile_cookie); - DCHECK_EQ(cookie_field->GetDeclaringClass(), element_file_field->LookupType()); + DCHECK_EQ(cookie_field->GetDeclaringClass(), element_file_field->LookupResolvedType()); ArtField* file_name_field = jni::DecodeArtField(WellKnownClasses::dalvik_system_DexFile_fileName); - DCHECK_EQ(file_name_field->GetDeclaringClass(), element_file_field->LookupType()); + DCHECK_EQ(file_name_field->GetDeclaringClass(), element_file_field->LookupResolvedType()); // Fill the elements array. int32_t index = 0; diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc index 87cc620309..97fb793530 100644 --- a/runtime/mirror/object.cc +++ b/runtime/mirror/object.cc @@ -240,7 +240,7 @@ void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, ObjPtr<Object> CHECK_NE(field.GetTypeAsPrimitiveType(), Primitive::kPrimNot); // TODO: resolve the field type for moving GC. ObjPtr<mirror::Class> field_type = - kMovingCollector ? field.LookupType() : field.ResolveType(); + kMovingCollector ? field.LookupResolvedType() : field.ResolveType(); if (field_type != nullptr) { CHECK(field_type->IsAssignableFrom(new_value->GetClass())); } @@ -258,7 +258,7 @@ void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, ObjPtr<Object> CHECK_NE(field.GetTypeAsPrimitiveType(), Primitive::kPrimNot); // TODO: resolve the field type for moving GC. ObjPtr<mirror::Class> field_type = - kMovingCollector ? field.LookupType() : field.ResolveType(); + kMovingCollector ? field.LookupResolvedType() : field.ResolveType(); if (field_type != nullptr) { CHECK(field_type->IsAssignableFrom(new_value->GetClass())); } diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index fefb4f6526..25982cffda 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -5046,7 +5046,7 @@ void MethodVerifier::VerifyISFieldAccess(const Instruction* inst, const RegType& } ObjPtr<mirror::Class> field_type_class = - can_load_classes_ ? field->ResolveType() : field->LookupType(); + can_load_classes_ ? field->ResolveType() : field->LookupResolvedType(); if (field_type_class != nullptr) { field_type = &FromClass(field->GetTypeDescriptor(), field_type_class.Ptr(), @@ -5195,7 +5195,7 @@ void MethodVerifier::VerifyQuickFieldAccess(const Instruction* inst, const RegTy const RegType* field_type; { ObjPtr<mirror::Class> field_type_class = - can_load_classes_ ? field->ResolveType() : field->LookupType(); + can_load_classes_ ? field->ResolveType() : field->LookupResolvedType(); if (field_type_class != nullptr) { field_type = &FromClass(field->GetTypeDescriptor(), |