summaryrefslogtreecommitdiff
path: root/src/object.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.h')
-rw-r--r--src/object.h11
1 files changed, 11 insertions, 0 deletions
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<T>* src, int src_pos,
@@ -2262,6 +2266,13 @@ void ObjectArray<T>::SetWithoutChecks(int32_t i, T* object) {
}
template<class T>
+void ObjectArray<T>::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<class T>
T* ObjectArray<T>::GetWithoutChecks(int32_t i) const {
DCHECK(IsValidIndex(i));
MemberOffset data_offset(DataOffset(sizeof(Object*)).Int32Value() + i * sizeof(Object*));