8237637: Remove dubious type conversions from oop

Reviewed-by: kbarrett, dholmes, mdoerr
This commit is contained in:
Stefan Karlsson 2020-01-24 09:27:07 +01:00
parent b223907794
commit 46423b0f70
83 changed files with 163 additions and 215 deletions

View file

@ -111,7 +111,7 @@ static inline void assert_field_offset_sane(oop p, jlong field_offset) {
if (p != NULL) {
assert(byte_offset >= 0 && byte_offset <= (jlong)MAX_OBJECT_SIZE, "sane offset");
if (byte_offset == (jint)byte_offset) {
void* ptr_plus_disp = (address)p + byte_offset;
void* ptr_plus_disp = cast_from_oop<address>(p) + byte_offset;
assert(p->field_addr_raw((jint)byte_offset) == ptr_plus_disp,
"raw [ptr+disp] must be consistent with oop::field_addr_raw");
}
@ -130,9 +130,9 @@ static inline void* index_oop_from_field_offset_long(oop p, jlong field_offset)
}
if (sizeof(char*) == sizeof(jint)) { // (this constant folds!)
return (address)p + (jint) byte_offset;
return cast_from_oop<address>(p) + (jint) byte_offset;
} else {
return (address)p + byte_offset;
return cast_from_oop<address>(p) + byte_offset;
}
}