10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
26 #define SHARE_VM_OOPS_OBJARRAYOOP_HPP
27
28 #include "gc/shared/specialized_oop_closures.hpp"
29 #include "oops/arrayOop.hpp"
30
31 // An objArrayOop is an array containing oops.
32 // Evaluating "String arg[10]" will create an objArrayOop.
33
34 class objArrayOopDesc : public arrayOopDesc {
35 friend class ObjArrayKlass;
36 friend class Runtime1;
37 friend class psPromotionManager;
38 friend class CSetMarkOopClosure;
39 friend class G1ParScanPartialArrayClosure;
40
41 template <class T> T* obj_at_addr(int index) const {
42 assert(is_within_bounds(index), "index out of bounds");
43 return &((T*)base())[index];
44 }
45
46 private:
47 // Give size of objArrayOop in HeapWords minus the header
48 static int array_size(int length) {
49 const uint OopsPerHeapWord = HeapWordSize/heapOopSize;
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP
26 #define SHARE_VM_OOPS_OBJARRAYOOP_HPP
27
28 #include "gc/shared/specialized_oop_closures.hpp"
29 #include "oops/arrayOop.hpp"
30 #include "utilities/align.hpp"
31
32 // An objArrayOop is an array containing oops.
33 // Evaluating "String arg[10]" will create an objArrayOop.
34
35 class objArrayOopDesc : public arrayOopDesc {
36 friend class ObjArrayKlass;
37 friend class Runtime1;
38 friend class psPromotionManager;
39 friend class CSetMarkOopClosure;
40 friend class G1ParScanPartialArrayClosure;
41
42 template <class T> T* obj_at_addr(int index) const {
43 assert(is_within_bounds(index), "index out of bounds");
44 return &((T*)base())[index];
45 }
46
47 private:
48 // Give size of objArrayOop in HeapWords minus the header
49 static int array_size(int length) {
50 const uint OopsPerHeapWord = HeapWordSize/heapOopSize;
|