Lines Matching refs:art
89 static std::unique_ptr<const art::DexFile> MakeSingleDexFile(art::Thread* self, in MakeSingleDexFile()
94 REQUIRES_SHARED(art::Locks::mutator_lock_) { in MakeSingleDexFile()
97 art::ArrayRef<const unsigned char> final_data(final_dex_data, final_len); in MakeSingleDexFile()
98 art::MemMap map = Redefiner::MoveDataToMemMap(orig_location, final_data, &error_msg); in MakeSingleDexFile()
107 if (map.Size() < sizeof(art::DexFile::Header)) { in MakeSingleDexFile()
109 art::ThrowClassFormatError(nullptr, in MakeSingleDexFile()
114 uint32_t checksum = reinterpret_cast<const art::DexFile::Header*>(map.Begin())->checksum_; in MakeSingleDexFile()
116 const art::ArtDexFileLoader dex_file_loader; in MakeSingleDexFile()
117 std::unique_ptr<const art::DexFile> dex_file(dex_file_loader.Open(map_name, in MakeSingleDexFile()
125 art::ThrowClassFormatError(nullptr, in MakeSingleDexFile()
134 art::ThrowClassFormatError( in MakeSingleDexFile()
162 struct ClassCallback : public art::ClassLoadCallback {
164 art::Handle<art::mirror::Class> klass, in ClassPreDefine()
165 art::Handle<art::mirror::ClassLoader> class_loader, in ClassPreDefine()
166 const art::DexFile& initial_dex_file, in ClassPreDefine()
167 const art::dex::ClassDef& initial_class_def ATTRIBUTE_UNUSED, in ClassPreDefine()
168 /*out*/art::DexFile const** final_dex_file, in ClassPreDefine()
169 /*out*/art::dex::ClassDef const** final_class_def) in ClassPreDefine()
170 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassPreDefine()
192 art::Thread* self = art::Thread::Current(); in ClassPreDefine()
216 art::StackHandleScope<2> hs(self); in ClassPreDefine()
219 art::Handle<art::mirror::ClassExt> ext = in ClassPreDefine()
220 hs.NewHandle(art::mirror::Class::EnsureExtDataPresent(klass, self)); in ClassPreDefine()
232 art::MutableHandle<art::mirror::Object> arr(hs.NewHandle<art::mirror::Object>(nullptr)); in ClassPreDefine()
237 art::JValue val; in ClassPreDefine()
239 arr.Assign(art::BoxPrimitive(art::Primitive::kPrimLong, val)); in ClassPreDefine()
241 arr.Assign(art::mirror::ByteArray::AllocateAndFill( in ClassPreDefine()
252 std::unique_ptr<const art::DexFile> dex_file(MakeSingleDexFile(self, in ClassPreDefine()
278 void ClassLoad(art::Handle<art::mirror::Class> klass) override in ClassLoad()
279 REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassLoad()
281 art::Thread* thread = art::Thread::Current(); in ClassLoad()
284 art::ObjPtr<art::mirror::Object> peer(thread->GetPeer()); in ClassLoad()
299 void ClassPrepare(art::Handle<art::mirror::Class> temp_klass, in ClassPrepare()
300 art::Handle<art::mirror::Class> klass) in ClassPrepare()
301 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassPrepare()
303 art::Thread* thread = art::Thread::Current(); in ClassPrepare()
311 art::ObjPtr<art::mirror::Object> peer(thread->GetPeer()); in ClassPrepare()
327 void AddTempClass(art::Thread* self, jclass klass) { in AddTempClass()
333 void HandleTempClass(art::Thread* self, in HandleTempClass()
334 art::Handle<art::mirror::Class> temp_klass, in HandleTempClass()
335 art::Handle<art::mirror::Class> klass) in HandleTempClass()
336 REQUIRES_SHARED(art::Locks::mutator_lock_) { in HandleTempClass()
345 … if (temp_klass.Get() == art::ObjPtr<art::mirror::Class>::DownCast(self->DecodeJObject(*it))) { in HandleTempClass()
358 void FixupTempClass(art::Thread* self, in FixupTempClass()
359 art::Handle<art::mirror::Class> temp_klass, in FixupTempClass()
360 art::Handle<art::mirror::Class> klass) in FixupTempClass()
361 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupTempClass()
363 art::gc::Heap* heap = art::Runtime::Current()->GetHeap(); in FixupTempClass()
370 art::ScopedThreadSuspension sts(self, art::kWaitingForVisitObjects); in FixupTempClass()
371 art::ScopedSuspendAll ssa("FixupTempClass"); in FixupTempClass()
373 art::mirror::Class* input = temp_klass.Get(); in FixupTempClass()
374 art::mirror::Class* output = klass.Get(); in FixupTempClass()
385 class RootUpdater : public art::RootVisitor {
387 RootUpdater(const art::mirror::Class* input, art::mirror::Class* output) in RootUpdater()
390 void VisitRoots(art::mirror::Object*** roots, in VisitRoots()
392 const art::RootInfo& info ATTRIBUTE_UNUSED) in VisitRoots()
401 void VisitRoots(art::mirror::CompressedReference<art::mirror::Object>** roots, in VisitRoots()
403 const art::RootInfo& info ATTRIBUTE_UNUSED) in VisitRoots()
404 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in VisitRoots()
413 const art::mirror::Class* input_;
414 art::mirror::Class* output_;
417 void FixupGlobalReferenceTables(art::mirror::Class* input, art::mirror::Class* output) in FixupGlobalReferenceTables()
418 REQUIRES(art::Locks::mutator_lock_) { in FixupGlobalReferenceTables()
419 art::JavaVMExt* java_vm = art::Runtime::Current()->GetJavaVM(); in FixupGlobalReferenceTables()
425 class WeakGlobalUpdate : public art::IsMarkedVisitor { in FixupGlobalReferenceTables()
427 WeakGlobalUpdate(art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupGlobalReferenceTables()
430 art::mirror::Object* IsMarked(art::mirror::Object* obj) override { in FixupGlobalReferenceTables()
438 const art::mirror::Class* input_; in FixupGlobalReferenceTables()
439 art::mirror::Class* output_; in FixupGlobalReferenceTables()
445 void FixupLocalReferenceTables(art::Thread* self, in FixupLocalReferenceTables()
446 art::mirror::Class* input, in FixupLocalReferenceTables()
447 art::mirror::Class* output) in FixupLocalReferenceTables()
448 REQUIRES(art::Locks::mutator_lock_) { in FixupLocalReferenceTables()
451 LocalUpdate(const art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupLocalReferenceTables()
454 static void Callback(art::Thread* t, void* arg) REQUIRES(art::Locks::mutator_lock_) { in FixupLocalReferenceTables()
460 &local_update, art::RootInfo(art::kRootJNILocal, t->GetThreadId())); in FixupLocalReferenceTables()
464 const art::mirror::Class* input_; in FixupLocalReferenceTables()
465 art::mirror::Class* output_; in FixupLocalReferenceTables()
468 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in FixupLocalReferenceTables()
469 art::Runtime::Current()->GetThreadList()->ForEach(LocalUpdate::Callback, &local_upd); in FixupLocalReferenceTables()
472 void FixupHeap(art::mirror::Class* input, art::mirror::Class* output) in FixupHeap()
473 REQUIRES(art::Locks::mutator_lock_) { in FixupHeap()
476 HeapFixupVisitor(const art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupHeap()
479 void operator()(art::mirror::Object* src, in FixupHeap()
480 art::MemberOffset field_offset, in FixupHeap()
482 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupHeap()
483 art::mirror::HeapReference<art::mirror::Object>* trg = in FixupHeap()
492 void operator()(art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED, in FixupHeap()
493 art::ObjPtr<art::mirror::Reference> reference) const in FixupHeap()
494 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupHeap()
495 art::mirror::Object* val = reference->GetReferent(); in FixupHeap()
501 void VisitRoot(art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED) in FixupHeap()
507 art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED) const { in FixupHeap()
512 const art::mirror::Class* input_; in FixupHeap()
513 art::mirror::Class* output_; in FixupHeap()
516 auto object_visitor = [&](art::mirror::Object* obj) { in FixupHeap()
519 art::Runtime::Current()->GetHeap()->VisitObjectsPaused(object_visitor); in FixupHeap()
535 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Register()
536 art::ThreadState::kWaitingForDebuggerToAttach); in Register()
537 art::ScopedSuspendAll ssa("Add load callback"); in Register()
538 art::Runtime::Current()->GetRuntimeCallbacks()->AddClassLoadCallback(&gClassCallback); in Register()
542 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Unregister()
543 art::ThreadState::kWaitingForDebuggerToAttach); in Unregister()
544 art::ScopedSuspendAll ssa("Remove thread callback"); in Unregister()
545 art::Runtime* runtime = art::Runtime::Current(); in Unregister()
553 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassFields()
554 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassFields()
570 art::IterationRange<art::StrideIterator<art::ArtField>> ifields = klass->GetIFields(); in GetClassFields()
571 art::IterationRange<art::StrideIterator<art::ArtField>> sfields = klass->GetSFields(); in GetClassFields()
582 for (art::ArtField& field : sfields) { in GetClassFields()
583 field_array[array_idx] = art::jni::EncodeArtField(&field); in GetClassFields()
586 for (art::ArtField& field : ifields) { in GetClassFields()
587 field_array[array_idx] = art::jni::EncodeArtField(&field); in GetClassFields()
601 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassMethods()
602 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassMethods()
626 if (art::kIsDebugBuild) { in GetClassMethods()
628 for (auto& m ATTRIBUTE_UNUSED : klass->GetDeclaredMethods(art::kRuntimePointerSize)) { in GetClassMethods()
635 for (auto& m : klass->GetDeclaredMethods(art::kRuntimePointerSize)) { in GetClassMethods()
636 method_array[array_idx] = art::jni::EncodeArtMethod(&m); in GetClassMethods()
650 art::ScopedObjectAccess soa(art::Thread::Current()); in GetImplementedInterfaces()
651 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetImplementedInterfaces()
676 art::StackHandleScope<1> hs(soa.Self()); in GetImplementedInterfaces()
677 art::Handle<art::mirror::Class> h_klass(hs.NewHandle(klass)); in GetImplementedInterfaces()
680 art::ObjPtr<art::mirror::Class> inf_klass = in GetImplementedInterfaces()
681 art::mirror::Class::ResolveDirectInterface(soa.Self(), h_klass, idx); in GetImplementedInterfaces()
701 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassSignature()
702 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassSignature()
723 art::StackHandleScope<1> hs(soa.Self()); in GetClassSignature()
724 art::Handle<art::mirror::Class> h_klass = hs.NewHandle(klass); in GetClassSignature()
725 art::ObjPtr<art::mirror::ObjectArray<art::mirror::String>> str_array = in GetClassSignature()
726 art::annotations::GetSignatureAnnotationForClass(h_klass); in GetClassSignature()
755 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassStatus()
756 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassStatus()
789 art::ScopedObjectAccess soa(art::Thread::Current()); in ClassIsT()
790 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in ClassIsT()
806 auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) { in IsInterface()
815 auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) { in IsArrayClass()
822 static uint32_t ClassGetModifiers(art::Thread* self, art::ObjPtr<art::mirror::Class> klass) in ClassGetModifiers()
823 REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassGetModifiers()
826 if ((component_modifiers & art::kAccInterface) != 0) { in ClassGetModifiers()
827 component_modifiers &= ~(art::kAccInterface | art::kAccStatic); in ClassGetModifiers()
829 return art::kAccAbstract | art::kAccFinal | component_modifiers; in ClassGetModifiers()
832 uint32_t modifiers = klass->GetAccessFlags() & art::kAccJavaFlagsMask; in ClassGetModifiers()
834 art::StackHandleScope<1> hs(self); in ClassGetModifiers()
835 art::Handle<art::mirror::Class> h_klass(hs.NewHandle(klass)); in ClassGetModifiers()
836 return art::mirror::Class::GetInnerClassFlags(h_klass, modifiers); in ClassGetModifiers()
842 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassModifiers()
843 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassModifiers()
860 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassLoader()
861 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassLoader()
877 const std::vector<const art::DexFile*>& dex_files, in CopyClassDescriptors()
891 for (const art::DexFile* dex_file : dex_files) { in CopyClassDescriptors()
922 art::Thread* self = art::Thread::Current(); in GetClassLoaderClassDescriptors()
930 art::JNIEnvExt* jnienv = self->GetJniEnv(); in GetClassLoaderClassDescriptors()
932 jnienv->IsInstanceOf(loader, art::WellKnownClasses::java_lang_BootClassLoader)) { in GetClassLoaderClassDescriptors()
935 art::Runtime::Current()->GetClassLinker()->GetBootClassPath(), in GetClassLoaderClassDescriptors()
939 if (!jnienv->IsInstanceOf(loader, art::WellKnownClasses::java_lang_ClassLoader)) { in GetClassLoaderClassDescriptors()
942 art::WellKnownClasses::dalvik_system_BaseDexClassLoader)) { in GetClassLoaderClassDescriptors()
950 art::ScopedObjectAccess soa(self); in GetClassLoaderClassDescriptors()
951 art::StackHandleScope<1> hs(self); in GetClassLoaderClassDescriptors()
952 art::Handle<art::mirror::ClassLoader> class_loader( in GetClassLoaderClassDescriptors()
953 hs.NewHandle(soa.Decode<art::mirror::ClassLoader>(loader))); in GetClassLoaderClassDescriptors()
954 std::vector<const art::DexFile*> dex_files; in GetClassLoaderClassDescriptors()
955 art::VisitClassLoaderDexFiles( in GetClassLoaderClassDescriptors()
958 [&](const art::DexFile* dex_file) { in GetClassLoaderClassDescriptors()
975 art::Thread* self = art::Thread::Current(); in GetClassLoaderClasses()
977 art::WellKnownClasses::java_lang_ClassLoader)) { in GetClassLoaderClasses()
981 art::WellKnownClasses::java_lang_BootClassLoader)) { in GetClassLoaderClasses()
986 art::ScopedObjectAccess soa(self); in GetClassLoaderClasses()
987 art::ObjPtr<art::mirror::ClassLoader> class_loader = in GetClassLoaderClasses()
988 soa.Decode<art::mirror::ClassLoader>(initiating_loader); in GetClassLoaderClasses()
990 art::ClassLinker* class_linker = art::Runtime::Current()->GetClassLinker(); in GetClassLoaderClasses()
992 art::ReaderMutexLock mu(self, *art::Locks::classlinker_classes_lock_); in GetClassLoaderClasses()
994 art::ClassTable* class_table = class_linker->ClassTableForClassLoader(class_loader); in GetClassLoaderClasses()
1003 bool operator()(art::ObjPtr<art::mirror::Class> klass) { in GetClassLoaderClasses()
1029 bool operator()(art::ObjPtr<art::mirror::Class> klass) in GetClassLoaderClasses()
1030 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetClassLoaderClasses()
1039 art::ScopedObjectAccess* soa_ptr; in GetClassLoaderClasses()
1056 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassVersionNumbers()
1060 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetClassVersionNumbers()
1064 art::ObjPtr<art::mirror::Class> klass = jklass_obj->AsClass(); in GetClassVersionNumbers()
1084 art::ScopedObjectAccess soa(art::Thread::Current()); in GetSourceFileName()
1088 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetSourceFileName()
1092 art::ObjPtr<art::mirror::Class> klass = jklass_obj->AsClass(); in GetSourceFileName()
1113 art::ScopedObjectAccess soa(art::Thread::Current()); in GetSourceDebugExtension()
1117 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetSourceDebugExtension()
1121 art::StackHandleScope<1> hs(art::Thread::Current()); in GetSourceDebugExtension()
1122 art::Handle<art::mirror::Class> klass(hs.NewHandle(jklass_obj->AsClass())); in GetSourceDebugExtension()
1127 const char* data = art::annotations::GetSourceDebugExtension(klass); in GetSourceDebugExtension()