Skip to content

Commit 3e185c7

Browse files
committed
8330154: Serial: Remove TenuredSpace::update_for_block
Reviewed-by: gli, tschatzl
1 parent f889797 commit 3e185c7

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "gc/serial/serialGcRefProcProxyTask.hpp"
4040
#include "gc/serial/serialHeap.hpp"
4141
#include "gc/serial/serialStringDedup.hpp"
42+
#include "gc/serial/tenuredGeneration.inline.hpp"
4243
#include "gc/shared/classUnloadingContext.hpp"
4344
#include "gc/shared/collectedHeap.inline.hpp"
4445
#include "gc/shared/continuationGCSupport.inline.hpp"
@@ -171,6 +172,9 @@ class Compacter {
171172

172173
uint _index;
173174

175+
// Used for BOT update
176+
TenuredGeneration* _old_gen;
177+
174178
HeapWord* get_compaction_top(uint index) const {
175179
return _spaces[index]._compaction_top;
176180
}
@@ -196,7 +200,7 @@ class Compacter {
196200
_spaces[_index]._compaction_top += words;
197201
if (_index == 0) {
198202
// old-gen requires BOT update
199-
static_cast<TenuredSpace*>(_spaces[0]._space)->update_for_block(result, result + words);
203+
_old_gen->update_for_block(result, result + words);
200204
}
201205
return result;
202206
}
@@ -280,6 +284,7 @@ class Compacter {
280284
_num_spaces = 3;
281285
}
282286
_index = 0;
287+
_old_gen = heap->old_gen();
283288
}
284289

285290
void phase2_calculate_new_addr() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ void TenuredGeneration::complete_loaded_archive_space(MemRegion archive_space) {
499499
HeapWord* start = archive_space.start();
500500
while (start < archive_space.end()) {
501501
size_t word_size = cast_to_oop(start)->size();;
502-
space->update_for_block(start, start + word_size);
502+
_bts->update_for_block(start, start + word_size);
503503
start += word_size;
504504
}
505505
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class TenuredGeneration: public Generation {
134134
void object_iterate(ObjectClosure* blk);
135135

136136
void complete_loaded_archive_space(MemRegion archive_space);
137+
inline void update_for_block(HeapWord* start, HeapWord* end);
137138

138139
virtual inline HeapWord* allocate(size_t word_size, bool is_tlab);
139140
virtual inline HeapWord* par_allocate(size_t word_size, bool is_tlab);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ inline bool TenuredGeneration::is_in(const void* p) const {
4545
return space()->is_in(p);
4646
}
4747

48+
inline void TenuredGeneration::update_for_block(HeapWord* start, HeapWord* end) {
49+
_bts->update_for_block(start, end);
50+
}
51+
4852
HeapWord* TenuredGeneration::allocate(size_t word_size,
4953
bool is_tlab) {
5054
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");

src/hotspot/share/gc/shared/space.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ class TenuredSpace: public ContiguousSpace {
179179
// Add offset table update.
180180
inline HeapWord* allocate(size_t word_size) override;
181181
inline HeapWord* par_allocate(size_t word_size) override;
182-
183-
inline void update_for_block(HeapWord* start, HeapWord* end);
184182
};
185183
#endif //INCLUDE_SERIALGC
186184

src/hotspot/share/gc/shared/space.inline.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ inline HeapWord* TenuredSpace::par_allocate(size_t size) {
5151
return res;
5252
}
5353

54-
inline void TenuredSpace::update_for_block(HeapWord* start, HeapWord* end) {
55-
_offsets->update_for_block(start, end);
56-
}
5754
#endif // INCLUDE_SERIALGC
5855

5956
#endif // SHARE_GC_SHARED_SPACE_INLINE_HPP

0 commit comments

Comments
 (0)