Skip to content

Commit d303766

Browse files
author
duke
committedMar 8, 2022
Automatic merge of jdk:master into master
2 parents 3997ee9 + e607287 commit d303766

File tree

2 files changed

+10
-42
lines changed

2 files changed

+10
-42
lines changed
 

‎src/hotspot/share/gc/shared/blockOffsetTable.cpp

+9-33
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,10 @@ BlockOffsetArray::alloc_block(HeapWord* blk_start, HeapWord* blk_end) {
248248
single_block(blk_start, blk_end);
249249
}
250250

251-
// Action_mark - update the BOT for the block [blk_start, blk_end).
252-
// Current typical use is for splitting a block.
253-
// Action_single - udpate the BOT for an allocation.
254-
// Action_verify - BOT verification.
255251
void
256252
BlockOffsetArray::do_block_internal(HeapWord* blk_start,
257253
HeapWord* blk_end,
258-
Action action, bool reducing) {
254+
bool reducing) {
259255
assert(_sp->is_in_reserved(blk_start),
260256
"reference must be into the space");
261257
assert(_sp->is_in_reserved(blk_end-1),
@@ -284,33 +280,13 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start,
284280
}
285281
assert(start_index <= end_index, "monotonicity of index_for()");
286282
assert(boundary <= (HeapWord*)boundary_before_end, "tautology");
287-
switch (action) {
288-
case Action_mark: {
289-
if (init_to_zero()) {
290-
_array->set_offset_array(start_index, boundary, blk_start, reducing);
291-
break;
292-
} // Else fall through to the next case
293-
}
294-
case Action_single: {
295-
_array->set_offset_array(start_index, boundary, blk_start, reducing);
296-
// We have finished marking the "offset card". We need to now
297-
// mark the subsequent cards that this blk spans.
298-
if (start_index < end_index) {
299-
HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::card_size_in_words();
300-
HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::card_size_in_words();
301-
set_remainder_to_point_to_start(rem_st, rem_end, reducing);
302-
}
303-
break;
304-
}
305-
case Action_check: {
306-
_array->check_offset_array(start_index, boundary, blk_start);
307-
// We have finished checking the "offset card". We need to now
308-
// check the subsequent cards that this blk spans.
309-
check_all_cards(start_index + 1, end_index);
310-
break;
311-
}
312-
default:
313-
ShouldNotReachHere();
283+
_array->set_offset_array(start_index, boundary, blk_start, reducing);
284+
// We have finished marking the "offset card". We need to now
285+
// mark the subsequent cards that this blk spans.
286+
if (start_index < end_index) {
287+
HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::card_size_in_words();
288+
HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::card_size_in_words();
289+
set_remainder_to_point_to_start(rem_st, rem_end, reducing);
314290
}
315291
}
316292
}
@@ -322,7 +298,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start,
322298
void
323299
BlockOffsetArray::single_block(HeapWord* blk_start,
324300
HeapWord* blk_end) {
325-
do_block_internal(blk_start, blk_end, Action_single);
301+
do_block_internal(blk_start, blk_end);
326302
}
327303

328304
void BlockOffsetArray::verify() const {

‎src/hotspot/share/gc/shared/blockOffsetTable.hpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,6 @@ class Space;
279279
class BlockOffsetArray: public BlockOffsetTable {
280280
friend class VMStructs;
281281
protected:
282-
// The following enums are used by do_block_internal() below
283-
enum Action {
284-
Action_single, // BOT records a single block (see single_block())
285-
Action_mark, // BOT marks the start of a block (see mark_block())
286-
Action_check // Check that BOT records block correctly
287-
// (see verify_single_block()).
288-
};
289-
290282
// The shared array, which is shared with other BlockOffsetArray's
291283
// corresponding to different spaces within a generation or span of
292284
// memory.
@@ -315,7 +307,7 @@ class BlockOffsetArray: public BlockOffsetTable {
315307
void set_remainder_to_point_to_start_incl(size_t start, size_t end, bool reducing = false);
316308

317309
// A helper function for BOT adjustment/verification work
318-
void do_block_internal(HeapWord* blk_start, HeapWord* blk_end, Action action, bool reducing = false);
310+
void do_block_internal(HeapWord* blk_start, HeapWord* blk_end, bool reducing = false);
319311

320312
public:
321313
// The space may not have its bottom and top set yet, which is why the

0 commit comments

Comments
 (0)