Fix moving GC bugs in entrypoints
In FindMethodFromCode, there was missing handles for objects used
after a suspend point (ResolveType).
For check_jni, JniMethodEndWithReferenceHandleResult did not
handlarize the return value when calling CheckReferenceResult.
For CheckReferenceResult, the argument was not in a handle.
Bug: 31458474
Change-Id: I06617fc63f1fb63d7c13ad4245223a8c54fa4b98
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index 3043c83..3c6f807 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -1961,8 +1961,12 @@
// Run the visitor and update sp.
BuildGenericJniFrameVisitor visitor(self, called->IsStatic(), shorty, shorty_len, &sp);
- visitor.VisitArguments();
- visitor.FinalizeHandleScope(self);
+ {
+ ScopedAssertNoThreadSuspension sants(__FUNCTION__);
+ visitor.VisitArguments();
+ // FinalizeHandleScope pushes the handle scope on the thread.
+ visitor.FinalizeHandleScope(self);
+ }
// Fix up managed-stack things in Thread.
self->SetTopOfStack(sp);