diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index ef22e4a97c5..f3efcac4a27 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -167,11 +167,11 @@ jint Unsafe_invocation_key_to_method_slot(jint key) { #define GET_FIELD(obj, offset, type_name, v) \ oop p = JNIHandles::resolve(obj); \ - type_name v = *(type_name*)index_oop_from_field_offset_long(p, offset) + type_name v = *(volatile type_name*)index_oop_from_field_offset_long(p, offset) #define SET_FIELD(obj, offset, type_name, x) \ oop p = JNIHandles::resolve(obj); \ - *(type_name*)index_oop_from_field_offset_long(p, offset) = truncate_##type_name(x) + *(volatile type_name*)index_oop_from_field_offset_long(p, offset) = truncate_##type_name(x) #define GET_FIELD_VOLATILE(obj, offset, type_name, v) \ oop p = JNIHandles::resolve(obj); \