< prev index next >

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

Print this page




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






  57 #endif // SHARE_OOPS_OBJARRAYOOP_INLINE_HPP


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