< prev index next >

src/hotspot/share/oops/typeArrayKlass.cpp

Print this page
*** 168,15 ***
    size_t src_offset = arrayOopDesc::base_offset_in_bytes(element_type()) + ((size_t)src_pos << l2es);
    size_t dst_offset = arrayOopDesc::base_offset_in_bytes(element_type()) + ((size_t)dst_pos << l2es);
    ArrayAccess<ARRAYCOPY_ATOMIC>::arraycopy<void>(s, src_offset, d, dst_offset, (size_t)length << l2es);
  }
  
! size_t TypeArrayKlass::oop_size(oop obj) const {
    // In this assert, we cannot safely access the Klass* with compact headers.
    assert(UseCompactObjectHeaders || obj->is_typeArray(),"must be a type array");
    typeArrayOop t = typeArrayOop(obj);
!   return t->object_size(this);
  }
  
  void TypeArrayKlass::initialize(TRAPS) {
    // Nothing to do. Having this function is handy since objArrayKlasses can be
    // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize
--- 168,16 ---
    size_t src_offset = arrayOopDesc::base_offset_in_bytes(element_type()) + ((size_t)src_pos << l2es);
    size_t dst_offset = arrayOopDesc::base_offset_in_bytes(element_type()) + ((size_t)dst_pos << l2es);
    ArrayAccess<ARRAYCOPY_ATOMIC>::arraycopy<void>(s, src_offset, d, dst_offset, (size_t)length << l2es);
  }
  
! size_t TypeArrayKlass::oop_size(oop obj, markWord mark) const {
    // In this assert, we cannot safely access the Klass* with compact headers.
    assert(UseCompactObjectHeaders || obj->is_typeArray(),"must be a type array");
    typeArrayOop t = typeArrayOop(obj);
!   int length = LP64_ONLY(UseCompactObjectHeaders ? mark.array_length() :) t->length();
+   return t->object_size(this, length);
  }
  
  void TypeArrayKlass::initialize(TRAPS) {
    // Nothing to do. Having this function is handy since objArrayKlasses can be
    // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize
< prev index next >