Skip to content

Commit 6f1d896

Browse files
committed
8318510: Serial: Remove TenuredGeneration::block_size
Reviewed-by: tschatzl, iwalulya
1 parent 8f4ebd8 commit 6f1d896

File tree

6 files changed

+1
-27
lines changed

6 files changed

+1
-27
lines changed

src/hotspot/share/gc/serial/cardTableRS.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
106106
// Otherwise, it is possible that the object starting on the dirty
107107
// card spans the entire card, and that the store happened on a
108108
// later card. Figure out where the object ends.
109-
assert(_sp->block_size(top_obj) == cast_to_oop(top_obj)->size(),
110-
"Block size and object size mismatch");
111109
top = top_obj + cast_to_oop(top_obj)->size();
112110
}
113111
} else {

src/hotspot/share/gc/serial/generation.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,6 @@ class GenerationBlockSizeClosure : public SpaceClosure {
194194
GenerationBlockSizeClosure(const HeapWord* p) { _p = p; size = 0; }
195195
};
196196

197-
size_t Generation::block_size(const HeapWord* p) const {
198-
GenerationBlockSizeClosure blk(p);
199-
// Cast away const
200-
((Generation*)this)->space_iterate(&blk);
201-
assert(blk.size > 0, "seems reasonable");
202-
return blk.size;
203-
}
204-
205197
class GenerationBlockIsObjClosure : public SpaceClosure {
206198
public:
207199
const HeapWord* _p;

src/hotspot/share/gc/serial/generation.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,6 @@ class Generation: public CHeapObj<mtGC> {
331331
// non-object.
332332
virtual HeapWord* block_start(const void* addr) const;
333333

334-
// Requires "addr" to be the start of a chunk, and returns its size.
335-
// "addr + size" is required to be the start of a new chunk, or the end
336-
// of the active area of the heap.
337-
virtual size_t block_size(const HeapWord* addr) const ;
338-
339334
// Requires "addr" to be the start of a block, and returns "TRUE" iff
340335
// the block is an object.
341336
virtual bool block_is_obj(const HeapWord* addr) const;

src/hotspot/share/gc/serial/tenuredGeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ void TenuredGeneration::complete_loaded_archive_space(MemRegion archive_space) {
477477
space->initialize_threshold();
478478
HeapWord* start = archive_space.start();
479479
while (start < archive_space.end()) {
480-
size_t word_size = _the_space->block_size(start);
480+
size_t word_size = cast_to_oop(start)->size();;
481481
space->alloc_block(start, start + word_size);
482482
start += word_size;
483483
}

src/hotspot/share/gc/serial/tenuredGeneration.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ class TenuredGeneration: public Generation {
133133

134134
bool no_allocs_since_save_marks();
135135

136-
inline size_t block_size(const HeapWord* addr) const;
137-
138136
inline bool block_is_obj(const HeapWord* addr) const;
139137

140138
virtual void collect(bool full,

src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@ HeapWord* TenuredGeneration::par_allocate(size_t word_size,
6565
return _the_space->par_allocate(word_size);
6666
}
6767

68-
size_t TenuredGeneration::block_size(const HeapWord* addr) const {
69-
if (addr < _the_space->top()) {
70-
return cast_to_oop(addr)->size();
71-
} else {
72-
assert(addr == _the_space->top(), "non-block head arg to block_size");
73-
return _the_space->end() - _the_space->top();
74-
}
75-
}
76-
7768
bool TenuredGeneration::block_is_obj(const HeapWord* addr) const {
7869
return addr < _the_space ->top();
7970
}

0 commit comments

Comments
 (0)