Lines Matching refs:art
88 static std::unique_ptr<const art::DexFile> MakeSingleDexFile(art::Thread* self, in MakeSingleDexFile()
93 REQUIRES_SHARED(art::Locks::mutator_lock_) { in MakeSingleDexFile()
96 art::ArrayRef<const unsigned char> final_data(final_dex_data, final_len); in MakeSingleDexFile()
97 art::MemMap map = Redefiner::MoveDataToMemMap(orig_location, final_data, &error_msg); in MakeSingleDexFile()
106 if (map.Size() < sizeof(art::DexFile::Header)) { in MakeSingleDexFile()
108 art::ThrowClassFormatError(nullptr, in MakeSingleDexFile()
113 uint32_t checksum = reinterpret_cast<const art::DexFile::Header*>(map.Begin())->checksum_; in MakeSingleDexFile()
115 const art::ArtDexFileLoader dex_file_loader; in MakeSingleDexFile()
116 std::unique_ptr<const art::DexFile> dex_file(dex_file_loader.Open(map_name, in MakeSingleDexFile()
124 art::ThrowClassFormatError(nullptr, in MakeSingleDexFile()
133 art::ThrowClassFormatError( in MakeSingleDexFile()
161 struct ClassCallback : public art::ClassLoadCallback {
163 art::Handle<art::mirror::Class> klass, in ClassPreDefine()
164 art::Handle<art::mirror::ClassLoader> class_loader, in ClassPreDefine()
165 const art::DexFile& initial_dex_file, in ClassPreDefine()
166 const art::dex::ClassDef& initial_class_def ATTRIBUTE_UNUSED, in ClassPreDefine()
167 /*out*/art::DexFile const** final_dex_file, in ClassPreDefine()
168 /*out*/art::dex::ClassDef const** final_class_def) in ClassPreDefine()
169 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassPreDefine()
191 art::Thread* self = art::Thread::Current(); in ClassPreDefine()
212 art::StackHandleScope<2> hs(self); in ClassPreDefine()
215 art::Handle<art::mirror::ClassExt> ext(hs.NewHandle(klass->EnsureExtDataPresent(self))); in ClassPreDefine()
227 art::MutableHandle<art::mirror::Object> arr(hs.NewHandle<art::mirror::Object>(nullptr)); in ClassPreDefine()
232 art::JValue val; in ClassPreDefine()
234 arr.Assign(art::BoxPrimitive(art::Primitive::kPrimLong, val)); in ClassPreDefine()
236 arr.Assign(art::mirror::ByteArray::AllocateAndFill( in ClassPreDefine()
247 std::unique_ptr<const art::DexFile> dex_file(MakeSingleDexFile(self, in ClassPreDefine()
273 void ClassLoad(art::Handle<art::mirror::Class> klass) override in ClassLoad()
274 REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassLoad()
276 art::Thread* thread = art::Thread::Current(); in ClassLoad()
279 art::ObjPtr<art::mirror::Object> peer(thread->GetPeer()); in ClassLoad()
294 void ClassPrepare(art::Handle<art::mirror::Class> temp_klass, in ClassPrepare()
295 art::Handle<art::mirror::Class> klass) in ClassPrepare()
296 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassPrepare()
298 art::Thread* thread = art::Thread::Current(); in ClassPrepare()
306 art::ObjPtr<art::mirror::Object> peer(thread->GetPeer()); in ClassPrepare()
322 void AddTempClass(art::Thread* self, jclass klass) { in AddTempClass()
328 void HandleTempClass(art::Thread* self, in HandleTempClass()
329 art::Handle<art::mirror::Class> temp_klass, in HandleTempClass()
330 art::Handle<art::mirror::Class> klass) in HandleTempClass()
331 REQUIRES_SHARED(art::Locks::mutator_lock_) { in HandleTempClass()
340 … if (temp_klass.Get() == art::ObjPtr<art::mirror::Class>::DownCast(self->DecodeJObject(*it))) { in HandleTempClass()
353 void FixupTempClass(art::Thread* self, in FixupTempClass()
354 art::Handle<art::mirror::Class> temp_klass, in FixupTempClass()
355 art::Handle<art::mirror::Class> klass) in FixupTempClass()
356 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupTempClass()
358 art::gc::Heap* heap = art::Runtime::Current()->GetHeap(); in FixupTempClass()
365 art::ScopedThreadSuspension sts(self, art::kWaitingForVisitObjects); in FixupTempClass()
366 art::ScopedSuspendAll ssa("FixupTempClass"); in FixupTempClass()
368 art::mirror::Class* input = temp_klass.Get(); in FixupTempClass()
369 art::mirror::Class* output = klass.Get(); in FixupTempClass()
380 class RootUpdater : public art::RootVisitor {
382 RootUpdater(const art::mirror::Class* input, art::mirror::Class* output) in RootUpdater()
385 void VisitRoots(art::mirror::Object*** roots, in VisitRoots()
387 const art::RootInfo& info ATTRIBUTE_UNUSED) in VisitRoots()
396 void VisitRoots(art::mirror::CompressedReference<art::mirror::Object>** roots, in VisitRoots()
398 const art::RootInfo& info ATTRIBUTE_UNUSED) in VisitRoots()
399 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in VisitRoots()
408 const art::mirror::Class* input_;
409 art::mirror::Class* output_;
412 void FixupGlobalReferenceTables(art::mirror::Class* input, art::mirror::Class* output) in FixupGlobalReferenceTables()
413 REQUIRES(art::Locks::mutator_lock_) { in FixupGlobalReferenceTables()
414 art::JavaVMExt* java_vm = art::Runtime::Current()->GetJavaVM(); in FixupGlobalReferenceTables()
420 class WeakGlobalUpdate : public art::IsMarkedVisitor { in FixupGlobalReferenceTables()
422 WeakGlobalUpdate(art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupGlobalReferenceTables()
425 art::mirror::Object* IsMarked(art::mirror::Object* obj) override { in FixupGlobalReferenceTables()
433 const art::mirror::Class* input_; in FixupGlobalReferenceTables()
434 art::mirror::Class* output_; in FixupGlobalReferenceTables()
440 void FixupLocalReferenceTables(art::Thread* self, in FixupLocalReferenceTables()
441 art::mirror::Class* input, in FixupLocalReferenceTables()
442 art::mirror::Class* output) in FixupLocalReferenceTables()
443 REQUIRES(art::Locks::mutator_lock_) { in FixupLocalReferenceTables()
446 LocalUpdate(const art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupLocalReferenceTables()
449 static void Callback(art::Thread* t, void* arg) REQUIRES(art::Locks::mutator_lock_) { in FixupLocalReferenceTables()
455 &local_update, art::RootInfo(art::kRootJNILocal, t->GetThreadId())); in FixupLocalReferenceTables()
459 const art::mirror::Class* input_; in FixupLocalReferenceTables()
460 art::mirror::Class* output_; in FixupLocalReferenceTables()
463 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in FixupLocalReferenceTables()
464 art::Runtime::Current()->GetThreadList()->ForEach(LocalUpdate::Callback, &local_upd); in FixupLocalReferenceTables()
467 void FixupHeap(art::mirror::Class* input, art::mirror::Class* output) in FixupHeap()
468 REQUIRES(art::Locks::mutator_lock_) { in FixupHeap()
471 HeapFixupVisitor(const art::mirror::Class* root_input, art::mirror::Class* root_output) in FixupHeap()
474 void operator()(art::mirror::Object* src, in FixupHeap()
475 art::MemberOffset field_offset, in FixupHeap()
477 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupHeap()
478 art::mirror::HeapReference<art::mirror::Object>* trg = in FixupHeap()
487 void operator()(art::ObjPtr<art::mirror::Class> klass ATTRIBUTE_UNUSED, in FixupHeap()
488 art::ObjPtr<art::mirror::Reference> reference) const in FixupHeap()
489 REQUIRES_SHARED(art::Locks::mutator_lock_) { in FixupHeap()
490 art::mirror::Object* val = reference->GetReferent(); in FixupHeap()
496 void VisitRoot(art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED) in FixupHeap()
502 art::mirror::CompressedReference<art::mirror::Object>* root ATTRIBUTE_UNUSED) const { in FixupHeap()
507 const art::mirror::Class* input_; in FixupHeap()
508 art::mirror::Class* output_; in FixupHeap()
511 auto object_visitor = [&](art::mirror::Object* obj) { in FixupHeap()
514 art::Runtime::Current()->GetHeap()->VisitObjectsPaused(object_visitor); in FixupHeap()
530 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Register()
531 art::ThreadState::kWaitingForDebuggerToAttach); in Register()
532 art::ScopedSuspendAll ssa("Add load callback"); in Register()
533 art::Runtime::Current()->GetRuntimeCallbacks()->AddClassLoadCallback(&gClassCallback); in Register()
537 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Unregister()
538 art::ThreadState::kWaitingForDebuggerToAttach); in Unregister()
539 art::ScopedSuspendAll ssa("Remove thread callback"); in Unregister()
540 art::Runtime* runtime = art::Runtime::Current(); in Unregister()
548 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassFields()
549 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassFields()
565 art::IterationRange<art::StrideIterator<art::ArtField>> ifields = klass->GetIFields(); in GetClassFields()
566 art::IterationRange<art::StrideIterator<art::ArtField>> sfields = klass->GetSFields(); in GetClassFields()
577 for (art::ArtField& field : sfields) { in GetClassFields()
578 field_array[array_idx] = art::jni::EncodeArtField(&field); in GetClassFields()
581 for (art::ArtField& field : ifields) { in GetClassFields()
582 field_array[array_idx] = art::jni::EncodeArtField(&field); in GetClassFields()
596 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassMethods()
597 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassMethods()
621 if (art::kIsDebugBuild) { in GetClassMethods()
623 for (auto& m ATTRIBUTE_UNUSED : klass->GetDeclaredMethods(art::kRuntimePointerSize)) { in GetClassMethods()
630 for (auto& m : klass->GetDeclaredMethods(art::kRuntimePointerSize)) { in GetClassMethods()
631 method_array[array_idx] = art::jni::EncodeArtMethod(&m); in GetClassMethods()
645 art::ScopedObjectAccess soa(art::Thread::Current()); in GetImplementedInterfaces()
646 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetImplementedInterfaces()
671 art::StackHandleScope<1> hs(soa.Self()); in GetImplementedInterfaces()
672 art::Handle<art::mirror::Class> h_klass(hs.NewHandle(klass)); in GetImplementedInterfaces()
675 art::ObjPtr<art::mirror::Class> inf_klass = in GetImplementedInterfaces()
676 art::mirror::Class::ResolveDirectInterface(soa.Self(), h_klass, idx); in GetImplementedInterfaces()
696 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassSignature()
697 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassSignature()
718 art::StackHandleScope<1> hs(soa.Self()); in GetClassSignature()
719 art::Handle<art::mirror::Class> h_klass = hs.NewHandle(klass); in GetClassSignature()
720 art::ObjPtr<art::mirror::ObjectArray<art::mirror::String>> str_array = in GetClassSignature()
721 art::annotations::GetSignatureAnnotationForClass(h_klass); in GetClassSignature()
750 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassStatus()
751 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassStatus()
784 art::ScopedObjectAccess soa(art::Thread::Current()); in ClassIsT()
785 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in ClassIsT()
801 auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) { in IsInterface()
810 auto test = [](art::ObjPtr<art::mirror::Class> klass) REQUIRES_SHARED(art::Locks::mutator_lock_) { in IsArrayClass()
817 static uint32_t ClassGetModifiers(art::Thread* self, art::ObjPtr<art::mirror::Class> klass) in ClassGetModifiers()
818 REQUIRES_SHARED(art::Locks::mutator_lock_) { in ClassGetModifiers()
821 if ((component_modifiers & art::kAccInterface) != 0) { in ClassGetModifiers()
822 component_modifiers &= ~(art::kAccInterface | art::kAccStatic); in ClassGetModifiers()
824 return art::kAccAbstract | art::kAccFinal | component_modifiers; in ClassGetModifiers()
827 uint32_t modifiers = klass->GetAccessFlags() & art::kAccJavaFlagsMask; in ClassGetModifiers()
829 art::StackHandleScope<1> hs(self); in ClassGetModifiers()
830 art::Handle<art::mirror::Class> h_klass(hs.NewHandle(klass)); in ClassGetModifiers()
831 return art::mirror::Class::GetInnerClassFlags(h_klass, modifiers); in ClassGetModifiers()
837 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassModifiers()
838 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassModifiers()
855 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassLoader()
856 art::ObjPtr<art::mirror::Class> klass = soa.Decode<art::mirror::Class>(jklass); in GetClassLoader()
872 const std::vector<const art::DexFile*>& dex_files, in CopyClassDescriptors()
886 for (const art::DexFile* dex_file : dex_files) { in CopyClassDescriptors()
917 art::Thread* self = art::Thread::Current(); in GetClassLoaderClassDescriptors()
925 art::JNIEnvExt* jnienv = self->GetJniEnv(); in GetClassLoaderClassDescriptors()
927 jnienv->IsInstanceOf(loader, art::WellKnownClasses::java_lang_BootClassLoader)) { in GetClassLoaderClassDescriptors()
930 art::Runtime::Current()->GetClassLinker()->GetBootClassPath(), in GetClassLoaderClassDescriptors()
934 if (!jnienv->IsInstanceOf(loader, art::WellKnownClasses::java_lang_ClassLoader)) { in GetClassLoaderClassDescriptors()
937 art::WellKnownClasses::dalvik_system_BaseDexClassLoader)) { in GetClassLoaderClassDescriptors()
945 art::ScopedObjectAccess soa(self); in GetClassLoaderClassDescriptors()
946 art::StackHandleScope<1> hs(self); in GetClassLoaderClassDescriptors()
947 art::Handle<art::mirror::ClassLoader> class_loader( in GetClassLoaderClassDescriptors()
948 hs.NewHandle(soa.Decode<art::mirror::ClassLoader>(loader))); in GetClassLoaderClassDescriptors()
949 std::vector<const art::DexFile*> dex_files; in GetClassLoaderClassDescriptors()
950 art::VisitClassLoaderDexFiles( in GetClassLoaderClassDescriptors()
953 [&](const art::DexFile* dex_file) { in GetClassLoaderClassDescriptors()
970 art::Thread* self = art::Thread::Current(); in GetClassLoaderClasses()
972 art::WellKnownClasses::java_lang_ClassLoader)) { in GetClassLoaderClasses()
976 art::WellKnownClasses::java_lang_BootClassLoader)) { in GetClassLoaderClasses()
981 art::ScopedObjectAccess soa(self); in GetClassLoaderClasses()
982 art::ObjPtr<art::mirror::ClassLoader> class_loader = in GetClassLoaderClasses()
983 soa.Decode<art::mirror::ClassLoader>(initiating_loader); in GetClassLoaderClasses()
985 art::ClassLinker* class_linker = art::Runtime::Current()->GetClassLinker(); in GetClassLoaderClasses()
987 art::ReaderMutexLock mu(self, *art::Locks::classlinker_classes_lock_); in GetClassLoaderClasses()
989 art::ClassTable* class_table = class_linker->ClassTableForClassLoader(class_loader); in GetClassLoaderClasses()
998 bool operator()(art::ObjPtr<art::mirror::Class> klass) { in GetClassLoaderClasses()
1024 bool operator()(art::ObjPtr<art::mirror::Class> klass) in GetClassLoaderClasses()
1025 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetClassLoaderClasses()
1034 art::ScopedObjectAccess* soa_ptr; in GetClassLoaderClasses()
1051 art::ScopedObjectAccess soa(art::Thread::Current()); in GetClassVersionNumbers()
1055 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetClassVersionNumbers()
1059 art::ObjPtr<art::mirror::Class> klass = jklass_obj->AsClass(); in GetClassVersionNumbers()
1079 art::ScopedObjectAccess soa(art::Thread::Current()); in GetSourceFileName()
1083 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetSourceFileName()
1087 art::ObjPtr<art::mirror::Class> klass = jklass_obj->AsClass(); in GetSourceFileName()
1108 art::ScopedObjectAccess soa(art::Thread::Current()); in GetSourceDebugExtension()
1112 art::ObjPtr<art::mirror::Object> jklass_obj = soa.Decode<art::mirror::Object>(jklass); in GetSourceDebugExtension()
1116 art::StackHandleScope<1> hs(art::Thread::Current()); in GetSourceDebugExtension()
1117 art::Handle<art::mirror::Class> klass(hs.NewHandle(jklass_obj->AsClass())); in GetSourceDebugExtension()
1122 const char* data = art::annotations::GetSourceDebugExtension(klass); in GetSourceDebugExtension()