Lines Matching refs:mirror

106   Handle<mirror::ClassLoader> class_loader(hs.NewHandle(method != nullptr ?  in HasInitWithString()
109 mirror::Class* exception_class = class_linker->FindClass(self, descriptor, class_loader); in HasInitWithString()
123 void ClassLinker::ThrowEarlierClassFailure(mirror::Class* c) { in ThrowEarlierClassFailure()
137 mirror::Throwable* pre_allocated = runtime->GetPreAllocatedNoClassDefFoundError(); in ThrowEarlierClassFailure()
158 static void VlogClassInitializationFailure(Handle<mirror::Class> klass) in VlogClassInitializationFailure()
167 static void WrapExceptionInInitializer(Handle<mirror::Class> klass) in WrapExceptionInInitializer()
285 std::fill_n(find_array_class_cache_, kFindArrayCacheSize, GcRoot<mirror::Class>(nullptr)); in ClassLinker()
305 auto class_class_size = mirror::Class::ClassClassSize(image_pointer_size_); in InitWithoutImage()
306 Handle<mirror::Class> java_lang_Class(hs.NewHandle(down_cast<mirror::Class*>( in InitWithoutImage()
309 mirror::Class::SetClassClass(java_lang_Class.Get()); in InitWithoutImage()
320 auto class_array_class_size = mirror::ObjectArray<mirror::Class>::ClassSize(image_pointer_size_); in InitWithoutImage()
321 Handle<mirror::Class> class_array_class(hs.NewHandle( in InitWithoutImage()
326 Handle<mirror::Class> java_lang_Object(hs.NewHandle( in InitWithoutImage()
327 AllocClass(self, java_lang_Class.Get(), mirror::Object::ClassSize(image_pointer_size_)))); in InitWithoutImage()
331 mirror::Class::SetStatus(java_lang_Object, mirror::Class::kStatusLoaded, self); in InitWithoutImage()
334 Handle<mirror::Class> object_array_class(hs.NewHandle( in InitWithoutImage()
336 mirror::ObjectArray<mirror::Object>::ClassSize(image_pointer_size_)))); in InitWithoutImage()
340 Handle<mirror::Class> char_class(hs.NewHandle( in InitWithoutImage()
342 mirror::Class::PrimitiveClassSize(image_pointer_size_)))); in InitWithoutImage()
351 Handle<mirror::Class> char_array_class(hs.NewHandle( in InitWithoutImage()
352 AllocClass(self, java_lang_Class.Get(), mirror::Array::ClassSize(image_pointer_size_)))); in InitWithoutImage()
354 mirror::CharArray::SetArrayClass(char_array_class.Get()); in InitWithoutImage()
357 Handle<mirror::Class> java_lang_String(hs.NewHandle( in InitWithoutImage()
358 AllocClass(self, java_lang_Class.Get(), mirror::String::ClassSize(image_pointer_size_)))); in InitWithoutImage()
359 mirror::String::SetClass(java_lang_String.Get()); in InitWithoutImage()
360 mirror::Class::SetStatus(java_lang_String, mirror::Class::kStatusResolved, self); in InitWithoutImage()
364 Handle<mirror::Class> java_lang_ref_Reference(hs.NewHandle( in InitWithoutImage()
365 AllocClass(self, java_lang_Class.Get(), mirror::Reference::ClassSize(image_pointer_size_)))); in InitWithoutImage()
366 mirror::Reference::SetClass(java_lang_ref_Reference.Get()); in InitWithoutImage()
367 java_lang_ref_Reference->SetObjectSize(mirror::Reference::InstanceSize()); in InitWithoutImage()
368 mirror::Class::SetStatus(java_lang_ref_Reference, mirror::Class::kStatusResolved, self); in InitWithoutImage()
371 class_roots_ = GcRoot<mirror::ObjectArray<mirror::Class>>( in InitWithoutImage()
372 mirror::ObjectArray<mirror::Class>::Alloc(self, object_array_class.Get(), in InitWithoutImage()
394 array_iftable_ = GcRoot<mirror::IfTable>(AllocIfTable(self, 2)); in InitWithoutImage()
397 Handle<mirror::Class> int_array_class(hs.NewHandle( in InitWithoutImage()
398 AllocClass(self, java_lang_Class.Get(), mirror::Array::ClassSize(image_pointer_size_)))); in InitWithoutImage()
400 mirror::IntArray::SetArrayClass(int_array_class.Get()); in InitWithoutImage()
404 Handle<mirror::Class> long_array_class(hs.NewHandle( in InitWithoutImage()
405 AllocClass(self, java_lang_Class.Get(), mirror::Array::ClassSize(image_pointer_size_)))); in InitWithoutImage()
407 mirror::LongArray::SetArrayClass(long_array_class.Get()); in InitWithoutImage()
413 Handle<mirror::Class> java_lang_DexCache(hs.NewHandle( in InitWithoutImage()
414 AllocClass(self, java_lang_Class.Get(), mirror::DexCache::ClassSize(image_pointer_size_)))); in InitWithoutImage()
416 java_lang_DexCache->SetObjectSize(mirror::DexCache::InstanceSize()); in InitWithoutImage()
417 mirror::Class::SetStatus(java_lang_DexCache, mirror::Class::kStatusResolved, self); in InitWithoutImage()
420 Handle<mirror::Class> object_array_string(hs.NewHandle( in InitWithoutImage()
422 mirror::ObjectArray<mirror::String>::ClassSize(image_pointer_size_)))); in InitWithoutImage()
458 mirror::Class::SetStatus(java_lang_Object, mirror::Class::kStatusNotReady, self); in InitWithoutImage()
460 CHECK_EQ(java_lang_Object->GetObjectSize(), mirror::Object::InstanceSize()); in InitWithoutImage()
461 mirror::Class::SetStatus(java_lang_String, mirror::Class::kStatusNotReady, self); in InitWithoutImage()
462 mirror::Class* String_class = FindSystemClass(self, "Ljava/lang/String;"); in InitWithoutImage()
465 java_lang_String->DumpClass(os1, mirror::Class::kDumpClassFullDetail); in InitWithoutImage()
466 String_class->DumpClass(os2, mirror::Class::kDumpClassFullDetail); in InitWithoutImage()
469 mirror::Class::SetStatus(java_lang_DexCache, mirror::Class::kStatusNotReady, self); in InitWithoutImage()
471 CHECK_EQ(java_lang_DexCache->GetObjectSize(), mirror::DexCache::InstanceSize()); in InitWithoutImage()
475 mirror::BooleanArray::SetArrayClass(GetClassRoot(kBooleanArrayClass)); in InitWithoutImage()
478 mirror::ByteArray::SetArrayClass(GetClassRoot(kByteArrayClass)); in InitWithoutImage()
483 mirror::ShortArray::SetArrayClass(GetClassRoot(kShortArrayClass)); in InitWithoutImage()
490 mirror::FloatArray::SetArrayClass(GetClassRoot(kFloatArrayClass)); in InitWithoutImage()
493 mirror::DoubleArray::SetArrayClass(GetClassRoot(kDoubleArrayClass)); in InitWithoutImage()
512 mirror::Class::GetDirectInterface(self, class_array_class, 0)); in InitWithoutImage()
514 mirror::Class::GetDirectInterface(self, class_array_class, 1)); in InitWithoutImage()
516 mirror::Class::GetDirectInterface(self, object_array_class, 0)); in InitWithoutImage()
518 mirror::Class::GetDirectInterface(self, object_array_class, 1)); in InitWithoutImage()
535 mirror::Field::SetClass(class_root); in InitWithoutImage()
541 mirror::Field::SetArrayClass(class_root); in InitWithoutImage()
547 mirror::Constructor::SetClass(class_root); in InitWithoutImage()
551 mirror::Constructor::SetArrayClass(class_root); in InitWithoutImage()
557 mirror::Method::SetClass(class_root); in InitWithoutImage()
561 mirror::Method::SetArrayClass(class_root); in InitWithoutImage()
565 mirror::Class::SetStatus(java_lang_ref_Reference, mirror::Class::kStatusNotReady, self); in InitWithoutImage()
567 CHECK_EQ(java_lang_ref_Reference->GetObjectSize(), mirror::Reference::InstanceSize()); in InitWithoutImage()
569 mirror::Reference::ClassSize(image_pointer_size_)); in InitWithoutImage()
584 CHECK_EQ(class_root->GetObjectSize(), mirror::ClassLoader::InstanceSize()); in InitWithoutImage()
590 mirror::Throwable::SetClass(GetClassRoot(kJavaLangThrowable)); in InitWithoutImage()
596 mirror::StackTraceElement::SetClass(GetClassRoot(kJavaLangStackTraceElement)); in InitWithoutImage()
610 mirror::Class* resolved_type = ResolveType(dex_file, void_type_idx, java_lang_Object.Get()); in InitWithoutImage()
627 mirror::Class* java_lang_ref_Reference = GetClassRoot(kJavaLangRefReference); in FinishInit()
628 mirror::Class* java_lang_ref_FinalizerReference = in FinishInit()
654 mirror::Class* klass = GetClassRoot(class_root); in FinishInit()
673 mirror::Class* c = GetClassRoot(ClassRoot(i)); in RunRootClinits()
676 Handle<mirror::Class> h_class(hs.NewHandle(GetClassRoot(ClassRoot(i)))); in RunRootClinits()
1019 static void SanityCheckArtMethod(ArtMethod* m, mirror::Class* expected_class, in SanityCheckArtMethod()
1038 mirror::PointerArray* arr, mirror::Class* expected_class, size_t pointer_size, in SanityCheckArtMethodPointerArray()
1053 static void SanityCheckObjectsCallback(mirror::Object* obj, void* arg ATTRIBUTE_UNUSED) in SanityCheckObjectsCallback()
1081 for (size_t i = 0; i < mirror::Class::kImtSize; ++i) { in SanityCheckObjectsCallback()
1121 mirror::Object* dex_caches_object = space->GetImageHeader().GetImageRoot(ImageHeader::kDexCaches); in InitFromImage()
1122 mirror::ObjectArray<mirror::DexCache>* dex_caches = in InitFromImage()
1123 dex_caches_object->AsObjectArray<mirror::DexCache>(); in InitFromImage()
1126 Handle<mirror::ObjectArray<mirror::Class>> class_roots(hs.NewHandle( in InitFromImage()
1128 AsObjectArray<mirror::Class>())); in InitFromImage()
1129 class_roots_ = GcRoot<mirror::ObjectArray<mirror::Class>>(class_roots.Get()); in InitFromImage()
1133 mirror::String::SetClass(GetClassRoot(kJavaLangString)); in InitFromImage()
1139 Handle<mirror::DexCache> dex_cache(hs2.NewHandle(dex_caches->Get(i))); in InitFromImage()
1210 mirror::Class::SetClassClass(class_roots->Get(kJavaLangClass)); in InitFromImage()
1211 class_roots_ = GcRoot<mirror::ObjectArray<mirror::Class>>(class_roots.Get()); in InitFromImage()
1214 array_iftable_ = GcRoot<mirror::IfTable>(GetClassRoot(kObjectArrayClass)->GetIfTable()); in InitFromImage()
1217 mirror::Field::SetClass(GetClassRoot(kJavaLangReflectField)); in InitFromImage()
1218 mirror::Field::SetArrayClass(GetClassRoot(kJavaLangReflectFieldArrayClass)); in InitFromImage()
1219 mirror::Constructor::SetClass(GetClassRoot(kJavaLangReflectConstructor)); in InitFromImage()
1220 mirror::Constructor::SetArrayClass(GetClassRoot(kJavaLangReflectConstructorArrayClass)); in InitFromImage()
1221 mirror::Method::SetClass(GetClassRoot(kJavaLangReflectMethod)); in InitFromImage()
1222 mirror::Method::SetArrayClass(GetClassRoot(kJavaLangReflectMethodArrayClass)); in InitFromImage()
1223 mirror::Reference::SetClass(GetClassRoot(kJavaLangRefReference)); in InitFromImage()
1224 mirror::BooleanArray::SetArrayClass(GetClassRoot(kBooleanArrayClass)); in InitFromImage()
1225 mirror::ByteArray::SetArrayClass(GetClassRoot(kByteArrayClass)); in InitFromImage()
1226 mirror::CharArray::SetArrayClass(GetClassRoot(kCharArrayClass)); in InitFromImage()
1227 mirror::DoubleArray::SetArrayClass(GetClassRoot(kDoubleArrayClass)); in InitFromImage()
1228 mirror::FloatArray::SetArrayClass(GetClassRoot(kFloatArrayClass)); in InitFromImage()
1229 mirror::IntArray::SetArrayClass(GetClassRoot(kIntArrayClass)); in InitFromImage()
1230 mirror::LongArray::SetArrayClass(GetClassRoot(kLongArrayClass)); in InitFromImage()
1231 mirror::ShortArray::SetArrayClass(GetClassRoot(kShortArrayClass)); in InitFromImage()
1232 mirror::Throwable::SetClass(GetClassRoot(kJavaLangThrowable)); in InitFromImage()
1233 mirror::StackTraceElement::SetClass(GetClassRoot(kJavaLangStackTraceElement)); in InitFromImage()
1240 bool ClassLinker::ClassInClassTable(mirror::Class* klass) { in ClassInClassTable()
1242 auto it = class_table_.Find(GcRoot<mirror::Class>(klass)); in ClassInClassTable()
1270 for (GcRoot<mirror::Class>& root : class_table_) { in VisitClassRoots()
1279 for (GcRoot<mirror::Class>& root : pre_zygote_class_table_) { in VisitClassRoots()
1287 mirror::Class* old_ref = root.Read<kWithoutReadBarrier>(); in VisitClassRoots()
1290 mirror::Class* new_ref = root.Read<kWithoutReadBarrier>(); in VisitClassRoots()
1295 auto it = class_table_.Find(GcRoot<mirror::Class>(old_ref)); in VisitClassRoots()
1297 *it = GcRoot<mirror::Class>(new_ref); in VisitClassRoots()
1323 for (GcRoot<mirror::DexCache>& dex_cache : dex_caches_) { in VisitRoots()
1342 for (GcRoot<mirror::Class>& root : find_array_class_cache_) { in VisitRoots()
1353 for (GcRoot<mirror::Class>& root : class_table_) { in VisitClasses()
1358 for (GcRoot<mirror::Class>& root : pre_zygote_class_table_) { in VisitClasses()
1365 static bool GetClassesVisitorSet(mirror::Class* c, void* arg) { in GetClassesVisitorSet()
1366 std::set<mirror::Class*>* classes = reinterpret_cast<std::set<mirror::Class*>*>(arg); in GetClassesVisitorSet()
1372 Handle<mirror::ObjectArray<mirror::Class>>* classes;
1377 static bool GetClassesVisitorArray(mirror::Class* c, void* varg) in GetClassesVisitorArray()
1394 std::set<mirror::Class*> classes; in VisitClassesWithoutClassesLock()
1396 for (mirror::Class* klass : classes) { in VisitClassesWithoutClassesLock()
1404 MutableHandle<mirror::ObjectArray<mirror::Class>> classes = in VisitClassesWithoutClassesLock()
1405 hs.NewHandle<mirror::ObjectArray<mirror::Class>>(nullptr); in VisitClassesWithoutClassesLock()
1417 mirror::Class* class_type = mirror::Class::GetJavaLangClass(); in VisitClassesWithoutClassesLock()
1418 mirror::Class* array_of_class = FindArrayClass(self, &class_type); in VisitClassesWithoutClassesLock()
1420 mirror::ObjectArray<mirror::Class>::Alloc(self, array_of_class, class_table_size)); in VisitClassesWithoutClassesLock()
1430 mirror::Class* klass = classes->Get(i); in VisitClassesWithoutClassesLock()
1439 mirror::Class::ResetClass(); in ~ClassLinker()
1440 mirror::Constructor::ResetClass(); in ~ClassLinker()
1441 mirror::Field::ResetClass(); in ~ClassLinker()
1442 mirror::Method::ResetClass(); in ~ClassLinker()
1443 mirror::Reference::ResetClass(); in ~ClassLinker()
1444 mirror::StackTraceElement::ResetClass(); in ~ClassLinker()
1445 mirror::String::ResetClass(); in ~ClassLinker()
1446 mirror::Throwable::ResetClass(); in ~ClassLinker()
1447 mirror::BooleanArray::ResetArrayClass(); in ~ClassLinker()
1448 mirror::ByteArray::ResetArrayClass(); in ~ClassLinker()
1449 mirror::CharArray::ResetArrayClass(); in ~ClassLinker()
1450 mirror::Constructor::ResetArrayClass(); in ~ClassLinker()
1451 mirror::DoubleArray::ResetArrayClass(); in ~ClassLinker()
1452 mirror::Field::ResetArrayClass(); in ~ClassLinker()
1453 mirror::FloatArray::ResetArrayClass(); in ~ClassLinker()
1454 mirror::Method::ResetArrayClass(); in ~ClassLinker()
1455 mirror::IntArray::ResetArrayClass(); in ~ClassLinker()
1456 mirror::LongArray::ResetArrayClass(); in ~ClassLinker()
1457 mirror::ShortArray::ResetArrayClass(); in ~ClassLinker()
1461 mirror::PointerArray* ClassLinker::AllocPointerArray(Thread* self, size_t length) { in AllocPointerArray()
1462 return down_cast<mirror::PointerArray*>(image_pointer_size_ == 8u ? in AllocPointerArray()
1463 static_cast<mirror::Array*>(mirror::LongArray::Alloc(self, length)) : in AllocPointerArray()
1464 static_cast<mirror::Array*>(mirror::IntArray::Alloc(self, length))); in AllocPointerArray()
1467 mirror::DexCache* ClassLinker::AllocDexCache(Thread* self, const DexFile& dex_file) { in AllocDexCache()
1469 auto dex_cache(hs.NewHandle(down_cast<mirror::DexCache*>( in AllocDexCache()
1505 mirror::Class* ClassLinker::AllocClass(Thread* self, mirror::Class* java_lang_Class, in AllocClass()
1507 DCHECK_GE(class_size, sizeof(mirror::Class)); in AllocClass()
1509 mirror::Class::InitializeClassVisitor visitor(class_size); in AllocClass()
1510 mirror::Object* k = kMovingClasses ? in AllocClass()
1520 mirror::Class* ClassLinker::AllocClass(Thread* self, uint32_t class_size) { in AllocClass()
1524 mirror::ObjectArray<mirror::StackTraceElement>* ClassLinker::AllocStackTraceElementArray( in AllocStackTraceElementArray()
1526 return mirror::ObjectArray<mirror::StackTraceElement>::Alloc( in AllocStackTraceElementArray()
1530 mirror::Class* ClassLinker::EnsureResolved(Thread* self, const char* descriptor, in EnsureResolved()
1531 mirror::Class* klass) { in EnsureResolved()
1542 Handle<mirror::Class> h_class(hs.NewHandle(klass)); in EnsureResolved()
1543 ObjectLock<mirror::Class> lock(self, h_class); in EnsureResolved()
1561 HandleWrapper<mirror::Class> h_class(hs.NewHandleWrapper(&klass)); in EnsureResolved()
1562 ObjectLock<mirror::Class> lock(self, h_class); in EnsureResolved()
1566 mirror::Class::SetStatus(h_class, mirror::Class::kStatusError, self); in EnsureResolved()
1600 mirror::ClassLoader* class_loader) in IsBootClassLoader()
1604 soa.Decode<mirror::Class*>(WellKnownClasses::java_lang_BootClassLoader); in IsBootClassLoader()
1610 Handle<mirror::ClassLoader> class_loader, in FindClassInPathClassLoader()
1611 mirror::Class** result) { in FindClassInPathClassLoader()
1617 mirror::Class* klass = LookupClass(self, descriptor, hash, nullptr); in FindClassInPathClassLoader()
1621 *result = DefineClass(self, descriptor, hash, NullHandle<mirror::ClassLoader>(), in FindClassInPathClassLoader()
1636 soa.Decode<mirror::Class*>(WellKnownClasses::dalvik_system_PathClassLoader)) { in FindClassInPathClassLoader()
1643 Handle<mirror::ClassLoader> h_parent(hs.NewHandle(class_loader->GetParent())); in FindClassInPathClassLoader()
1663 mirror::Object* dex_path_list = in FindClassInPathClassLoader()
1668 mirror::Object* dex_elements_obj = in FindClassInPathClassLoader()
1674 Handle<mirror::ObjectArray<mirror::Object>> dex_elements = in FindClassInPathClassLoader()
1675 hs.NewHandle(dex_elements_obj->AsObjectArray<mirror::Object>()); in FindClassInPathClassLoader()
1677 mirror::Object* element = dex_elements->GetWithoutChecks(i); in FindClassInPathClassLoader()
1682 mirror::Object* dex_file = dex_file_field->GetObject(element); in FindClassInPathClassLoader()
1684 mirror::LongArray* long_array = cookie_field->GetObject(dex_file)->AsLongArray(); in FindClassInPathClassLoader()
1697 mirror::Class* klass = DefineClass(self, descriptor, hash, class_loader, in FindClassInPathClassLoader()
1719 mirror::Class* ClassLinker::FindClass(Thread* self, const char* descriptor, in FindClass()
1720 Handle<mirror::ClassLoader> class_loader) { in FindClass()
1731 mirror::Class* klass = LookupClass(self, descriptor, hash, class_loader.Get()); in FindClass()
1742 return DefineClass(self, descriptor, hash, NullHandle<mirror::ClassLoader>(), *pair.first, in FindClass()
1748 mirror::Throwable* pre_allocated = Runtime::Current()->GetPreAllocatedNoClassDefFoundError(); in FindClass()
1754 mirror::Class* cp_klass; in FindClass()
1770 mirror::Throwable* pre_allocated = Runtime::Current()->GetPreAllocatedNoClassDefFoundError(); in FindClass()
1802 return soa.Decode<mirror::Class*>(result.get()); in FindClass()
1808 mirror::Class* ClassLinker::DefineClass(Thread* self, const char* descriptor, size_t hash, in DefineClass()
1809 Handle<mirror::ClassLoader> class_loader, in DefineClass()
1813 auto klass = hs.NewHandle<mirror::Class>(nullptr); in DefineClass()
1853 ObjectLock<mirror::Class> lock(self, klass); in DefineClass()
1857 mirror::Class* existing = InsertClass(descriptor, klass.Get(), hash); in DefineClass()
1873 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in DefineClass()
1883 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in DefineClass()
1891 auto interfaces = hs.NewHandle<mirror::ObjectArray<mirror::Class>>(nullptr); in DefineClass()
1893 MutableHandle<mirror::Class> h_new_class = hs.NewHandle<mirror::Class>(nullptr); in DefineClass()
1897 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in DefineClass()
1973 return mirror::Class::ComputeClassSize(false, 0, num_8, num_16, num_32, num_64, num_ref, in SizeOfClassWithoutEmbeddedTables()
2026 mirror::Class* declaring_class = method->GetDeclaringClass(); in FindOatMethodFor()
2135 void ClassLinker::FixupStaticTrampolines(mirror::Class* klass) { in FixupStaticTrampolines()
2249 Handle<mirror::Class> klass, mirror::ClassLoader* class_loader) { in SetupClass()
2252 CHECK_EQ(mirror::Class::kStatusNotReady, klass->GetStatus()); in SetupClass()
2262 mirror::Class::SetStatus(klass, mirror::Class::kStatusIdx, nullptr); in SetupClass()
2271 Handle<mirror::Class> klass) { in LoadClass()
2310 Handle<mirror::Class> klass, in LoadClassMembers()
2376 void ClassLinker::LoadField(const ClassDataItemIterator& it, Handle<mirror::Class> klass, in LoadField()
2385 Handle<mirror::Class> klass, ArtMethod* dst) { in LoadMethod()
2439 Handle<mirror::DexCache> dex_cache(hs.NewHandle(AllocDexCache(self, dex_file))); in AppendToBootClassPath()
2446 Handle<mirror::DexCache> dex_cache) { in AppendToBootClassPath()
2455 mirror::DexCache* dex_cache = GetDexCache(i); in IsDexFileRegisteredLocked()
2469 Handle<mirror::DexCache> dex_cache) { in RegisterDexFileLocked()
2474 dex_caches_.push_back(GcRoot<mirror::DexCache>(dex_cache.Get())); in RegisterDexFileLocked()
2494 Handle<mirror::DexCache> dex_cache(hs.NewHandle(AllocDexCache(self, dex_file))); in RegisterDexFile()
2507 Handle<mirror::DexCache> dex_cache) { in RegisterDexFile()
2512 mirror::DexCache* ClassLinker::FindDexCache(const DexFile& dex_file) { in FindDexCache()
2516 mirror::DexCache* dex_cache = GetDexCache(i); in FindDexCache()
2524 mirror::DexCache* dex_cache = GetDexCache(i); in FindDexCache()
2531 mirror::DexCache* dex_cache = GetDexCache(i); in FindDexCache()
2545 mirror::Class* ClassLinker::CreatePrimitiveClass(Thread* self, Primitive::Type type) { in CreatePrimitiveClass()
2546 mirror::Class* klass = AllocClass(self, mirror::Class::PrimitiveClassSize(image_pointer_size_)); in CreatePrimitiveClass()
2554 mirror::Class* ClassLinker::InitializePrimitiveClass(mirror::Class* primitive_class, in InitializePrimitiveClass()
2560 Handle<mirror::Class> h_class(hs.NewHandle(primitive_class)); in InitializePrimitiveClass()
2561 ObjectLock<mirror::Class> lock(self, h_class); in InitializePrimitiveClass()
2564 mirror::Class::SetStatus(h_class, mirror::Class::kStatusInitialized, self); in InitializePrimitiveClass()
2566 mirror::Class* existing = InsertClass(descriptor, h_class.Get(), in InitializePrimitiveClass()
2585 mirror::Class* ClassLinker::CreateArrayClass(Thread* self, const char* descriptor, size_t hash, in CreateArrayClass()
2586 Handle<mirror::ClassLoader> class_loader) { in CreateArrayClass()
2590 MutableHandle<mirror::Class> component_type(hs.NewHandle(FindClass(self, descriptor + 1, in CreateArrayClass()
2626mirror::Class* new_class = LookupClass(self, descriptor, hash, component_type->GetClassLoader()); in CreateArrayClass()
2640 auto new_class = hs.NewHandle<mirror::Class>(nullptr); in CreateArrayClass()
2658 new_class.Assign(AllocClass(self, mirror::Array::ClassSize(image_pointer_size_))); in CreateArrayClass()
2665 ObjectLock<mirror::Class> lock(self, new_class); // Must hold lock on object when initializing. in CreateArrayClass()
2667 mirror::Class* java_lang_Object = GetClassRoot(kJavaLangObject); in CreateArrayClass()
2672 mirror::Class::SetStatus(new_class, mirror::Class::kStatusLoaded, self); in CreateArrayClass()
2674 ArtMethod* imt[mirror::Class::kImtSize]; in CreateArrayClass()
2678 mirror::Class::SetStatus(new_class, mirror::Class::kStatusInitialized, self); in CreateArrayClass()
2696 mirror::IfTable* array_iftable = array_iftable_.Read(); in CreateArrayClass()
2712 mirror::Class* existing = InsertClass(descriptor, new_class.Get(), hash); in CreateArrayClass()
2725 mirror::Class* ClassLinker::FindPrimitiveClass(char type) { in FindPrimitiveClass()
2753 mirror::Class* ClassLinker::InsertClass(const char* descriptor, mirror::Class* klass, in InsertClass()
2756 mirror::DexCache* dex_cache = klass->GetDexCache(); in InsertClass()
2765 mirror::Class* existing = LookupClassFromTableLocked(descriptor, klass->GetClassLoader(), hash); in InsertClass()
2779 class_table_.InsertWithHash(GcRoot<mirror::Class>(klass), hash); in InsertClass()
2781 new_class_roots_.push_back(GcRoot<mirror::Class>(klass)); in InsertClass()
2786 void ClassLinker::UpdateClassVirtualMethods(mirror::Class* klass, ArtMethod* new_methods, in UpdateClassVirtualMethods()
2794 new_class_roots_.push_back(GcRoot<mirror::Class>(klass)); in UpdateClassVirtualMethods()
2798 mirror::Class* ClassLinker::UpdateClass(const char* descriptor, mirror::Class* klass, in UpdateClass()
2804 mirror::Class* existing = existing_it->Read(); in UpdateClass()
2807 CHECK_EQ(klass->GetStatus(), mirror::Class::kStatusResolving) << descriptor; in UpdateClass()
2822 *existing_it = GcRoot<mirror::Class>(klass); in UpdateClass()
2824 new_class_roots_.push_back(GcRoot<mirror::Class>(klass)); in UpdateClass()
2830 bool ClassLinker::RemoveClass(const char* descriptor, mirror::ClassLoader* class_loader) { in RemoveClass()
2846 mirror::Class* ClassLinker::LookupClass(Thread* self, const char* descriptor, size_t hash, in LookupClass()
2847 mirror::ClassLoader* class_loader) { in LookupClass()
2850 mirror::Class* result = LookupClassFromTableLocked(descriptor, class_loader, hash); in LookupClass()
2859 mirror::Class* result = LookupClassFromImage(descriptor); in LookupClass()
2875 mirror::Class* ClassLinker::LookupClassFromTableLocked(const char* descriptor, in LookupClassFromTableLocked()
2876 mirror::ClassLoader* class_loader, in LookupClassFromTableLocked()
2889 static mirror::ObjectArray<mirror::DexCache>* GetImageDexCaches() in GetImageDexCaches()
2893 mirror::Object* root = image->GetImageHeader().GetImageRoot(ImageHeader::kDexCaches); in GetImageDexCaches()
2894 return root->AsObjectArray<mirror::DexCache>(); in GetImageDexCaches()
2904 mirror::ObjectArray<mirror::DexCache>* dex_caches = GetImageDexCaches(); in MoveImageClassesToClassTable()
2907 mirror::DexCache* dex_cache = dex_caches->Get(i); in MoveImageClassesToClassTable()
2908 mirror::ObjectArray<mirror::Class>* types = dex_cache->GetResolvedTypes(); in MoveImageClassesToClassTable()
2910 mirror::Class* klass = types->Get(j); in MoveImageClassesToClassTable()
2915 mirror::Class* existing = LookupClassFromTableLocked(descriptor, nullptr, hash); in MoveImageClassesToClassTable()
2920 class_table_.Insert(GcRoot<mirror::Class>(klass)); in MoveImageClassesToClassTable()
2922 new_class_roots_.push_back(GcRoot<mirror::Class>(klass)); in MoveImageClassesToClassTable()
2938 mirror::Class* ClassLinker::LookupClassFromImage(const char* descriptor) { in LookupClassFromImage()
2940 mirror::ObjectArray<mirror::DexCache>* dex_caches = GetImageDexCaches(); in LookupClassFromImage()
2942 mirror::DexCache* dex_cache = dex_caches->Get(i); in LookupClassFromImage()
2951 mirror::Class* klass = dex_cache->GetResolvedType(type_idx); in LookupClassFromImage()
2961 void ClassLinker::LookupClasses(const char* descriptor, std::vector<mirror::Class*>& result) { in LookupClasses()
2975 for (mirror::Class* k : result) { in LookupClasses()
2976 class_table_.Insert(GcRoot<mirror::Class>(k)); in LookupClasses()
2991 pre_zygote_class_table_.Insert(GcRoot<mirror::Class>(result[i])); in LookupClasses()
2995 void ClassLinker::VerifyClass(Thread* self, Handle<mirror::Class> klass) { in VerifyClass()
2997 ObjectLock<mirror::Class> lock(self, klass); in VerifyClass()
3015 if (klass->GetStatus() == mirror::Class::kStatusResolved) { in VerifyClass()
3016 mirror::Class::SetStatus(klass, mirror::Class::kStatusVerifying, self); in VerifyClass()
3018 CHECK_EQ(klass->GetStatus(), mirror::Class::kStatusRetryVerificationAtRuntime) in VerifyClass()
3021 mirror::Class::SetStatus(klass, mirror::Class::kStatusVerifyingAtRuntime, self); in VerifyClass()
3026 mirror::Class::SetStatus(klass, mirror::Class::kStatusVerified, self); in VerifyClass()
3033 Handle<mirror::Class> super(hs.NewHandle(klass->GetSuperClass())); in VerifyClass()
3036 ObjectLock<mirror::Class> super_lock(self, super); in VerifyClass()
3047 Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException())); in VerifyClass()
3059 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in VerifyClass()
3066 mirror::Class::Status oat_file_class_status(mirror::Class::kStatusNotReady); in VerifyClass()
3068 if (oat_file_class_status == mirror::Class::kStatusError) { in VerifyClass()
3074 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in VerifyClass()
3097 mirror::Class::SetStatus(klass, mirror::Class::kStatusVerified, self); in VerifyClass()
3099 CHECK_EQ(super->GetStatus(), mirror::Class::kStatusRetryVerificationAtRuntime); in VerifyClass()
3100 mirror::Class::SetStatus(klass, mirror::Class::kStatusRetryVerificationAtRuntime, self); in VerifyClass()
3110 mirror::Class::SetStatus(klass, mirror::Class::kStatusRetryVerificationAtRuntime, self); in VerifyClass()
3112 mirror::Class::SetStatus(klass, mirror::Class::kStatusVerified, self); in VerifyClass()
3124 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in VerifyClass()
3137 void ClassLinker::EnsurePreverifiedMethods(Handle<mirror::Class> klass) { in EnsurePreverifiedMethods()
3144 bool ClassLinker::VerifyClassUsingOatFile(const DexFile& dex_file, mirror::Class* klass, in VerifyClassUsingOatFile()
3145 mirror::Class::Status& oat_file_class_status) { in VerifyClassUsingOatFile()
3184 if (oat_file_class_status == mirror::Class::kStatusVerified || in VerifyClassUsingOatFile()
3185 oat_file_class_status == mirror::Class::kStatusInitialized) { in VerifyClassUsingOatFile()
3188 if (oat_file_class_status == mirror::Class::kStatusRetryVerificationAtRuntime) { in VerifyClassUsingOatFile()
3208 if (oat_file_class_status == mirror::Class::kStatusError) { in VerifyClassUsingOatFile()
3213 if (oat_file_class_status == mirror::Class::kStatusNotReady) { in VerifyClassUsingOatFile()
3228 Handle<mirror::Class> klass) { in ResolveClassExceptionHandlerTypes()
3256 mirror::Class* exception_type = linker->ResolveType(iterator.GetHandlerTypeIndex(), method); in ResolveMethodExceptionHandlerTypes()
3267 mirror::Class* ClassLinker::CreateProxyClass(ScopedObjectAccessAlreadyRunnable& soa, jstring name, in CreateProxyClass()
3272 MutableHandle<mirror::Class> klass(hs.NewHandle( in CreateProxyClass()
3273 AllocClass(self, GetClassRoot(kJavaLangClass), sizeof(mirror::Class)))); in CreateProxyClass()
3279 klass->SetObjectSize(sizeof(mirror::Proxy)); in CreateProxyClass()
3282 klass->SetClassLoader(soa.Decode<mirror::ClassLoader*>(loader)); in CreateProxyClass()
3284 klass->SetName(soa.Decode<mirror::String*>(name)); in CreateProxyClass()
3286 mirror::Class::SetStatus(klass, mirror::Class::kStatusIdx, self); in CreateProxyClass()
3294 mirror::Class* existing = InsertClass(descriptor.c_str(), klass.Get(), hash); in CreateProxyClass()
3329 auto h_methods = hs.NewHandle(soa.Decode<mirror::ObjectArray<mirror::Method>*>(methods)); in CreateProxyClass()
3330 DCHECK_EQ(h_methods->GetClass(), mirror::Method::ArrayClass()) in CreateProxyClass()
3353 mirror::Class::SetStatus(klass, mirror::Class::kStatusLoaded, self); in CreateProxyClass()
3356 MutableHandle<mirror::Class> new_class = hs.NewHandle<mirror::Class>(nullptr); in CreateProxyClass()
3359 ObjectLock<mirror::Class> resolution_lock(self, klass); in CreateProxyClass()
3362 Handle<mirror::ObjectArray<mirror::Class>> h_interfaces( in CreateProxyClass()
3363 hs.NewHandle(soa.Decode<mirror::ObjectArray<mirror::Class>*>(interfaces))); in CreateProxyClass()
3365 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in CreateProxyClass()
3375 soa.Decode<mirror::ObjectArray<mirror::Class>*>(interfaces)); in CreateProxyClass()
3378 soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class> >*>(throws)); in CreateProxyClass()
3382 ObjectLock<mirror::Class> initialization_lock(self, klass); in CreateProxyClass()
3383 mirror::Class::SetStatus(klass, mirror::Class::kStatusInitialized, self); in CreateProxyClass()
3398 Handle<mirror::String> decoded_name = hs2.NewHandle(soa.Decode<mirror::String*>(name)); in CreateProxyClass()
3408 soa.Decode<mirror::ObjectArray<mirror::Class>*>(interfaces)); in CreateProxyClass()
3410 soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class>>*>(throws)); in CreateProxyClass()
3415 std::string ClassLinker::GetDescriptorForProxy(mirror::Class* proxy_class) { in GetDescriptorForProxy()
3417 mirror::String* name = proxy_class->GetName(); in GetDescriptorForProxy()
3422 ArtMethod* ClassLinker::FindMethodForProxy(mirror::Class* proxy_class, in FindMethodForProxy()
3429 for (const GcRoot<mirror::DexCache>& root : dex_caches_) { in FindMethodForProxy()
3444 void ClassLinker::CreateProxyConstructor(Handle<mirror::Class> klass, ArtMethod* out) { in CreateProxyConstructor()
3470 void ClassLinker::CreateProxyMethod(Handle<mirror::Class> klass, ArtMethod* prototype, in CreateProxyMethod()
3517 bool ClassLinker::CanWeInitializeClass(mirror::Class* klass, bool can_init_statics, in CanWeInitializeClass()
3540 mirror::Class* super_class = klass->GetSuperClass(); in CanWeInitializeClass()
3547 bool ClassLinker::InitializeClass(Thread* self, Handle<mirror::Class> klass, in InitializeClass()
3566 ObjectLock<mirror::Class> lock(self, klass); in InitializeClass()
3592 CHECK_EQ(klass->GetStatus(), mirror::Class::kStatusRetryVerificationAtRuntime); in InitializeClass()
3605 if (klass->GetStatus() == mirror::Class::kStatusInitializing) { in InitializeClass()
3621 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in InitializeClass()
3626 CHECK_EQ(klass->GetStatus(), mirror::Class::kStatusVerified) << PrettyClass(klass.Get()); in InitializeClass()
3631 mirror::Class::SetStatus(klass, mirror::Class::kStatusInitializing, self); in InitializeClass()
3638 mirror::Class* super_class = klass->GetSuperClass(); in InitializeClass()
3643 Handle<mirror::Class> handle_scope_super(hs.NewHandle(super_class)); in InitializeClass()
3654 ObjectLock<mirror::Class> lock(self, klass); in InitializeClass()
3656 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in InitializeClass()
3668 Handle<mirror::ClassLoader> class_loader(hs.NewHandle(klass->GetClassLoader())); in InitializeClass()
3669 Handle<mirror::DexCache> dex_cache(hs.NewHandle(klass->GetDexCache())); in InitializeClass()
3716 ObjectLock<mirror::Class> lock(self, klass); in InitializeClass()
3720 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in InitializeClass()
3728 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in InitializeClass()
3738 mirror::Class::SetStatus(klass, mirror::Class::kStatusInitialized, self); in InitializeClass()
3751 bool ClassLinker::WaitForInitializeClass(Handle<mirror::Class> klass, Thread* self, in WaitForInitializeClass()
3752 ObjectLock<mirror::Class>& lock) in WaitForInitializeClass()
3764 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in WaitForInitializeClass()
3768 if (klass->GetStatus() == mirror::Class::kStatusInitializing) { in WaitForInitializeClass()
3771 if (klass->GetStatus() == mirror::Class::kStatusVerified && in WaitForInitializeClass()
3793 static void ThrowSignatureCheckResolveReturnTypeException(Handle<mirror::Class> klass, in ThrowSignatureCheckResolveReturnTypeException()
3794 Handle<mirror::Class> super_klass, in ThrowSignatureCheckResolveReturnTypeException()
3816 static void ThrowSignatureCheckResolveArgException(Handle<mirror::Class> klass, in ThrowSignatureCheckResolveArgException()
3817 Handle<mirror::Class> super_klass, in ThrowSignatureCheckResolveArgException()
3837 static void ThrowSignatureMismatch(Handle<mirror::Class> klass, in ThrowSignatureMismatch()
3838 Handle<mirror::Class> super_klass, in ThrowSignatureMismatch()
3852 Handle<mirror::Class> klass, in HasSameSignatureWithDifferentClassLoaders()
3853 Handle<mirror::Class> super_klass, in HasSameSignatureWithDifferentClassLoaders()
3859 Handle<mirror::Class> return_type(hs.NewHandle(method1->GetReturnType())); in HasSameSignatureWithDifferentClassLoaders()
3864 mirror::Class* other_return_type = method2->GetReturnType(); in HasSameSignatureWithDifferentClassLoaders()
3908 Handle<mirror::Class> param_type(hs.NewHandle( in HasSameSignatureWithDifferentClassLoaders()
3916 mirror::Class* other_param_type = in HasSameSignatureWithDifferentClassLoaders()
3938 bool ClassLinker::ValidateSuperClassDescriptors(Handle<mirror::Class> klass) { in ValidateSuperClassDescriptors()
3945 MutableHandle<mirror::Class> super_klass(hs.NewHandle<mirror::Class>(nullptr)); in ValidateSuperClassDescriptors()
3982 bool ClassLinker::EnsureInitialized(Thread* self, Handle<mirror::Class> c, bool can_init_fields, in EnsureInitialized()
4000 void ClassLinker::FixupTemporaryDeclaringClass(mirror::Class* temp_class, in FixupTemporaryDeclaringClass()
4001 mirror::Class* new_class) { in FixupTemporaryDeclaringClass()
4033 bool ClassLinker::LinkClass(Thread* self, const char* descriptor, Handle<mirror::Class> klass, in LinkClass()
4034 Handle<mirror::ObjectArray<mirror::Class>> interfaces, in LinkClass()
4035 MutableHandle<mirror::Class>* h_new_class_out) { in LinkClass()
4036 CHECK_EQ(mirror::Class::kStatusLoaded, klass->GetStatus()); in LinkClass()
4041 ArtMethod* imt[mirror::Class::kImtSize]; in LinkClass()
4054 CHECK_EQ(mirror::Class::kStatusLoaded, klass->GetStatus()); in LinkClass()
4067 mirror::Class::SetStatus(klass, mirror::Class::kStatusResolved, self); in LinkClass()
4076 mirror::Class::SetStatus(klass, mirror::Class::kStatusError, self); in LinkClass()
4081 ObjectLock<mirror::Class> lock(self, h_new_class); in LinkClass()
4083 mirror::Class* existing = UpdateClass(descriptor, h_new_class.Get(), in LinkClass()
4089 mirror::Class::SetStatus(klass, mirror::Class::kStatusRetired, self); in LinkClass()
4091 CHECK_EQ(h_new_class->GetStatus(), mirror::Class::kStatusResolving); in LinkClass()
4094 mirror::Class::SetStatus(h_new_class, mirror::Class::kStatusResolved, self); in LinkClass()
4214 static bool CheckSuperClassChange(Handle<mirror::Class> klass, in CheckSuperClassChange()
4217 mirror::Class* super_class) in CheckSuperClassChange()
4276 bool ClassLinker::LoadSuperAndInterfaces(Handle<mirror::Class> klass, const DexFile& dex_file) { in LoadSuperAndInterfaces()
4277 CHECK_EQ(mirror::Class::kStatusIdx, klass->GetStatus()); in LoadSuperAndInterfaces()
4281 mirror::Class* super_class = ResolveType(dex_file, super_class_idx, klass.Get()); in LoadSuperAndInterfaces()
4305 mirror::Class* interface = ResolveType(dex_file, idx, klass.Get()); in LoadSuperAndInterfaces()
4321 mirror::Class::SetStatus(klass, mirror::Class::kStatusLoaded, nullptr); in LoadSuperAndInterfaces()
4325 bool ClassLinker::LinkSuperClass(Handle<mirror::Class> klass) { in LinkSuperClass()
4327 mirror::Class* super = klass->GetSuperClass(); in LinkSuperClass()
4385 bool ClassLinker::LinkMethods(Thread* self, Handle<mirror::Class> klass, in LinkMethods()
4386 Handle<mirror::ObjectArray<mirror::Class>> interfaces, in LinkMethods()
4455 LinkVirtualHashTable(Handle<mirror::Class> klass, size_t hash_size, uint32_t* hash_table, in LinkVirtualHashTable()
4510 Handle<mirror::Class> klass_;
4519 bool ClassLinker::LinkVirtualMethods(Thread* self, Handle<mirror::Class> klass) { in LinkVirtualMethods()
4525 Handle<mirror::Class> super_class(hs.NewHandle(klass->GetSuperClass())); in LinkVirtualMethods()
4526 MutableHandle<mirror::PointerArray> vtable; in LinkVirtualMethods()
4548 vtable = hs.NewHandle(down_cast<mirror::PointerArray*>( in LinkVirtualMethods()
4630 vtable.Assign(down_cast<mirror::PointerArray*>(vtable->CopyOf(self, actual_count))); in LinkVirtualMethods()
4659 bool ClassLinker::LinkInterfaceMethods(Thread* self, Handle<mirror::Class> klass, in LinkInterfaceMethods()
4660 Handle<mirror::ObjectArray<mirror::Class>> interfaces, in LinkInterfaceMethods()
4679 mirror::IfTable* super_iftable = klass->GetSuperClass()->GetIfTable(); in LinkInterfaceMethods()
4694 mirror::Class* interface = have_interfaces ? in LinkInterfaceMethods()
4695 interfaces->GetWithoutChecks(i) : mirror::Class::GetDirectInterface(self, klass, i); in LinkInterfaceMethods()
4706 MutableHandle<mirror::IfTable> iftable(hs.NewHandle(AllocIfTable(self, ifcount))); in LinkInterfaceMethods()
4712 mirror::IfTable* super_iftable = klass->GetSuperClass()->GetIfTable(); in LinkInterfaceMethods()
4714 mirror::Class* super_interface = super_iftable->GetInterface(i); in LinkInterfaceMethods()
4722 mirror::Class* interface = have_interfaces ? interfaces->Get(i) : in LinkInterfaceMethods()
4723 mirror::Class::GetDirectInterface(self, klass, i); in LinkInterfaceMethods()
4727 mirror::Class* existing_interface = iftable->GetInterface(j); in LinkInterfaceMethods()
4738 mirror::Class* super_interface = interface->GetIfTable()->GetInterface(j); in LinkInterfaceMethods()
4741 mirror::Class* existing_interface = iftable->GetInterface(k); in LinkInterfaceMethods()
4757 iftable.Assign(down_cast<mirror::IfTable*>( in LinkInterfaceMethods()
4758 iftable->CopyOf(self, idx * mirror::IfTable::kMax))); in LinkInterfaceMethods()
4781 MutableHandle<mirror::PointerArray> vtable(hs.NewHandle(klass->GetVTableDuringLinking())); in LinkInterfaceMethods()
4787 mirror::Class* super_class = klass->GetSuperClass(); in LinkInterfaceMethods()
4790 for (size_t i = 0; i < mirror::Class::kImtSize; ++i) { in LinkInterfaceMethods()
4795 mirror::IfTable* if_table = super_class->GetIfTable(); in LinkInterfaceMethods()
4798 mirror::Class* interface = iftable->GetInterface(i); in LinkInterfaceMethods()
4813 uint32_t imt_index = interface_method->GetDexMethodIndex() % mirror::Class::kImtSize; in LinkInterfaceMethods()
4831 mirror::PointerArray* method_array; in LinkInterfaceMethods()
4833 mirror::IfTable* if_table = klass->GetSuperClass()->GetIfTable(); in LinkInterfaceMethods()
4837 method_array = down_cast<mirror::PointerArray*>(if_table->GetMethodArray(i)->Clone(self)); in LinkInterfaceMethods()
4860 Handle<mirror::PointerArray> input_vtable_array = NullHandle<mirror::PointerArray>(); in LinkInterfaceMethods()
4912 uint32_t imt_index = interface_method->GetDexMethodIndex() % mirror::Class::kImtSize; in LinkInterfaceMethods()
4993 vtable.Assign(down_cast<mirror::PointerArray*>(vtable->CopyOf(self, new_vtable_count))); in LinkInterfaceMethods()
5036 for (size_t i = 0; i < mirror::Class::kImtSize; ++i) { in LinkInterfaceMethods()
5066 bool ClassLinker::LinkInstanceFields(Thread* self, Handle<mirror::Class> klass) { in LinkInstanceFields()
5071 bool ClassLinker::LinkStaticFields(Thread* self, Handle<mirror::Class> klass, size_t* class_size) { in LinkStaticFields()
5110 bool ClassLinker::LinkFields(Thread* self, Handle<mirror::Class> klass, bool is_static, in LinkFields()
5121 mirror::Class* super_class = klass->GetSuperClass(); in LinkFields()
5154 if (UNLIKELY(!IsAligned<sizeof(mirror::HeapReference<mirror::Object>)>( in LinkFields()
5160 DCHECK(IsAligned<sizeof(mirror::HeapReference<mirror::Object>)>(field_offset.Uint32Value())); in LinkFields()
5165 sizeof(mirror::HeapReference<mirror::Object>)); in LinkFields()
5195 DCHECK_GE(size, sizeof(mirror::Object)) << klass->GetDescriptor(&temp); in LinkFields()
5213 sizeof(mirror::HeapReference<mirror::Object>)); in LinkFields()
5237 CHECK_LT(type_size, sizeof(mirror::HeapReference<mirror::Object>)); in LinkFields()
5240 CHECK(!IsAligned<sizeof(mirror::HeapReference<mirror::Object>)>(offset.Uint32Value())); in LinkFields()
5245 sizeof(mirror::HeapReference<mirror::Object>)); in LinkFields()
5254 void ClassLinker::CreateReferenceInstanceOffsets(Handle<mirror::Class> klass) { in CreateReferenceInstanceOffsets()
5256 mirror::Class* super_class = klass->GetSuperClass(); in CreateReferenceInstanceOffsets()
5261 if (reference_offsets != mirror::Class::kClassWalkSuper) { in CreateReferenceInstanceOffsets()
5267 sizeof(mirror::HeapReference<mirror::Object>)); in CreateReferenceInstanceOffsets()
5268 uint32_t start_bit = (start_offset - mirror::kObjectHeaderSize) / in CreateReferenceInstanceOffsets()
5269 sizeof(mirror::HeapReference<mirror::Object>); in CreateReferenceInstanceOffsets()
5271 reference_offsets = mirror::Class::kClassWalkSuper; in CreateReferenceInstanceOffsets()
5282 mirror::String* ClassLinker::ResolveString(const DexFile& dex_file, uint32_t string_idx, in ResolveString()
5283 Handle<mirror::DexCache> dex_cache) { in ResolveString()
5285 mirror::String* resolved = dex_cache->GetResolvedString(string_idx); in ResolveString()
5291 mirror::String* string = intern_table_->InternStrong(utf16_length, utf8_data); in ResolveString()
5296 mirror::Class* ClassLinker::ResolveType(const DexFile& dex_file, uint16_t type_idx, in ResolveType()
5297 mirror::Class* referrer) { in ResolveType()
5299 Handle<mirror::DexCache> dex_cache(hs.NewHandle(referrer->GetDexCache())); in ResolveType()
5300 Handle<mirror::ClassLoader> class_loader(hs.NewHandle(referrer->GetClassLoader())); in ResolveType()
5304 mirror::Class* ClassLinker::ResolveType(const DexFile& dex_file, uint16_t type_idx, in ResolveType()
5305 Handle<mirror::DexCache> dex_cache, in ResolveType()
5306 Handle<mirror::ClassLoader> class_loader) { in ResolveType()
5308 mirror::Class* resolved = dex_cache->GetResolvedType(type_idx); in ResolveType()
5323 Handle<mirror::Throwable> cause(hs.NewHandle(self->GetException())); in ResolveType()
5338 Handle<mirror::DexCache> dex_cache, in ResolveMethod()
5339 Handle<mirror::ClassLoader> class_loader, in ResolveMethod()
5350 mirror::Class* klass = ResolveType(dex_file, method_id.class_idx_, dex_cache, class_loader); in ResolveMethod()
5426 mirror::Class* methods_class = resolved->GetDeclaringClass(); in ResolveMethod()
5427 mirror::Class* referring_class = referrer->GetDeclaringClass(); in ResolveMethod()
5495 Handle<mirror::DexCache> dex_cache, in ResolveField()
5496 Handle<mirror::ClassLoader> class_loader, bool is_static) { in ResolveField()
5505 Handle<mirror::Class> klass( in ResolveField()
5513 resolved = mirror::Class::FindStaticField(self, klass, dex_cache.Get(), field_idx); in ResolveField()
5522 resolved = mirror::Class::FindStaticField(self, klass, name, type); in ResolveField()
5536 Handle<mirror::DexCache> dex_cache, in ResolveFieldJLS()
5537 Handle<mirror::ClassLoader> class_loader) { in ResolveFieldJLS()
5546 Handle<mirror::Class> klass( in ResolveFieldJLS()
5556 resolved = mirror::Class::FindField(self, klass, name, type); in ResolveFieldJLS()
5567 mirror::Class* declaring_class = referrer->GetDeclaringClass(); in MethodShorty()
5568 mirror::DexCache* dex_cache = declaring_class->GetDexCache(); in MethodShorty()
5580 std::vector<mirror::Class*> all_classes; in DumpAllClasses()
5583 for (GcRoot<mirror::Class>& it : class_table_) { in DumpAllClasses()
5667 void ClassLinker::SetClassRoot(ClassRoot class_root, mirror::Class* klass) { in SetClassRoot()
5673 mirror::ObjectArray<mirror::Class>* class_roots = class_roots_.Read(); in SetClassRoot()
5727 std::size_t ClassLinker::ClassDescriptorHashEquals::operator()(const GcRoot<mirror::Class>& root) in operator ()()
5733 bool ClassLinker::ClassDescriptorHashEquals::operator()(const GcRoot<mirror::Class>& a, in operator ()()
5734 const GcRoot<mirror::Class>& b) const { in operator ()()
5743 const std::pair<const char*, mirror::ClassLoader*>& element) const { in operator ()()
5748 const GcRoot<mirror::Class>& a, const std::pair<const char*, mirror::ClassLoader*>& b) const { in operator ()()
5755 bool ClassLinker::ClassDescriptorHashEquals::operator()(const GcRoot<mirror::Class>& a, in operator ()()
5813 mirror::Class* dex_elements_class = dex_elements_field->GetType<true>(); in CreatePathClassLoader()
5816 Handle<mirror::ObjectArray<mirror::Object>> h_dex_elements(hs.NewHandle( in CreatePathClassLoader()
5817 mirror::ObjectArray<mirror::Object>::Alloc(self, dex_elements_class, dex_files.size()))); in CreatePathClassLoader()
5818 Handle<mirror::Class> h_dex_element_class = in CreatePathClassLoader()
5833 Handle<mirror::LongArray> h_long_array = hs2.NewHandle(mirror::LongArray::Alloc(self, 1)); in CreatePathClassLoader()
5837 Handle<mirror::Object> h_dex_file = hs2.NewHandle( in CreatePathClassLoader()
5842 Handle<mirror::Object> h_element = hs2.NewHandle(h_dex_element_class->AllocObject(self)); in CreatePathClassLoader()
5852 Handle<mirror::Object> h_dex_path_list = hs.NewHandle( in CreatePathClassLoader()
5859 Handle<mirror::Class> h_path_class_class = hs.NewHandle( in CreatePathClassLoader()
5860 soa.Decode<mirror::Class*>(WellKnownClasses::dalvik_system_PathClassLoader)); in CreatePathClassLoader()
5861 Handle<mirror::Object> h_path_class_loader = hs.NewHandle( in CreatePathClassLoader()
5873 mirror::Class::FindField(self, hs.NewHandle(h_path_class_loader->GetClass()), "parent", in CreatePathClassLoader()
5876 mirror::Object* boot_cl = in CreatePathClassLoader()
5877 soa.Decode<mirror::Class*>(WellKnownClasses::java_lang_BootClassLoader)->AllocObject(self); in CreatePathClassLoader()
5895 std::fill_n(find_array_class_cache_, kFindArrayCacheSize, GcRoot<mirror::Class>(nullptr)); in DropFindArrayClassCache()