diff options
Diffstat (limited to 'runtime/mirror/executable-inl.h')
-rw-r--r-- | runtime/mirror/executable-inl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/mirror/executable-inl.h b/runtime/mirror/executable-inl.h index 6d4b46a31d..ce35d6ef20 100644 --- a/runtime/mirror/executable-inl.h +++ b/runtime/mirror/executable-inl.h @@ -20,6 +20,7 @@ #include "executable.h" #include "object-inl.h" +#include "verify_object.h" namespace art { namespace mirror { @@ -36,6 +37,17 @@ inline ObjPtr<mirror::Class> Executable::GetDeclaringClass() { return GetFieldObject<mirror::Class>(DeclaringClassOffset()); } +template<typename Visitor, VerifyObjectFlags kVerifiyFlags> +inline void Executable::VisitTarget(Visitor&& v) { + ArtMethod* orig = GetArtMethod<kVerifiyFlags>(); + ArtMethod* new_target = v(orig); + if (orig != new_target) { + SetArtMethod(new_target); + SetDexMethodIndex(new_target->GetDexMethodIndex()); + SetDeclaringClass(new_target->GetDeclaringClass()); + } +} + } // namespace mirror } // namespace art |