mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8368953: Document the reason why Serial/Parallel/G1 use zero as dirty card value
Co-authored-by: Albert Mingkun Yang <ayang@openjdk.org> Reviewed-by: ayang, iwalulya
This commit is contained in:
parent
1188ca55f5
commit
6c2d383492
@ -61,6 +61,20 @@ protected:
|
||||
|
||||
inline size_t compute_byte_map_size(size_t num_bytes);
|
||||
|
||||
// We use 0x00 (zero) to represent Dirty and 0xFF to represent Clean because
|
||||
// this choice reduces the barrier code by one instruction on architectures with
|
||||
// a constant-zero register. On such architectures, the Dirty value (0x00) is
|
||||
// directly accessible through the zero register, eliminating the need to load
|
||||
// the value explicitly and thereby saving one instruction
|
||||
//
|
||||
// E.g. see
|
||||
// Urs Hölzle. A fast write barrier for generational garbage collectors.
|
||||
// In Eliot Moss, Paul R. Wilson, and Benjamin Zorn, editors, OOPSLA/ECOOP '93
|
||||
// Workshop on Garbage Collection in Object-Oriented Systems, October 1993
|
||||
//
|
||||
// that shows this for SPARC (but aarch32/aarch64/RISC-V are similar in this
|
||||
// respect).
|
||||
//
|
||||
enum CardValues {
|
||||
clean_card = (CardValue)-1,
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user