diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp index c6fd8449aed..f69ad18a99a 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp @@ -131,13 +131,9 @@ static inline void assert_field_offset_sane(oop p, jlong field_offset) { static inline void* index_oop_from_field_offset_long(oop p, jlong field_offset) { assert_field_offset_sane(p, field_offset); - jlong byte_offset = field_offset_to_byte_offset(field_offset); - - if (sizeof(char*) == sizeof(jint)) { // (this constant folds!) - return cast_from_oop
(p) + (jint) byte_offset; - } else { - return cast_from_oop(p) + byte_offset; - } + uintptr_t base_address = cast_from_oop