mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8237637: Remove dubious type conversions from oop
Reviewed-by: kbarrett, dholmes, mdoerr
This commit is contained in:
parent
b223907794
commit
46423b0f70
83 changed files with 163 additions and 215 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue