< prev index next >

src/hotspot/share/oops/objArrayOop.inline.hpp

Print this page

34 
35 inline HeapWord* objArrayOopDesc::base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
36 
37 template <class T> T* objArrayOopDesc::obj_at_addr(int index) const {
38   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
39   return &((T*)base())[index];
40 }
41 
42 inline oop objArrayOopDesc::obj_at(int index) const {
43   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
44   ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
45   return HeapAccess<IS_ARRAY>::oop_load_at(as_oop(), offset);
46 }
47 
48 inline void objArrayOopDesc::obj_at_put(int index, oop value) {
49   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
50   ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
51   HeapAccess<IS_ARRAY>::oop_store_at(as_oop(), offset, value);
52 }
53 






54 #endif // SHARE_OOPS_OBJARRAYOOP_INLINE_HPP

34 
35 inline HeapWord* objArrayOopDesc::base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
36 
37 template <class T> T* objArrayOopDesc::obj_at_addr(int index) const {
38   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
39   return &((T*)base())[index];
40 }
41 
42 inline oop objArrayOopDesc::obj_at(int index) const {
43   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
44   ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
45   return HeapAccess<IS_ARRAY>::oop_load_at(as_oop(), offset);
46 }
47 
48 inline void objArrayOopDesc::obj_at_put(int index, oop value) {
49   assert(is_within_bounds(index), "index %d out of bounds %d", index, length());
50   ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
51   HeapAccess<IS_ARRAY>::oop_store_at(as_oop(), offset, value);
52 }
53 
54 template <DecoratorSet ds>
55 inline void objArrayOopDesc::obj_at_put_access(int index, oop value) {
56   ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
57   HeapAccess<IS_ARRAY | ds>::oop_store_at(as_oop(), offset, value);
58 }
59 
60 #endif // SHARE_OOPS_OBJARRAYOOP_INLINE_HPP
< prev index next >