Lines Matching refs:art

86 struct TiMethodCallback : public art::MethodCallback {
87 void RegisterNativeMethod(art::ArtMethod* method, in RegisterNativeMethod()
90 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in RegisterNativeMethod()
92 art::Thread* thread = art::Thread::Current(); in RegisterNativeMethod()
93 art::JNIEnvExt* jnienv = thread->GetJniEnv(); in RegisterNativeMethod()
97 jmethodID method_id = art::jni::EncodeArtMethod(method); in RegisterNativeMethod()
98 art::ScopedThreadSuspension sts(thread, art::ThreadState::kNative); in RegisterNativeMethod()
116 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Register()
117 art::ThreadState::kWaitingForDebuggerToAttach); in Register()
118 art::ScopedSuspendAll ssa("Add method callback"); in Register()
119 art::RuntimeCallbacks* callbacks = art::Runtime::Current()->GetRuntimeCallbacks(); in Register()
124 art::ScopedThreadStateChange stsc(art::Thread::Current(), in Unregister()
125 art::ThreadState::kWaitingForDebuggerToAttach); in Unregister()
126 art::ScopedSuspendAll ssa("Remove method callback"); in Unregister()
127 art::RuntimeCallbacks* callbacks = art::Runtime::Current()->GetRuntimeCallbacks(); in Unregister()
138 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetBytecodes()
148 art::ScopedObjectAccess soa(art::Thread::Current()); in GetBytecodes()
149 art::CodeItemInstructionAccessor accessor(art_method->DexInstructions()); in GetBytecodes()
171 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetArgumentsSize()
181 art::ScopedObjectAccess soa(art::Thread::Current()); in GetArgumentsSize()
184 art::ArtMethod* base_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize); in GetArgumentsSize()
185 size_t arg_count = art::ArtMethod::NumArgRegisters(base_method->GetShorty()); in GetArgumentsSize()
206 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetLocalVariableTable()
216 art::ScopedObjectAccess soa(art::Thread::Current()); in GetLocalVariableTable()
218 const art::DexFile* const dex_file = art_method->GetDexFile(); in GetLocalVariableTable()
226 art::CodeItemDebugInfoAccessor accessor(art_method->DexInstructionDebugInfo()); in GetLocalVariableTable()
251 auto visitor = [&](const art::DexFile::LocalInfo& entry) { in GetLocalVariableTable()
292 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMaxLocals()
302 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMaxLocals()
320 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodName()
321 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodName()
322 art_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize); in GetMethodName()
340 const art::Signature sig = art_method->GetSignature(); in GetMethodName()
353 art::ObjPtr<art::mirror::ObjectArray<art::mirror::String>> str_array = in GetMethodName()
354 art::annotations::GetSignatureAnnotationForMethod(art_method); in GetMethodName()
388 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodDeclaringClass()
391 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodDeclaringClass()
392 art::ObjPtr<art::mirror::Class> klass = art_method->GetDeclaringClass(); in GetMethodDeclaringClass()
405 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodLocation()
415 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodLocation()
437 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodModifiers()
441 if ((modifiers & art::kAccAbstract) != 0) { in GetMethodModifiers()
442 modifiers &= ~art::kAccNative; in GetMethodModifiers()
444 modifiers &= ~art::kAccSynchronized; in GetMethodModifiers()
445 if ((modifiers & art::kAccDeclaredSynchronized) != 0) { in GetMethodModifiers()
446 modifiers |= art::kAccSynchronized; in GetMethodModifiers()
448 modifiers &= art::kAccJavaFlagsMask; in GetMethodModifiers()
461 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetLineNumberTable()
464 art::CodeItemDebugInfoAccessor accessor; in GetLineNumberTable()
465 const art::DexFile* dex_file; in GetLineNumberTable()
467 art::ScopedObjectAccess soa(art::Thread::Current()); in GetLineNumberTable()
479 accessor = art::CodeItemDebugInfoAccessor(art_method->DexInstructionDebugInfo()); in GetLineNumberTable()
485 bool success = accessor.DecodeDebugPositionInfo([&](const art::DexFile::PositionInfo& entry) { in GetLineNumberTable()
518 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in IsMethodT()
525 auto test = [](art::ArtMethod* method) { in IsMethodNative()
532 auto test = [](art::ArtMethod* method) { in IsMethodObsolete()
539 auto test = [](art::ArtMethod* method) { in IsMethodSynthetic()
545 class CommonLocalVariableClosure : public art::Closure {
556 using SlotType = std::variant<art::Primitive::Type, VerifierPrimitiveType>;
561 void Run(art::Thread* self) override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Run()
562 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current()); in Run()
565 art::ScopedAssertNoThreadSuspension sants("CommonLocalVariableClosure::Run"); in Run()
566 std::unique_ptr<art::Context> context(art::Context::Create()); in Run()
574 art::ArtMethod* method = visitor.GetMethod(); in Run()
586 if (pc == art::dex::kDexNoIndex) { in Run()
592 SlotType slot_type{ art::Primitive::kPrimVoid }; in Run()
616 virtual jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor)
617 REQUIRES_SHARED(art::Locks::mutator_lock_) = 0;
618 virtual jvmtiError GetTypeError(art::ArtMethod* method,
621 REQUIRES_SHARED(art::Locks::mutator_lock_) = 0;
623 jvmtiError GetSlotType(art::ArtMethod* method,
627 REQUIRES_SHARED(art::Locks::mutator_lock_);
629 jvmtiError InferSlotTypeFromVerifier(art::ArtMethod* method, in InferSlotTypeFromVerifier()
633 REQUIRES_SHARED(art::Locks::mutator_lock_) { in InferSlotTypeFromVerifier()
634 art::Thread* self = art::Thread::Current(); in InferSlotTypeFromVerifier()
635 art::StackHandleScope<2> hs(self); in InferSlotTypeFromVerifier()
636 std::unique_ptr<art::verifier::MethodVerifier> verifier( in InferSlotTypeFromVerifier()
637 art::verifier::MethodVerifier::CalculateVerificationInfo( in InferSlotTypeFromVerifier()
648 art::verifier::RegisterLine* line = verifier->GetRegLine(dex_pc); in InferSlotTypeFromVerifier()
654 const art::verifier::RegType& rt = line->GetRegisterType(verifier.get(), slot_); in InferSlotTypeFromVerifier()
680 if (std::holds_alternative<art::Primitive::Type>(t)) { in SquashType()
681 switch (std::get<art::Primitive::Type>(t)) { in SquashType()
683 case art::Primitive::kPrimByte: in SquashType()
684 case art::Primitive::kPrimChar: in SquashType()
685 case art::Primitive::kPrimInt: in SquashType()
686 case art::Primitive::kPrimShort: in SquashType()
687 case art::Primitive::kPrimBoolean: in SquashType()
688 case art::Primitive::kPrimFloat: in SquashType()
691 case art::Primitive::kPrimLong: in SquashType()
692 case art::Primitive::kPrimDouble: in SquashType()
694 case art::Primitive::kPrimNot: in SquashType()
696 case art::Primitive::kPrimVoid: in SquashType()
729 if (std::holds_alternative<art::Primitive::Type>(state)) { in operator <<()
730 return os << "Primitive::Type[" << std::get<art::Primitive::Type>(state) << "]"; in operator <<()
737 jvmtiError CommonLocalVariableClosure::GetSlotType(art::ArtMethod* method, in GetSlotType()
741 const art::DexFile* dex_file = method->GetDexFile(); in GetSlotType()
745 art::CodeItemDebugInfoAccessor accessor(method->DexInstructionDebugInfo()); in GetSlotType()
750 *type = art::Primitive::kPrimVoid; in GetSlotType()
752 auto visitor = [&](const art::DexFile::LocalInfo& entry) { in GetSlotType()
756 *type = art::Primitive::GetType(entry.descriptor_[0]); in GetSlotType()
766 } else if (art::kIsDebugBuild) { in GetSlotType()
768 SlotType verifier_type{ art::Primitive::kPrimVoid }; in GetSlotType()
771 if (*type == SlotType{ art::Primitive::kPrimNot }) { in GetSlotType()
800 art::Primitive::Type type, in GetLocalVariableClosure()
807 jvmtiError GetResult() override REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetResult()
808 if (result_ == OK && type_ == art::Primitive::kPrimNot) { in GetResult()
812 art::JNIEnvExt* jni = art::Thread::Current()->GetJniEnv(); in GetResult()
823 GetTypeError(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) override in GetTypeError()
824 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeError()
836 jvmtiError GetTypeErrorInner(art::ArtMethod* method ATTRIBUTE_UNUSED, in GetTypeErrorInner()
839 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeErrorInner()
841 case art::Primitive::kPrimFloat: in GetTypeErrorInner()
842 case art::Primitive::kPrimInt: { in GetTypeErrorInner()
848 } else if (type_ == art::Primitive::kPrimFloat || in GetTypeErrorInner()
849 slot_type == SlotType { art::Primitive::kPrimFloat }) { in GetTypeErrorInner()
857 case art::Primitive::kPrimLong: in GetTypeErrorInner()
858 case art::Primitive::kPrimDouble: { in GetTypeErrorInner()
868 case art::Primitive::kPrimNot: in GetTypeErrorInner()
873 case art::Primitive::kPrimShort: in GetTypeErrorInner()
874 case art::Primitive::kPrimChar: in GetTypeErrorInner()
875 case art::Primitive::kPrimByte: in GetTypeErrorInner()
876 case art::Primitive::kPrimBoolean: in GetTypeErrorInner()
877 case art::Primitive::kPrimVoid: in GetTypeErrorInner()
883 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor) in Execute()
884 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Execute()
886 case art::Primitive::kPrimNot: { in Execute()
890 art::kReferenceVReg, in Execute()
894 art::ObjPtr<art::mirror::Object> obj(reinterpret_cast<art::mirror::Object*>(ptr_val)); in Execute()
895 obj_val_ = art::Runtime::Current()->GetJavaVM()->AddGlobalRef(art::Thread::Current(), obj); in Execute()
898 case art::Primitive::kPrimInt: in Execute()
899 case art::Primitive::kPrimFloat: { in Execute()
902 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg : art::kIntVReg, in Execute()
908 case art::Primitive::kPrimDouble: in Execute()
909 case art::Primitive::kPrimLong: { in Execute()
910 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg; in Execute()
911 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg; in Execute()
930 art::Primitive::Type type_;
941 art::Primitive::Type type, in GetLocalVariableGeneric()
946 art::Thread* self = art::Thread::Current(); in GetLocalVariableGeneric()
947 art::ScopedObjectAccess soa(self); in GetLocalVariableGeneric()
948 art::Locks::thread_list_lock_->ExclusiveLock(self); in GetLocalVariableGeneric()
949 art::Thread* target = nullptr; in GetLocalVariableGeneric()
952 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in GetLocalVariableGeneric()
967 art::Thread* caller, in SetLocalVariableClosure()
970 art::Primitive::Type type, in SetLocalVariableClosure()
976 GetTypeError(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) override in GetTypeError()
977 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeError()
983 if (type_ == art::Primitive::kPrimNot) { in GetTypeError()
985 art::ObjPtr<art::mirror::Object> new_val(art::Thread::Current()->DecodeJObject(val_.l)); in GetTypeError()
1001 GetTypeErrorInner(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) in GetTypeErrorInner()
1002 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeErrorInner()
1018 } else if (type_ == art::Primitive::kPrimFloat || in GetTypeErrorInner()
1019 slot_type == SlotType { art::Primitive::kPrimFloat }) { in GetTypeErrorInner()
1046 art::ClassLinker* cl = art::Runtime::Current()->GetClassLinker(); in GetTypeErrorInner()
1047 art::ObjPtr<art::mirror::Class> set_class = caller_->DecodeJObject(val_.l)->GetClass(); in GetTypeErrorInner()
1048 art::ObjPtr<art::mirror::ClassLoader> loader = in GetTypeErrorInner()
1050 art::ObjPtr<art::mirror::Class> slot_class = in GetTypeErrorInner()
1063 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor) in Execute()
1064 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Execute()
1066 case art::Primitive::kPrimNot: { in Execute()
1074 case art::Primitive::kPrimInt: in Execute()
1075 case art::Primitive::kPrimFloat: { in Execute()
1079 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg in Execute()
1080 : art::kIntVReg)) { in Execute()
1085 case art::Primitive::kPrimDouble: in Execute()
1086 case art::Primitive::kPrimLong: { in Execute()
1087 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg; in Execute()
1088 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg; in Execute()
1107 art::Thread* caller_;
1108 art::Primitive::Type type_;
1117 art::Primitive::Type type, in SetLocalVariableGeneric()
1125 art::Thread* self = art::Thread::Current(); in SetLocalVariableGeneric()
1126 art::ScopedObjectAccess soa(self); in SetLocalVariableGeneric()
1127 art::Locks::thread_list_lock_->ExclusiveLock(self); in SetLocalVariableGeneric()
1128 art::Thread* target = nullptr; in SetLocalVariableGeneric()
1131 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in SetLocalVariableGeneric()
1143 class GetLocalInstanceClosure : public art::Closure {
1150 void Run(art::Thread* self) override REQUIRES(art::Locks::mutator_lock_) { in Run()
1151 art::ScopedAssertNoThreadSuspension sants("GetLocalInstanceClosure::Run"); in Run()
1152 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current()); in Run()
1153 std::unique_ptr<art::Context> context(art::Context::Create()); in Run()
1162 val_ = art::GcRoot<art::mirror::Object>(visitor.GetThisObject()); in Run()
1165 jvmtiError GetResult(jobject* data_out) REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetResult()
1169 : art::Thread::Current()->GetJniEnv()->AddLocalReference<jobject>(val_.Read()); in GetResult()
1177 art::GcRoot<art::mirror::Object> val_;
1187 art::Thread* self = art::Thread::Current(); in GetLocalInstance()
1188 art::ScopedObjectAccess soa(self); in GetLocalInstance()
1189 art::Locks::thread_list_lock_->ExclusiveLock(self); in GetLocalInstance()
1190 art::Thread* target = nullptr; in GetLocalInstance()
1193 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in GetLocalInstance()
1196 art::ScopedAssertNoThreadSuspension sants("Performing GetLocalInstance"); in GetLocalInstance()
1201 if (!target->RequestSynchronousCheckpoint(&c, art::ThreadState::kRunnable)) { in GetLocalInstance()
1209 fn(jint, art::Primitive::kPrimInt, i) \
1210 fn(jlong, art::Primitive::kPrimLong, j) \
1211 fn(jfloat, art::Primitive::kPrimFloat, f) \
1212 fn(jdouble, art::Primitive::kPrimDouble, d) \
1213 fn(jobject, art::Primitive::kPrimNot, l)
1219 template<typename T> art::Primitive::Type GetJNIType();
1222 template<> art::Primitive::Type GetJNIType<type>() { \
1251 art::Primitive::Type type = impl::GetJNIType<T>(); in SetLocalVariable()
1266 art::Primitive::Type type = impl::GetJNIType<T>(); in GetLocalVariable()