mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
8263721: Unify oop casting
Reviewed-by: kbarrett, coleenp
This commit is contained in:
parent
329697b02e
commit
a79f095697
90 changed files with 248 additions and 249 deletions
|
@ -549,7 +549,7 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len)
|
|||
const size_t beg_ofs = region_offset(addr);
|
||||
_region_data[beg_region].add_live_obj(RegionSize - beg_ofs);
|
||||
|
||||
Klass* klass = ((oop)addr)->klass();
|
||||
Klass* klass = cast_to_oop(addr)->klass();
|
||||
// Middle regions--completely spanned by this object.
|
||||
for (size_t region = beg_region + 1; region < end_region; ++region) {
|
||||
_region_data[region].set_partial_obj_size(RegionSize);
|
||||
|
@ -817,7 +817,7 @@ HeapWord* ParallelCompactData::calc_new_pointer(HeapWord* addr, ParCompactionMan
|
|||
const size_t block_offset = addr_to_block_ptr(addr)->offset();
|
||||
|
||||
const ParMarkBitMap* bitmap = PSParallelCompact::mark_bitmap();
|
||||
const size_t live = bitmap->live_words_in_range(cm, search_start, oop(addr));
|
||||
const size_t live = bitmap->live_words_in_range(cm, search_start, cast_to_oop(addr));
|
||||
result += block_offset + live;
|
||||
DEBUG_ONLY(PSParallelCompact::check_new_location(addr, result));
|
||||
return result;
|
||||
|
@ -2674,7 +2674,7 @@ void PSParallelCompact::verify_complete(SpaceId space_id) {
|
|||
|
||||
inline void UpdateOnlyClosure::do_addr(HeapWord* addr) {
|
||||
_start_array->allocate_block(addr);
|
||||
compaction_manager()->update_contents(oop(addr));
|
||||
compaction_manager()->update_contents(cast_to_oop(addr));
|
||||
}
|
||||
|
||||
// Update interior oops in the ranges of regions [beg_region, end_region).
|
||||
|
@ -2777,8 +2777,8 @@ void PSParallelCompact::update_deferred_objects(ParCompactionManager* cm,
|
|||
if (start_array != NULL) {
|
||||
start_array->allocate_block(addr);
|
||||
}
|
||||
cm->update_contents(oop(addr));
|
||||
assert(oopDesc::is_oop_or_null(oop(addr)), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(addr)));
|
||||
cm->update_contents(cast_to_oop(addr));
|
||||
assert(oopDesc::is_oop_or_null(cast_to_oop(addr)), "Expected an oop or NULL at " PTR_FORMAT, p2i(cast_to_oop(addr)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3298,7 +3298,7 @@ MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) {
|
|||
Copy::aligned_conjoint_words(source(), copy_destination(), words);
|
||||
}
|
||||
|
||||
oop moved_oop = (oop) copy_destination();
|
||||
oop moved_oop = cast_to_oop(copy_destination());
|
||||
compaction_manager()->update_contents(moved_oop);
|
||||
assert(oopDesc::is_oop_or_null(moved_oop), "Expected an oop or NULL at " PTR_FORMAT, p2i(moved_oop));
|
||||
|
||||
|
@ -3356,7 +3356,7 @@ FillClosure::do_addr(HeapWord* addr, size_t size) {
|
|||
HeapWord* const end = addr + size;
|
||||
do {
|
||||
_start_array->allocate_block(addr);
|
||||
addr += oop(addr)->size();
|
||||
addr += cast_to_oop(addr)->size();
|
||||
} while (addr < end);
|
||||
return ParMarkBitMap::incomplete;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue