8325248: Serial: Remove Generation::space_iterate
Reviewed-by: tschatzl
This commit is contained in:
parent
77ee7f0e24
commit
c3a632dca7
@ -673,12 +673,15 @@ void DefNewGeneration::object_iterate(ObjectClosure* blk) {
|
|||||||
from()->object_iterate(blk);
|
from()->object_iterate(blk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HeapWord* DefNewGeneration::block_start(const void* p) const {
|
||||||
void DefNewGeneration::space_iterate(SpaceClosure* blk,
|
if (eden()->is_in_reserved(p)) {
|
||||||
bool usedOnly) {
|
return eden()->block_start_const(p);
|
||||||
blk->do_space(eden());
|
}
|
||||||
blk->do_space(from());
|
if (from()->is_in_reserved(p)) {
|
||||||
blk->do_space(to());
|
return from()->block_start_const(p);
|
||||||
|
}
|
||||||
|
assert(to()->is_in_reserved(p), "inv");
|
||||||
|
return to()->block_start_const(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The last collection bailed out, we are running out of heap space,
|
// The last collection bailed out, we are running out of heap space,
|
||||||
|
@ -208,7 +208,7 @@ class DefNewGeneration: public Generation {
|
|||||||
// Iteration
|
// Iteration
|
||||||
void object_iterate(ObjectClosure* blk);
|
void object_iterate(ObjectClosure* blk);
|
||||||
|
|
||||||
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
|
HeapWord* block_start(const void* p) const;
|
||||||
|
|
||||||
// Allocation support
|
// Allocation support
|
||||||
virtual bool should_allocate(size_t word_size, bool is_tlab) {
|
virtual bool should_allocate(size_t word_size, bool is_tlab) {
|
||||||
|
@ -122,25 +122,3 @@ oop Generation::promote(oop obj, size_t obj_size) {
|
|||||||
|
|
||||||
return new_obj;
|
return new_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some of these are mediocre general implementations. Should be
|
|
||||||
// overridden to get better performance.
|
|
||||||
|
|
||||||
class GenerationBlockStartClosure : public SpaceClosure {
|
|
||||||
public:
|
|
||||||
const void* _p;
|
|
||||||
HeapWord* _start;
|
|
||||||
virtual void do_space(Space* s) {
|
|
||||||
if (_start == nullptr && s->is_in_reserved(_p)) {
|
|
||||||
_start = s->block_start(_p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GenerationBlockStartClosure(const void* p) { _p = p; _start = nullptr; }
|
|
||||||
};
|
|
||||||
|
|
||||||
HeapWord* Generation::block_start(const void* p) const {
|
|
||||||
GenerationBlockStartClosure blk(p);
|
|
||||||
// Cast away const
|
|
||||||
((Generation*)this)->space_iterate(&blk);
|
|
||||||
return blk._start;
|
|
||||||
}
|
|
||||||
|
@ -118,9 +118,6 @@ class Generation: public CHeapObj<mtGC> {
|
|||||||
return _reserved.contains(p);
|
return _reserved.contains(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iteration - do not use for time critical operations
|
|
||||||
virtual void space_iterate(SpaceClosure* blk, bool usedOnly = false) = 0;
|
|
||||||
|
|
||||||
// Returns "true" iff this generation should be used to allocate an
|
// Returns "true" iff this generation should be used to allocate an
|
||||||
// object of the given size. Young generations might
|
// object of the given size. Young generations might
|
||||||
// wish to exclude very large objects, for example, since, if allocated
|
// wish to exclude very large objects, for example, since, if allocated
|
||||||
@ -202,14 +199,6 @@ class Generation: public CHeapObj<mtGC> {
|
|||||||
virtual const char* name() const = 0;
|
virtual const char* name() const = 0;
|
||||||
virtual const char* short_name() const = 0;
|
virtual const char* short_name() const = 0;
|
||||||
|
|
||||||
// Block abstraction.
|
|
||||||
|
|
||||||
// Returns the address of the start of the "block" that contains the
|
|
||||||
// address "addr". We say "blocks" instead of "object" since some heaps
|
|
||||||
// may not pack objects densely; a chunk may either be an object or a
|
|
||||||
// non-object.
|
|
||||||
virtual HeapWord* block_start(const void* addr) const;
|
|
||||||
|
|
||||||
virtual void print() const;
|
virtual void print() const;
|
||||||
virtual void print_on(outputStream* st) const;
|
virtual void print_on(outputStream* st) const;
|
||||||
|
|
||||||
|
@ -263,9 +263,8 @@ void TenuredGeneration::compute_new_size_inner() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TenuredGeneration::space_iterate(SpaceClosure* blk,
|
HeapWord* TenuredGeneration::block_start(const void* p) const {
|
||||||
bool usedOnly) {
|
return space()->block_start_const(p);
|
||||||
blk->do_space(space());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TenuredGeneration::younger_refs_iterate(OopIterateClosure* blk) {
|
void TenuredGeneration::younger_refs_iterate(OopIterateClosure* blk) {
|
||||||
|
@ -98,7 +98,7 @@ class TenuredGeneration: public Generation {
|
|||||||
MemRegion prev_used_region() const { return _prev_used_region; }
|
MemRegion prev_used_region() const { return _prev_used_region; }
|
||||||
void save_used_region() { _prev_used_region = used_region(); }
|
void save_used_region() { _prev_used_region = used_region(); }
|
||||||
|
|
||||||
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
|
HeapWord* block_start(const void* p) const;
|
||||||
|
|
||||||
void younger_refs_iterate(OopIterateClosure* blk);
|
void younger_refs_iterate(OopIterateClosure* blk);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user