8324722: Serial: Inline block_is_obj of subclasses of Generation

Reviewed-by: stefank, tschatzl
This commit is contained in:
Albert Mingkun Yang 2024-01-26 13:03:59 +00:00
parent 32ddcf504c
commit 885e9b76d6
5 changed files with 6 additions and 21 deletions

View File

@ -723,12 +723,6 @@ void DefNewGeneration::adjust_desired_tenuring_threshold() {
age_table()->print_age_table(_tenuring_threshold);
}
bool DefNewGeneration::block_is_obj(const HeapWord* addr) const {
return eden()->is_in(addr)
|| from()->is_in(addr)
|| to() ->is_in(addr);
}
void DefNewGeneration::collect(bool full,
bool clear_all_soft_refs,
size_t size,

View File

@ -257,10 +257,6 @@ class DefNewGeneration: public Generation {
// at some additional cost.
bool collection_attempt_is_safe();
// Requires "addr" to be the start of a block, and returns "TRUE" iff
// the block is an object.
bool block_is_obj(const HeapWord* addr) const;
virtual void collect(bool full,
bool clear_all_soft_refs,
size_t size,

View File

@ -924,12 +924,15 @@ HeapWord* SerialHeap::block_start(const void* addr) const {
bool SerialHeap::block_is_obj(const HeapWord* addr) const {
assert(is_in_reserved(addr), "block_is_obj of address outside of heap");
assert(block_start(addr) == addr, "addr must be a block start");
if (_young_gen->is_in_reserved(addr)) {
return _young_gen->block_is_obj(addr);
return _young_gen->eden()->is_in(addr)
|| _young_gen->from()->is_in(addr)
|| _young_gen->to() ->is_in(addr);
}
assert(_old_gen->is_in_reserved(addr), "Some generation should contain the address");
return _old_gen->block_is_obj(addr);
assert(_old_gen->is_in_reserved(addr), "must be in old-gen");
return addr < _old_gen->space()->top();
}
size_t SerialHeap::tlab_capacity(Thread* thr) const {

View File

@ -129,10 +129,6 @@ class TenuredGeneration: public Generation {
bool no_allocs_since_save_marks();
// Requires "addr" to be the start of a block, and returns "TRUE" iff
// the block is an object.
inline bool block_is_obj(const HeapWord* addr) const;
virtual void collect(bool full,
bool clear_all_soft_refs,
size_t size,

View File

@ -61,10 +61,6 @@ HeapWord* TenuredGeneration::par_allocate(size_t word_size,
return _the_space->par_allocate(word_size);
}
bool TenuredGeneration::block_is_obj(const HeapWord* addr) const {
return addr < _the_space->top();
}
template <typename OopClosureType>
void TenuredGeneration::oop_since_save_marks_iterate(OopClosureType* blk) {
_the_space->oop_since_save_marks_iterate(blk);