-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,21 +280,21 @@ inline const char* ArtMethod::GetDeclaringClassDescriptor() { | |
if (UNLIKELY(dex_method_idx == DexFile::kDexNoIndex)) { | ||
return "<runtime method>"; | ||
} | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetMethodDeclaringClassDescriptor(dex_file->GetMethodId(dex_method_idx)); | ||
} | ||
|
||
inline const char* ArtMethod::GetShorty(uint32_t* out_length) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetMethodShorty(dex_file->GetMethodId(GetDexMethodIndex()), out_length); | ||
} | ||
|
||
inline const Signature ArtMethod::GetSignature() { | ||
uint32_t dex_method_idx = GetDexMethodIndex(); | ||
if (dex_method_idx != DexFile::kDexNoIndex) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetMethodSignature(dex_file->GetMethodId(dex_method_idx)); | ||
} | ||
|
@@ -304,7 +304,7 @@ inline const Signature ArtMethod::GetSignature() { | |
inline const char* ArtMethod::GetName() { | ||
uint32_t dex_method_idx = GetDexMethodIndex(); | ||
if (LIKELY(dex_method_idx != DexFile::kDexNoIndex)) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetMethodName(dex_file->GetMethodId(dex_method_idx)); | ||
} | ||
|
@@ -325,11 +325,14 @@ inline const char* ArtMethod::GetName() { | |
} | ||
|
||
inline const DexFile::CodeItem* ArtMethod::GetCodeItem() { | ||
if (UNLIKELY(IsXposedHookedMethod())) { | ||
return nullptr; | ||
} | ||
return GetDeclaringClass()->GetDexFile().GetCodeItem(GetCodeItemOffset()); | ||
} | ||
|
||
inline bool ArtMethod::IsResolvedTypeIdx(uint16_t type_idx, size_t ptr_size) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
return GetDexCacheResolvedType(type_idx, ptr_size) != nullptr; | ||
} | ||
|
||
|
@@ -342,13 +345,13 @@ inline int32_t ArtMethod::GetLineNumFromDexPC(uint32_t dex_pc) { | |
} | ||
|
||
inline const DexFile::ProtoId& ArtMethod::GetPrototype() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetMethodPrototype(dex_file->GetMethodId(GetDexMethodIndex())); | ||
} | ||
|
||
inline const DexFile::TypeList* ArtMethod::GetParameterTypeList() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
const DexFile::ProtoId& proto = dex_file->GetMethodPrototype( | ||
dex_file->GetMethodId(GetDexMethodIndex())); | ||
|
@@ -361,17 +364,17 @@ inline const char* ArtMethod::GetDeclaringClassSourceFile() { | |
} | ||
|
||
inline uint16_t ArtMethod::GetClassDefIndex() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
return GetDeclaringClass()->GetDexClassDefIndex(); | ||
} | ||
|
||
inline const DexFile::ClassDef& ArtMethod::GetClassDef() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
return GetDexFile()->GetClassDef(GetClassDefIndex()); | ||
} | ||
|
||
inline const char* ArtMethod::GetReturnTypeDescriptor() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
const DexFile::MethodId& method_id = dex_file->GetMethodId(GetDexMethodIndex()); | ||
const DexFile::ProtoId& proto_id = dex_file->GetMethodPrototype(method_id); | ||
|
@@ -380,27 +383,27 @@ inline const char* ArtMethod::GetReturnTypeDescriptor() { | |
} | ||
|
||
inline const char* ArtMethod::GetTypeDescriptorFromTypeIdx(uint16_t type_idx) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
return dex_file->GetTypeDescriptor(dex_file->GetTypeId(type_idx)); | ||
} | ||
|
||
inline mirror::ClassLoader* ArtMethod::GetClassLoader() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
return GetDeclaringClass()->GetClassLoader(); | ||
} | ||
|
||
inline mirror::DexCache* ArtMethod::GetDexCache() { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
return GetDeclaringClass()->GetDexCache(); | ||
} | ||
|
||
inline bool ArtMethod::IsProxyMethod() { | ||
return GetDeclaringClass()->IsProxyClass(); | ||
inline bool ArtMethod::IsProxyMethod(bool ignore_xposed) { | ||
return GetDeclaringClass()->IsProxyClass() || (!ignore_xposed && IsXposedHookedMethod()); | ||
} | ||
|
||
inline ArtMethod* ArtMethod::GetInterfaceMethodIfProxy(size_t pointer_size) { | ||
if (LIKELY(!IsProxyMethod())) { | ||
if (LIKELY(!IsProxyMethod(true))) { | ||
return this; | ||
} | ||
mirror::Class* klass = GetDeclaringClass(); | ||
|
@@ -425,7 +428,7 @@ inline void ArtMethod::SetDexCacheResolvedTypes(GcRoot<mirror::Class>* new_dex_c | |
} | ||
|
||
inline mirror::Class* ArtMethod::GetReturnType(bool resolve, size_t ptr_size) { | ||
DCHECK(!IsProxyMethod()); | ||
DCHECK(!IsProxyMethod(true)); | ||
const DexFile* dex_file = GetDexFile(); | ||
const DexFile::MethodId& method_id = dex_file->GetMethodId(GetDexMethodIndex()); | ||
const DexFile::ProtoId& proto_id = dex_file->GetMethodPrototype(method_id); | ||
|
@@ -455,6 +458,9 @@ void ArtMethod::VisitRoots(RootVisitorType& visitor, size_t pointer_size) { | |
Runtime::Current()->GetClassLinker()->FindMethodForProxy(klass, this)); | ||
interface_method->VisitRoots(visitor, pointer_size); | ||
} | ||
if (UNLIKELY(IsXposedHookedMethod())) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
GetXposedOriginalMethod()->VisitRoots(visitor, pointer_size); | ||
} | ||
visitor.VisitRoot(declaring_class_.AddressWithoutBarrier()); | ||
// We know we don't have profiling information if the class hasn't been verified. Note | ||
// that this check also ensures the IsNative call can be made, as IsNative expects a fully | ||
|
@@ -463,7 +469,7 @@ void ArtMethod::VisitRoots(RootVisitorType& visitor, size_t pointer_size) { | |
// Runtime methods and native methods use the same field as the profiling info for | ||
// storing their own data (jni entrypoint for native methods, and ImtConflictTable for | ||
// some runtime methods). | ||
if (!IsNative() && !IsRuntimeMethod()) { | ||
if (!IsNative() && !IsRuntimeMethod() && !IsXposedHookedMethod()) { | ||
This comment has been minimized.
Sorry, something went wrong.
abforce
Owner
|
||
ProfilingInfo* profiling_info = GetProfilingInfo(pointer_size); | ||
if (profiling_info != nullptr) { | ||
profiling_info->VisitRoots(visitor); | ||
|
VisitRoots
completely changed from M to N, so this method could be the source of the problem