From a01de59eef990c07df9815376cd3c675e3acd481 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 15 Nov 2016 10:43:06 -0800 Subject: Infrastructure for obsolete methods This adds some of the structures and functions needed to eventually support obsolete methods. Specifically this adds the code to create and iterate through the obsolete dex-cache maps of classes and re-organizes the redefinition code to be more sensible and extensible. Bug: 32369913 Test: ./test/run-test --host 902 Test: mma -j40 test-art-host Change-Id: I93d60fa66e7512e8b059cdf42af8a56e93ef4bd7 --- runtime/mirror/array-inl.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'runtime/mirror/array-inl.h') diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h index b11dad8203..7d7c1d7cfd 100644 --- a/runtime/mirror/array-inl.h +++ b/runtime/mirror/array-inl.h @@ -424,6 +424,29 @@ inline void PointerArray::Fixup(mirror::PointerArray* dest, } } +template +void PointerArray::Memcpy(int32_t dst_pos, + ObjPtr src, + int32_t src_pos, + int32_t count, + PointerSize ptr_size) { + DCHECK(!Runtime::Current()->IsActiveTransaction()); + DCHECK(!src.IsNull()); + if (ptr_size == PointerSize::k64) { + LongArray* l_this = (kUnchecked ? down_cast(static_cast(this)) + : AsLongArray()); + LongArray* l_src = (kUnchecked ? down_cast(static_cast(src.Ptr())) + : src->AsLongArray()); + l_this->Memcpy(dst_pos, l_src, src_pos, count); + } else { + IntArray* i_this = (kUnchecked ? down_cast(static_cast(this)) + : AsIntArray()); + IntArray* i_src = (kUnchecked ? down_cast(static_cast(src.Ptr())) + : src->AsIntArray()); + i_this->Memcpy(dst_pos, i_src, src_pos, count); + } +} + template inline void PrimitiveArray::SetArrayClass(ObjPtr array_class) { CHECK(array_class_.IsNull()); -- cgit v1.2.3-59-g8ed1b