Skip to content

Commit 1188ca5

Browse files
author
Thomas Schatzl
committed
8368954: G1: Document why G1 uses TLS storage for the current card table reference
Reviewed-by: ayang, rcastanedalo, iwalulya
1 parent 394eb80 commit 1188ca5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/hotspot/share/gc/g1/g1ThreadLocalData.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@
3636
class G1ThreadLocalData {
3737
private:
3838
SATBMarkQueue _satb_mark_queue;
39+
// The current base address of the card table. Accessed by the barrier to do
40+
// the card mark. Changed as required by the refinement control thread to
41+
// implement card table switching.
42+
//
43+
// Tests showed that embedding this value in the TLS block is the cheapest
44+
// way for fast access to this value in the barrier.
45+
// E.g. embedding an address to that value directly into the code stream and
46+
// then loading from that was found to be slower on non-x64 architectures.
47+
// Additionally it increases code size a lot.
3948
G1CardTable::CardValue* _byte_map_base;
4049

4150
// Per-thread cache of pinned object count to reduce atomic operation traffic

0 commit comments

Comments
 (0)