27 #include "gc/shared/collectedHeap.hpp"
28 #include "gc/shared/gcLogPrecious.hpp"
29 #include "gc/shared/gc_globals.hpp"
30 #include "gc/shared/space.inline.hpp"
31 #include "logging/log.hpp"
32 #include "memory/virtualspace.hpp"
33 #include "runtime/init.hpp"
34 #include "runtime/java.hpp"
35 #include "runtime/os.hpp"
36 #include "services/memTracker.hpp"
37 #include "utilities/align.hpp"
38 #if INCLUDE_PARALLELGC
39 #include "gc/parallel/objectStartArray.hpp"
40 #endif
41
42 uint CardTable::_card_shift = 0;
43 uint CardTable::_card_size = 0;
44 uint CardTable::_card_size_in_words = 0;
45
46 void CardTable::initialize_card_size() {
47 assert(UseG1GC || UseParallelGC || UseSerialGC,
48 "Initialize card size should only be called by card based collectors.");
49
50 _card_size = GCCardSizeInBytes;
51 _card_shift = log2i_exact(_card_size);
52 _card_size_in_words = _card_size / sizeof(HeapWord);
53
54 // Set blockOffsetTable size based on card table entry size
55 BOTConstants::initialize_bot_size(_card_shift);
56
57 #if INCLUDE_PARALLELGC
58 // Set ObjectStartArray block size based on card table entry size
59 ObjectStartArray::initialize_block_size(_card_shift);
60 #endif
61
62 log_info_p(gc, init)("CardTable entry size: " UINT32_FORMAT, _card_size);
63 }
64
65 size_t CardTable::compute_byte_map_size(size_t num_bytes) {
66 assert(_page_size != 0, "uninitialized, check declaration order");
67 const size_t granularity = os::vm_allocation_granularity();
|
27 #include "gc/shared/collectedHeap.hpp"
28 #include "gc/shared/gcLogPrecious.hpp"
29 #include "gc/shared/gc_globals.hpp"
30 #include "gc/shared/space.inline.hpp"
31 #include "logging/log.hpp"
32 #include "memory/virtualspace.hpp"
33 #include "runtime/init.hpp"
34 #include "runtime/java.hpp"
35 #include "runtime/os.hpp"
36 #include "services/memTracker.hpp"
37 #include "utilities/align.hpp"
38 #if INCLUDE_PARALLELGC
39 #include "gc/parallel/objectStartArray.hpp"
40 #endif
41
42 uint CardTable::_card_shift = 0;
43 uint CardTable::_card_size = 0;
44 uint CardTable::_card_size_in_words = 0;
45
46 void CardTable::initialize_card_size() {
47 assert(UseG1GC || UseParallelGC || UseSerialGC || UseShenandoahGC,
48 "Initialize card size should only be called by card based collectors.");
49
50 _card_size = GCCardSizeInBytes;
51 _card_shift = log2i_exact(_card_size);
52 _card_size_in_words = _card_size / sizeof(HeapWord);
53
54 // Set blockOffsetTable size based on card table entry size
55 BOTConstants::initialize_bot_size(_card_shift);
56
57 #if INCLUDE_PARALLELGC
58 // Set ObjectStartArray block size based on card table entry size
59 ObjectStartArray::initialize_block_size(_card_shift);
60 #endif
61
62 log_info_p(gc, init)("CardTable entry size: " UINT32_FORMAT, _card_size);
63 }
64
65 size_t CardTable::compute_byte_map_size(size_t num_bytes) {
66 assert(_page_size != 0, "uninitialized, check declaration order");
67 const size_t granularity = os::vm_allocation_granularity();
|