summaryrefslogtreecommitdiff
path: root/runtime/mirror/executable-inl.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-09-18 06:14:50 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-09-18 06:14:50 +0000
commit4ac0e1571e015a01d75091c3daef065f9624ad77 (patch)
tree4d13edeab88bd6fd724388c48385b0c3cca4f3a8 /runtime/mirror/executable-inl.h
parent5a2301d897294ff4ee6de71f459dc2566dc3fa1a (diff)
Revert "Revert "Basic structural redefinition support""
This reverts commit 5a2301d897294ff4ee6de71f459dc2566dc3fa1a. Bug: 134162467 Reason for revert: Relanding as unclear if issue is due to topic. Change-Id: Ib1d1cf2e9132e30c9649b760ae9ae2d8ceacf843
Diffstat (limited to 'runtime/mirror/executable-inl.h')
-rw-r--r--runtime/mirror/executable-inl.h12
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