diff options
author | 2019-09-24 14:36:50 -0700 | |
---|---|---|
committer | 2019-10-03 20:44:33 +0000 | |
commit | c84fc3a742b160ce51cbf01c2e5f971ccc0a2c6c (patch) | |
tree | 1380b353e0d3b5015c9d1ef29fd4c2534828f97b /runtime/entrypoints/entrypoint_utils-inl.h | |
parent | 8679fd5e938d7bed67d3ab67c55b7f4fb2cdd92a (diff) |
Walk internal ArtField/ArtMethod pointers
During structural class redefinition we sometimes need to update some
of the ArtMethod/ArtField pointers held by runtime frames. This adds
support for doing this through a StackReflectiveHandleScope similar to
the StackHandleScope used for holding object references. This also
updates various places where reflective-handles to ArtMethods and
ArtFields are needed, for example the JniIdManager, field Read/Write
operations and events, field resolution, and the old debugger.
Test: ./test.py --host
Bug: 134162467
Change-Id: I4ea73e85956a07735c6d7b125c5828a4233670bc
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils-inl.h')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils-inl.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index 255607937e..fe12a7c379 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -39,6 +39,7 @@ #include "mirror/object-inl.h" #include "mirror/throwable.h" #include "nth_caller_visitor.h" +#include "reflective_handle_scope-inl.h" #include "runtime.h" #include "stack_map.h" #include "thread.h" @@ -381,9 +382,11 @@ inline ArtField* FindFieldFromCode(uint32_t field_idx, return resolved_field; } else { StackHandleScope<1> hs(self); + StackArtFieldHandleScope<1> rhs(self); + ReflectiveHandle<ArtField> resolved_field_handle(rhs.NewHandle(resolved_field)); if (LIKELY(class_linker->EnsureInitialized(self, hs.NewHandle(fields_class), true, true))) { // Otherwise let's ensure the class is initialized before resolving the field. - return resolved_field; + return resolved_field_handle.Get(); } DCHECK(self->IsExceptionPending()); // Throw exception and unwind return nullptr; // Failure. |