< prev index next > src/hotspot/share/oops/objArrayOop.hpp
Print this page
/*
! * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
/*
! * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
friend class psPromotionManager;
friend class CSetMarkWordClosure;
friend class Continuation;
template <typename T>
friend class RawOopWriter;
- friend class AOTMapLogger;
template <class T> T* obj_at_addr(int index) const;
template <class T>
static ptrdiff_t obj_at_offset(int index) {
// base is the address following the header.
HeapWord* base() const;
// Accessing
- oop obj_at(int index) const;
! void obj_at_put(int index, oop value);
!
! oop replace_if_null(int index, oop exchange_value);
!
! // Sizing
! size_t object_size() { return object_size(length()); }
! static size_t object_size(int length) {
! // This returns the object size in HeapWords.
- size_t asz = (size_t)length * heapOopSize;
- size_t size_words = heap_word_size(base_offset_in_bytes() + asz);
- size_t osz = align_object_size(size_words);
- assert(osz < max_jint, "no overflow");
- return osz;
- }
Klass* element_klass();
- public:
// Special iterators for an element index range.
template <typename OopClosureType>
void oop_iterate_elements_range(OopClosureType* blk, int start, int end);
};
// base is the address following the header.
HeapWord* base() const;
// Accessing
! // Accessing an object array element may have to allocate in case of a
! // flattened value. To access an object array element without allocating the
! // caller must first type check the oop and ensure that it is a refArray.
! [[deprecated("Type check and cast to refArrayOop to use the non-allocating obj_at")]]
! oop obj_at(int index) const = delete;
! oop obj_at(int index, TRAPS) const;
+ bool obj_at_is_null(int index) const;
! void obj_at_put(int index, oop value);
! void obj_at_put(int index, oop value, TRAPS);
Klass* element_klass();
// Special iterators for an element index range.
template <typename OopClosureType>
void oop_iterate_elements_range(OopClosureType* blk, int start, int end);
};
< prev index next >