From 3068d582eff4552ff260d7966fcbdc93e17d0207 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 28 May 2019 16:39:29 +0100 Subject: Clean up creating handles from `this`. Make these member functions static and take an additional parameter `Handle<.> h_this`. Callers mostly already have a Handle<> to pass, so we avoid an extra StackHandleScope. This pattern was already used for some functions. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --interpreter Change-Id: I4f4478b0526bcb2f3c23305d3b3cc4a65fff9ff5 --- runtime/mirror/class_ext.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/mirror/class_ext.cc') diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index d12f340690..4c6cb4d840 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -52,10 +52,9 @@ void ClassExt::SetObsoleteArrays(ObjPtr methods, // We really need to be careful how we update this. If we ever in the future make it so that // these arrays are written into without all threads being suspended we have a race condition! This // race could cause obsolete methods to be missed. -bool ClassExt::ExtendObsoleteArrays(Thread* self, uint32_t increase) { +bool ClassExt::ExtendObsoleteArrays(Handle h_this, Thread* self, uint32_t increase) { // TODO It would be good to check that we have locked the class associated with this ClassExt. - StackHandleScope<5> hs(self); - Handle h_this(hs.NewHandle(this)); + StackHandleScope<4> hs(self); Handle old_methods(hs.NewHandle(h_this->GetObsoleteMethods())); Handle> old_dex_caches(hs.NewHandle(h_this->GetObsoleteDexCaches())); ClassLinker* cl = Runtime::Current()->GetClassLinker(); -- cgit v1.2.3-59-g8ed1b