Mercurial > hg > graal-compiler
comparison src/share/vm/prims/unsafe.cpp @ 12356:359f7e70ae7f
Reduce HotSpot diff and fix previous merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 15:41:33 +0200 |
parents | cefad50507d8 |
children | 39308acea2f7 |
comparison
equal
deleted
inserted
replaced
12355:cefad50507d8 | 12356:359f7e70ae7f |
---|---|
167 #define SET_FIELD_VOLATILE(obj, offset, type_name, x) \ | 167 #define SET_FIELD_VOLATILE(obj, offset, type_name, x) \ |
168 oop p = JNIHandles::resolve(obj); \ | 168 oop p = JNIHandles::resolve(obj); \ |
169 OrderAccess::release_store_fence((volatile type_name*)index_oop_from_field_offset_long(p, offset), x); | 169 OrderAccess::release_store_fence((volatile type_name*)index_oop_from_field_offset_long(p, offset), x); |
170 | 170 |
171 // Macros for oops that check UseCompressedOops | 171 // Macros for oops that check UseCompressedOops |
172 #ifndef GRAAL | 172 |
173 #define GET_OOP_FIELD(obj, offset, v) \ | 173 #define GET_OOP_FIELD(obj, offset, v) \ |
174 oop p = JNIHandles::resolve(obj); \ | 174 oop p = JNIHandles::resolve(obj); \ |
175 oop v; \ | 175 oop v; \ |
176 if (UseCompressedOops) { \ | 176 /* Uncompression is not performed to unsafeAccess with null object. \ |
177 * This concerns accesses to the metaspace such as the classMirrorOffset in Graal which is not compressed.*/ \ | |
178 if (UseCompressedOops GRAAL_ONLY(&& p != NULL && offset >= oopDesc::header_size())) { \ | |
177 narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); \ | 179 narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); \ |
178 v = oopDesc::decode_heap_oop(n); \ | 180 v = oopDesc::decode_heap_oop(n); \ |
179 } else { \ | 181 } else { \ |
180 v = *(oop*)index_oop_from_field_offset_long(p, offset); \ | 182 v = *(oop*)index_oop_from_field_offset_long(p, offset); \ |
181 } | 183 } |
182 #else | 184 |
183 #define GET_OOP_FIELD(obj, offset, v) \ | |
184 oop p = JNIHandles::resolve(obj); \ | |
185 oop v; \ | |
186 /* Uncompression is not performed to unsafeAccess with null object. | |
187 * This concerns accesses to the metaspace such as the classMirrorOffset which is not compressed.*/ \ | |
188 if (UseCompressedOops && p != NULL && offset >= oopDesc::header_size()) { \ | |
189 narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); \ | |
190 v = oopDesc::decode_heap_oop(n); \ | |
191 } else { \ | |
192 v = *(oop*)index_oop_from_field_offset_long(p, offset); \ | |
193 } | |
194 #endif | |
195 | 185 |
196 // Get/SetObject must be special-cased, since it works with handles. | 186 // Get/SetObject must be special-cased, since it works with handles. |
197 | 187 |
198 // The xxx140 variants for backward compatibility do not allow a full-width offset. | 188 // The xxx140 variants for backward compatibility do not allow a full-width offset. |
199 UNSAFE_ENTRY(jobject, Unsafe_GetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) | 189 UNSAFE_ENTRY(jobject, Unsafe_GetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) |