summaryrefslogtreecommitdiff
path: root/runtime/mirror/executable-inl.h
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2019-09-24 14:36:27 -0700
committer Treehugger Robot <treehugger-gerrit@google.com> 2019-09-27 17:08:33 +0000
commitc18eba327c4e207ff7b38817f097ee2220b44b39 (patch)
tree1978e64abd3e9fd3df99179f4a2110a724a9565f /runtime/mirror/executable-inl.h
parent371390f775c90b8b3df11a9890585598a2a39da9 (diff)
Consolidate updating of reflective Field/Method references
Previously we used several different visitors to update Field & Method references for structural redefinition. We also did not visit or update JVMTI based references. This consolidates all the visitors to a single Runtime::VisitReflectiveTargets function with a single ReflectiveTargetVisitor type. This simplifies the code around structural redefinition and ensures that the reflective value holders are in charge of the actual replacement. Support was also added for walking internal openjdkjvmti references for things like field-read/modification events. Test: ./test.py --host Bug: 134162467 Change-Id: Ic5fc1db7db0a30f947a1a67259dc024e149ebd57
Diffstat (limited to 'runtime/mirror/executable-inl.h')
-rw-r--r--runtime/mirror/executable-inl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/mirror/executable-inl.h b/runtime/mirror/executable-inl.h
index ce35d6ef20..f2d684a3d5 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 "reflective_value_visitor.h"
#include "verify_object.h"
namespace art {
@@ -37,10 +38,11 @@ inline ObjPtr<mirror::Class> Executable::GetDeclaringClass() {
return GetFieldObject<mirror::Class>(DeclaringClassOffset());
}
-template<typename Visitor, VerifyObjectFlags kVerifiyFlags>
-inline void Executable::VisitTarget(Visitor&& v) {
+template<VerifyObjectFlags kVerifiyFlags>
+inline void Executable::VisitTarget(ReflectiveValueVisitor* v) {
+ HeapReflectiveSourceInfo hrsi(kSourceJavaLangReflectExecutable, this);
ArtMethod* orig = GetArtMethod<kVerifiyFlags>();
- ArtMethod* new_target = v(orig);
+ ArtMethod* new_target = v->VisitMethod(orig, hrsi);
if (orig != new_target) {
SetArtMethod(new_target);
SetDexMethodIndex(new_target->GetDexMethodIndex());