hotspot/src/share/vm/prims/unsafe.cpp
changeset 14127 16ba0a8dfde2
parent 13952 e3cf184080bc
child 14488 ab48109f7d1b
equal deleted inserted replaced
14126:afb8a3a86f1f 14127:16ba0a8dfde2
   122     if (byte_offset == (jint)byte_offset) {
   122     if (byte_offset == (jint)byte_offset) {
   123       void* ptr_plus_disp = (address)p + byte_offset;
   123       void* ptr_plus_disp = (address)p + byte_offset;
   124       assert((void*)p->obj_field_addr<oop>((jint)byte_offset) == ptr_plus_disp,
   124       assert((void*)p->obj_field_addr<oop>((jint)byte_offset) == ptr_plus_disp,
   125              "raw [ptr+disp] must be consistent with oop::field_base");
   125              "raw [ptr+disp] must be consistent with oop::field_base");
   126     }
   126     }
       
   127     jlong p_size = HeapWordSize * (jlong)(p->size());
       
   128     assert(byte_offset < p_size, err_msg("Unsafe access: offset " INT64_FORMAT " > object's size " INT64_FORMAT, byte_offset, p_size));
   127   }
   129   }
   128 #endif
   130 #endif
   129   if (sizeof(char*) == sizeof(jint))    // (this constant folds!)
   131   if (sizeof(char*) == sizeof(jint))    // (this constant folds!)
   130     return (address)p + (jint) byte_offset;
   132     return (address)p + (jint) byte_offset;
   131   else
   133   else