hotspot/src/share/vm/prims/unsafe.cpp
changeset 17881 464625606774
parent 17316 c1f00a6ecf59
child 18025 b7bcf7497f93
equal deleted inserted replaced
17880:17f3d10c297f 17881:464625606774
   113   return key;
   113   return key;
   114 }
   114 }
   115 
   115 
   116 inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) {
   116 inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) {
   117   jlong byte_offset = field_offset_to_byte_offset(field_offset);
   117   jlong byte_offset = field_offset_to_byte_offset(field_offset);
   118   // Don't allow unsafe to be used to read or write the header word of oops
       
   119   assert(p == NULL || field_offset >= oopDesc::header_size(), "offset must be outside of header");
       
   120 #ifdef ASSERT
   118 #ifdef ASSERT
   121   if (p != NULL) {
   119   if (p != NULL) {
   122     assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset");
   120     assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset");
   123     if (byte_offset == (jint)byte_offset) {
   121     if (byte_offset == (jint)byte_offset) {
   124       void* ptr_plus_disp = (address)p + byte_offset;
   122       void* ptr_plus_disp = (address)p + byte_offset;