From e35517ad40e0713df8420aeb5d3540f146a59f62 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 30 Oct 2012 18:49:55 -0700 Subject: Remove disable card marks, fix SetPatchLocation. Should slightly improve performance. Added a no thread suspension allowed in patch oat code and methods. Added a new function to class linker, GetOatCodeFor which takes in a method reference instead of pointer. This fixes the issue where pruned methods were getting re-loaded during code and method patching. Change-Id: I676bb88cb021b6d2e0db00adbcf1f2f04f82b72a --- src/object.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/object.h') diff --git a/src/object.h b/src/object.h index 61fa3357dd..87f132e458 100644 --- a/src/object.h +++ b/src/object.h @@ -1142,6 +1142,10 @@ class MANAGED ObjectArray : public Array { // circumstances, such as during boot image writing void SetWithoutChecks(int32_t i, T* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + // Set element without bound and element type checks, to be used in limited circumstances, such + // as during boot image writing. Does not do write barrier. + void SetPtrWithoutChecks(int32_t i, T* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + T* GetWithoutChecks(int32_t i) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); static void Copy(const ObjectArray* src, int src_pos, @@ -2261,6 +2265,13 @@ void ObjectArray::SetWithoutChecks(int32_t i, T* object) { SetFieldObject(data_offset, object, false); } +template +void ObjectArray::SetPtrWithoutChecks(int32_t i, T* object) { + DCHECK(IsValidIndex(i)); + MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*)); + SetFieldPtr(data_offset, object, false); +} + template T* ObjectArray::GetWithoutChecks(int32_t i) const { DCHECK(IsValidIndex(i)); -- cgit v1.2.3-59-g8ed1b