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()
207 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetLocalVariableTable()
217 art::ScopedObjectAccess soa(art::Thread::Current()); in GetLocalVariableTable()
219 const art::DexFile* const dex_file = art_method->GetDexFile(); in GetLocalVariableTable()
227 art::CodeItemDebugInfoAccessor accessor(art_method->DexInstructionDebugInfo()); in GetLocalVariableTable()
252 auto visitor = [&](const art::DexFile::LocalInfo& entry) { in GetLocalVariableTable()
293 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMaxLocals()
303 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMaxLocals()
322 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodName()
323 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodName()
324 art_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize); in GetMethodName()
342 const art::Signature sig = art_method->GetSignature(); in GetMethodName()
355 art::ObjPtr<art::mirror::ObjectArray<art::mirror::String>> str_array = in GetMethodName()
356 art::annotations::GetSignatureAnnotationForMethod(art_method); in GetMethodName()
390 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodDeclaringClass()
393 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodDeclaringClass()
394 art::ObjPtr<art::mirror::Class> klass = art_method->GetDeclaringClass(); in GetMethodDeclaringClass()
407 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodLocation()
417 art::ScopedObjectAccess soa(art::Thread::Current()); in GetMethodLocation()
440 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetMethodModifiers()
444 if ((modifiers & art::kAccAbstract) != 0) { in GetMethodModifiers()
445 modifiers &= ~art::kAccNative; in GetMethodModifiers()
447 modifiers &= ~art::kAccSynchronized; in GetMethodModifiers()
448 if ((modifiers & art::kAccDeclaredSynchronized) != 0) { in GetMethodModifiers()
449 modifiers |= art::kAccSynchronized; in GetMethodModifiers()
451 modifiers &= art::kAccJavaFlagsMask; in GetMethodModifiers()
464 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in GetLineNumberTable()
467 art::CodeItemDebugInfoAccessor accessor; in GetLineNumberTable()
468 const art::DexFile* dex_file; in GetLineNumberTable()
470 art::ScopedObjectAccess soa(art::Thread::Current()); in GetLineNumberTable()
482 accessor = art::CodeItemDebugInfoAccessor(art_method->DexInstructionDebugInfo()); in GetLineNumberTable()
488 bool success = accessor.DecodeDebugPositionInfo([&](const art::DexFile::PositionInfo& entry) { in GetLineNumberTable()
521 art::ArtMethod* art_method = art::jni::DecodeArtMethod(method); in IsMethodT()
528 auto test = [](art::ArtMethod* method) { in IsMethodNative()
535 auto test = [](art::ArtMethod* method) { in IsMethodObsolete()
542 auto test = [](art::ArtMethod* method) { in IsMethodSynthetic()
548 class CommonLocalVariableClosure : public art::Closure {
559 using SlotType = std::variant<art::Primitive::Type, VerifierPrimitiveType>;
564 void Run(art::Thread* self) override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Run()
565 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current()); in Run()
568 art::ScopedAssertNoThreadSuspension sants("CommonLocalVariableClosure::Run"); in Run()
569 std::unique_ptr<art::Context> context(art::Context::Create()); in Run()
577 art::ArtMethod* method = visitor.GetMethod(); in Run()
589 if (pc == art::dex::kDexNoIndex) { in Run()
595 SlotType slot_type{ art::Primitive::kPrimVoid }; in Run()
619 virtual jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor)
620 REQUIRES_SHARED(art::Locks::mutator_lock_) = 0;
621 virtual jvmtiError GetTypeError(art::ArtMethod* method,
624 REQUIRES_SHARED(art::Locks::mutator_lock_) = 0;
626 jvmtiError GetSlotType(art::ArtMethod* method,
630 REQUIRES_SHARED(art::Locks::mutator_lock_);
632 jvmtiError InferSlotTypeFromVerifier(art::ArtMethod* method, in InferSlotTypeFromVerifier()
636 REQUIRES_SHARED(art::Locks::mutator_lock_) { in InferSlotTypeFromVerifier()
637 art::Thread* self = art::Thread::Current(); in InferSlotTypeFromVerifier()
638 art::StackHandleScope<2> hs(self); in InferSlotTypeFromVerifier()
639 std::unique_ptr<art::verifier::MethodVerifier> verifier( in InferSlotTypeFromVerifier()
640 art::verifier::MethodVerifier::CalculateVerificationInfo( in InferSlotTypeFromVerifier()
651 art::verifier::RegisterLine* line = verifier->GetRegLine(dex_pc); in InferSlotTypeFromVerifier()
657 const art::verifier::RegType& rt = line->GetRegisterType(verifier.get(), slot_); in InferSlotTypeFromVerifier()
683 if (std::holds_alternative<art::Primitive::Type>(t)) { in SquashType()
684 switch (std::get<art::Primitive::Type>(t)) { in SquashType()
686 case art::Primitive::kPrimByte: in SquashType()
687 case art::Primitive::kPrimChar: in SquashType()
688 case art::Primitive::kPrimInt: in SquashType()
689 case art::Primitive::kPrimShort: in SquashType()
690 case art::Primitive::kPrimBoolean: in SquashType()
691 case art::Primitive::kPrimFloat: in SquashType()
694 case art::Primitive::kPrimLong: in SquashType()
695 case art::Primitive::kPrimDouble: in SquashType()
697 case art::Primitive::kPrimNot: in SquashType()
699 case art::Primitive::kPrimVoid: in SquashType()
732 if (std::holds_alternative<art::Primitive::Type>(state)) { in operator <<()
733 return os << "Primitive::Type[" << std::get<art::Primitive::Type>(state) << "]"; in operator <<()
740 jvmtiError CommonLocalVariableClosure::GetSlotType(art::ArtMethod* method, in GetSlotType()
744 const art::DexFile* dex_file = method->GetDexFile(); in GetSlotType()
748 art::CodeItemDebugInfoAccessor accessor(method->DexInstructionDebugInfo()); in GetSlotType()
753 *type = art::Primitive::kPrimVoid; in GetSlotType()
755 auto visitor = [&](const art::DexFile::LocalInfo& entry) { in GetSlotType()
759 *type = art::Primitive::GetType(entry.descriptor_[0]); in GetSlotType()
769 } else if (art::kIsDebugBuild) { in GetSlotType()
771 SlotType verifier_type{ art::Primitive::kPrimVoid }; in GetSlotType()
774 if (*type == SlotType{ art::Primitive::kPrimNot }) { in GetSlotType()
803 art::Primitive::Type type, in GetLocalVariableClosure()
810 jvmtiError GetResult() override REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetResult()
811 if (result_ == OK && type_ == art::Primitive::kPrimNot) { in GetResult()
815 art::JNIEnvExt* jni = art::Thread::Current()->GetJniEnv(); in GetResult()
826 GetTypeError(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) override in GetTypeError()
827 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeError()
839 jvmtiError GetTypeErrorInner(art::ArtMethod* method ATTRIBUTE_UNUSED, in GetTypeErrorInner()
842 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeErrorInner()
844 case art::Primitive::kPrimFloat: in GetTypeErrorInner()
845 case art::Primitive::kPrimInt: { in GetTypeErrorInner()
851 } else if (type_ == art::Primitive::kPrimFloat || in GetTypeErrorInner()
852 slot_type == SlotType { art::Primitive::kPrimFloat }) { in GetTypeErrorInner()
860 case art::Primitive::kPrimLong: in GetTypeErrorInner()
861 case art::Primitive::kPrimDouble: { in GetTypeErrorInner()
871 case art::Primitive::kPrimNot: in GetTypeErrorInner()
876 case art::Primitive::kPrimShort: in GetTypeErrorInner()
877 case art::Primitive::kPrimChar: in GetTypeErrorInner()
878 case art::Primitive::kPrimByte: in GetTypeErrorInner()
879 case art::Primitive::kPrimBoolean: in GetTypeErrorInner()
880 case art::Primitive::kPrimVoid: in GetTypeErrorInner()
886 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor) in Execute()
887 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Execute()
889 case art::Primitive::kPrimNot: { in Execute()
893 art::kReferenceVReg, in Execute()
897 art::ObjPtr<art::mirror::Object> obj(reinterpret_cast<art::mirror::Object*>(ptr_val)); in Execute()
898 obj_val_ = art::Runtime::Current()->GetJavaVM()->AddGlobalRef(art::Thread::Current(), obj); in Execute()
901 case art::Primitive::kPrimInt: in Execute()
902 case art::Primitive::kPrimFloat: { in Execute()
905 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg : art::kIntVReg, in Execute()
911 case art::Primitive::kPrimDouble: in Execute()
912 case art::Primitive::kPrimLong: { in Execute()
913 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg; in Execute()
914 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg; in Execute()
933 art::Primitive::Type type_;
944 art::Primitive::Type type, in GetLocalVariableGeneric()
949 art::Thread* self = art::Thread::Current(); in GetLocalVariableGeneric()
950 art::ScopedObjectAccess soa(self); in GetLocalVariableGeneric()
951 art::Locks::thread_list_lock_->ExclusiveLock(self); in GetLocalVariableGeneric()
952 art::Thread* target = nullptr; in GetLocalVariableGeneric()
955 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in GetLocalVariableGeneric()
970 art::Thread* caller, in SetLocalVariableClosure()
973 art::Primitive::Type type, in SetLocalVariableClosure()
979 GetTypeError(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) override in GetTypeError()
980 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeError()
986 if (type_ == art::Primitive::kPrimNot) { in GetTypeError()
988 art::ObjPtr<art::mirror::Object> new_val(art::Thread::Current()->DecodeJObject(val_.l)); in GetTypeError()
1004 GetTypeErrorInner(art::ArtMethod* method, SlotType slot_type, const std::string& descriptor) in GetTypeErrorInner()
1005 REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetTypeErrorInner()
1021 } else if (type_ == art::Primitive::kPrimFloat || in GetTypeErrorInner()
1022 slot_type == SlotType { art::Primitive::kPrimFloat }) { in GetTypeErrorInner()
1049 art::ClassLinker* cl = art::Runtime::Current()->GetClassLinker(); in GetTypeErrorInner()
1050 art::ObjPtr<art::mirror::Class> set_class = caller_->DecodeJObject(val_.l)->GetClass(); in GetTypeErrorInner()
1051 art::ObjPtr<art::mirror::ClassLoader> loader = in GetTypeErrorInner()
1053 art::ObjPtr<art::mirror::Class> slot_class = in GetTypeErrorInner()
1066 jvmtiError Execute(art::ArtMethod* method, art::StackVisitor& visitor) in Execute()
1067 override REQUIRES_SHARED(art::Locks::mutator_lock_) { in Execute()
1069 case art::Primitive::kPrimNot: { in Execute()
1077 case art::Primitive::kPrimInt: in Execute()
1078 case art::Primitive::kPrimFloat: { in Execute()
1082 type_ == art::Primitive::kPrimFloat ? art::kFloatVReg in Execute()
1083 : art::kIntVReg)) { in Execute()
1088 case art::Primitive::kPrimDouble: in Execute()
1089 case art::Primitive::kPrimLong: { in Execute()
1090 auto lo_type = type_ == art::Primitive::kPrimLong ? art::kLongLoVReg : art::kDoubleLoVReg; in Execute()
1091 auto high_type = type_ == art::Primitive::kPrimLong ? art::kLongHiVReg : art::kDoubleHiVReg; in Execute()
1110 art::Thread* caller_;
1111 art::Primitive::Type type_;
1120 art::Primitive::Type type, in SetLocalVariableGeneric()
1128 art::Thread* self = art::Thread::Current(); in SetLocalVariableGeneric()
1129 art::ScopedObjectAccess soa(self); in SetLocalVariableGeneric()
1130 art::Locks::thread_list_lock_->ExclusiveLock(self); in SetLocalVariableGeneric()
1131 art::Thread* target = nullptr; in SetLocalVariableGeneric()
1134 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in SetLocalVariableGeneric()
1146 class GetLocalInstanceClosure : public art::Closure {
1153 void Run(art::Thread* self) override REQUIRES(art::Locks::mutator_lock_) { in Run()
1154 art::ScopedAssertNoThreadSuspension sants("GetLocalInstanceClosure::Run"); in Run()
1155 art::Locks::mutator_lock_->AssertSharedHeld(art::Thread::Current()); in Run()
1156 std::unique_ptr<art::Context> context(art::Context::Create()); in Run()
1165 val_ = art::GcRoot<art::mirror::Object>(visitor.GetThisObject()); in Run()
1168 jvmtiError GetResult(jobject* data_out) REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetResult()
1172 : art::Thread::Current()->GetJniEnv()->AddLocalReference<jobject>(val_.Read()); in GetResult()
1180 art::GcRoot<art::mirror::Object> val_;
1190 art::Thread* self = art::Thread::Current(); in GetLocalInstance()
1191 art::ScopedObjectAccess soa(self); in GetLocalInstance()
1192 art::Locks::thread_list_lock_->ExclusiveLock(self); in GetLocalInstance()
1193 art::Thread* target = nullptr; in GetLocalInstance()
1196 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in GetLocalInstance()
1199 art::ScopedAssertNoThreadSuspension sants("Performing GetLocalInstance"); in GetLocalInstance()
1204 if (!target->RequestSynchronousCheckpoint(&c, art::ThreadState::kRunnable)) { in GetLocalInstance()
1212 fn(jint, art::Primitive::kPrimInt, i) \
1213 fn(jlong, art::Primitive::kPrimLong, j) \
1214 fn(jfloat, art::Primitive::kPrimFloat, f) \
1215 fn(jdouble, art::Primitive::kPrimDouble, d) \
1216 fn(jobject, art::Primitive::kPrimNot, l)
1222 template<typename T> art::Primitive::Type GetJNIType();
1225 template<> art::Primitive::Type GetJNIType<type>() { \
1254 art::Primitive::Type type = impl::GetJNIType<T>(); in SetLocalVariable()
1269 art::Primitive::Type type = impl::GetJNIType<T>(); in GetLocalVariable()