mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8277372: Add getters for BOT and card table members
Reviewed-by: tschatzl, sjohanss, ayang
This commit is contained in:
parent
7c6f57fcb1
commit
adf39522c1
40 changed files with 205 additions and 176 deletions
|
@ -111,6 +111,11 @@ protected:
|
|||
// a word's worth (row) of clean card values
|
||||
static const intptr_t clean_card_row = (intptr_t)(-1);
|
||||
|
||||
// CardTable entry size
|
||||
static uint _card_shift;
|
||||
static uint _card_size;
|
||||
static uint _card_size_in_words;
|
||||
|
||||
public:
|
||||
CardTable(MemRegion whole_heap);
|
||||
virtual ~CardTable();
|
||||
|
@ -133,8 +138,8 @@ public:
|
|||
// in, um, words.
|
||||
inline size_t cards_required(size_t covered_words) {
|
||||
// Add one for a guard card, used to detect errors.
|
||||
const size_t words = align_up(covered_words, card_size_in_words);
|
||||
return words / card_size_in_words + 1;
|
||||
const size_t words = align_up(covered_words, _card_size_in_words);
|
||||
return words / _card_size_in_words + 1;
|
||||
}
|
||||
|
||||
// Dirty the bytes corresponding to "mr" (not all of which must be
|
||||
|
@ -157,7 +162,7 @@ public:
|
|||
"Attempt to access p = " PTR_FORMAT " out of bounds of "
|
||||
" card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
|
||||
p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end()));
|
||||
CardValue* result = &_byte_map_base[uintptr_t(p) >> card_shift];
|
||||
CardValue* result = &_byte_map_base[uintptr_t(p) >> _card_shift];
|
||||
assert(result >= _byte_map && result < _byte_map + _byte_map_size,
|
||||
"out of bounds accessor for card marking array");
|
||||
return result;
|
||||
|
@ -189,7 +194,7 @@ public:
|
|||
" _byte_map: " PTR_FORMAT " _byte_map + _byte_map_size: " PTR_FORMAT,
|
||||
p2i(p), p2i(_byte_map), p2i(_byte_map + _byte_map_size));
|
||||
size_t delta = pointer_delta(p, _byte_map_base, sizeof(CardValue));
|
||||
HeapWord* result = (HeapWord*) (delta << card_shift);
|
||||
HeapWord* result = (HeapWord*) (delta << _card_shift);
|
||||
assert(_whole_heap.contains(result),
|
||||
"Returning result = " PTR_FORMAT " out of bounds of "
|
||||
" card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
|
||||
|
@ -228,10 +233,17 @@ public:
|
|||
MemRegion dirty_card_range_after_reset(MemRegion mr, bool reset,
|
||||
int reset_val);
|
||||
|
||||
// CardTable entry size
|
||||
static uint card_shift;
|
||||
static uint card_size;
|
||||
static uint card_size_in_words;
|
||||
static uint card_shift() {
|
||||
return _card_shift;
|
||||
}
|
||||
|
||||
static uint card_size() {
|
||||
return _card_size;
|
||||
}
|
||||
|
||||
static uint card_size_in_words() {
|
||||
return _card_size_in_words;
|
||||
}
|
||||
|
||||
static constexpr CardValue clean_card_val() { return clean_card; }
|
||||
static constexpr CardValue dirty_card_val() { return dirty_card; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue