// Maximum size an offset table entry can cover. This maximum is derived from that // we need an extra bit for possible offsets in the byte for backskip values, leaving 2^7 possible offsets. // Minimum object alignment is 8 bytes (2^3), so we can at most represent 2^10 offsets within a BOT value. staticconst uint MaxBlockSize = 1024;
// Initialize block size based on card size staticvoid initialize_block_size(uint card_shift);
// Mapping from address to object start array entry
jbyte* block_for_addr(void* p) const {
assert(_covered_region.contains(p), "out of bounds access to object start array");
jbyte* result = &_offset_base[uintptr_t(p) >> _card_shift];
assert(_blocks_region.contains(result), "out of bounds result in byte_for"); return result;
}
// Mapping from object start array entry to address of first word
HeapWord* addr_for_block(jbyte* p) {
assert(_blocks_region.contains(p), "out of bounds access to object start array");
size_t delta = pointer_delta(p, _offset_base, sizeof(jbyte));
HeapWord* result = (HeapWord*) (delta << _card_shift);
assert(_covered_region.contains(result), "out of bounds accessor from card marking array"); return result;
}
// Mapping that includes the derived offset. // If the block is clean, returns the last address in the covered region. // If the block is < index 0, returns the start of the covered region.
HeapWord* offset_addr_for_block(jbyte* p) const { // We have to do this before the assert if (p < _raw_base) { return _covered_region.start();
}
assert(_blocks_region.contains(p), "out of bounds access to object start array");
if (*p == clean_block) { return _covered_region.end();
}
size_t delta = pointer_delta(p, _offset_base, sizeof(jbyte));
HeapWord* result = (HeapWord*) (delta << _card_shift);
result += *p;
assert(_covered_region.contains(result), "out of bounds accessor from card marking array");
return result;
}
public:
// This method is in lieu of a constructor, so that this class can be // embedded inline in other classes. void initialize(MemRegion reserved_region);
// Optimized for finding the first object that crosses into // a given block. The blocks contain the offset of the last // object in that block. Scroll backwards by one, and the first // object hit should be at the beginning of the block inline HeapWord* object_start(HeapWord* addr) const;
// Return true iff an object starts in // [start_addr, end_addr_aligned_up) // where // end_addr_aligned_up = align_up(end_addr, _card_size) // Precondition: start_addr is card-size aligned bool object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const;
};
#endif// SHARE_GC_PARALLEL_OBJECTSTARTARRAY_HPP
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.