comparison src/share/vm/prims/unsafe.cpp @ 10399:609aad72004a

8014246: remove assert to catch access to object headers in index_oop_from_field_offset_long Reviewed-by: twisti, jrose
author anoll
date Thu, 06 Jun 2013 09:29:38 -0700
parents 6b388e7d4905
children f2110083203d
comparison
equal deleted inserted replaced
10398:2cb5d5f6d5e5 10399:609aad72004a
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;