comparison src/share/vm/prims/unsafe.cpp @ 2316:d411927672ed

7012072: CompileTheWorld causes incorrect class initialization Reviewed-by: kvn, twisti
author never
date Wed, 23 Feb 2011 19:09:16 -0800
parents 3582bf76420e
children c7f3d0b4570f
comparison
equal deleted inserted replaced
2315:ba5d119730dd 2316:d411927672ed
108 return key; 108 return key;
109 } 109 }
110 110
111 inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) { 111 inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) {
112 jlong byte_offset = field_offset_to_byte_offset(field_offset); 112 jlong byte_offset = field_offset_to_byte_offset(field_offset);
113 // Don't allow unsafe to be used to read or write the header word of oops
114 assert(p == NULL || field_offset >= oopDesc::header_size(), "offset must be outside of header");
113 #ifdef ASSERT 115 #ifdef ASSERT
114 if (p != NULL) { 116 if (p != NULL) {
115 assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset"); 117 assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset");
116 if (byte_offset == (jint)byte_offset) { 118 if (byte_offset == (jint)byte_offset) {
117 void* ptr_plus_disp = (address)p + byte_offset; 119 void* ptr_plus_disp = (address)p + byte_offset;