From d34b73b4ac478462acc03c4cd42ae7568c832eb8 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 5 May 2020 10:07:59 +0100 Subject: Clean up internal stack trace construction. Simplify the code by ignoring active transactions. Writing to fields of a newly allocated object does not need to be recorded as aborting the transaction removes all references to the new object and it's unnecessary to roll back writes to unreachable object's fields. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Change-Id: Ia91d3274398b0ca0f5b0040dcf323921d915b657 --- runtime/mirror/array-inl.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'runtime/mirror/array-inl.h') diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h index 34925f52e2..b75aa5d011 100644 --- a/runtime/mirror/array-inl.h +++ b/runtime/mirror/array-inl.h @@ -22,6 +22,7 @@ #include #include "base/bit_utils.h" +#include "base/casts.h" #include "class.h" #include "obj_ptr-inl.h" #include "runtime.h" @@ -251,23 +252,22 @@ inline T PointerArray::GetElementPtrSize(uint32_t idx, PointerSize ptr_size) { return GetElementPtrSize(idx); } -template +template inline void PointerArray::SetElementPtrSize(uint32_t idx, uint64_t element, PointerSize ptr_size) { if (ptr_size == PointerSize::k64) { (kUnchecked ? ObjPtr::DownCast(ObjPtr(this)) : AsLongArray())-> - SetWithoutChecks(idx, element); + SetWithoutChecks(idx, element); } else { - DCHECK_LE(element, static_cast(0xFFFFFFFFu)); + uint32_t element32 = dchecked_integral_cast(element); (kUnchecked ? ObjPtr::DownCast(ObjPtr(this)) : AsIntArray()) - ->SetWithoutChecks(idx, static_cast(element)); + ->SetWithoutChecks(idx, element32); } } -template +template inline void PointerArray::SetElementPtrSize(uint32_t idx, T* element, PointerSize ptr_size) { - SetElementPtrSize(idx, - reinterpret_cast(element), - ptr_size); + SetElementPtrSize( + idx, reinterpret_cast(element), ptr_size); } template @@ -278,7 +278,9 @@ inline void PointerArray::Fixup(ObjPtr dest, void* ptr = GetElementPtrSize(i, pointer_size); void* new_ptr = visitor(ptr); if (ptr != new_ptr) { - dest->SetElementPtrSize(i, new_ptr, pointer_size); + dest->SetElementPtrSize(i, new_ptr, pointer_size); } } } -- cgit v1.2.3-59-g8ed1b