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
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 1a91abe..2a7cbaa 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -1522,7 +1522,7 @@
ASSERT_TRUE(dex_cache != nullptr);
}
// Make a copy of the dex cache and change the name.
- dex_cache.Assign(dex_cache->Clone(soa.Self())->AsDexCache());
+ dex_cache.Assign(mirror::Object::Clone(dex_cache, soa.Self())->AsDexCache());
const uint16_t data[] = { 0x20AC, 0x20A1 };
Handle<mirror::String> location(hs.NewHandle(mirror::String::AllocFromUtf16(soa.Self(),
arraysize(data),