36 #include "services/memTracker.hpp"
37 #include "utilities/macros.hpp"
38 #ifdef COMPILER1
39 #include "c1/c1_LIR.hpp"
40 #include "c1/c1_LIRGenerator.hpp"
41 #endif
42
43 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
44 // enumerate ref fields that have been modified (since the last
45 // enumeration.)
46
47 size_t CardTableModRefBS::compute_byte_map_size()
48 {
49 assert(_guard_index == cards_required(_whole_heap.word_size()) - 1,
50 "uninitialized, check declaration order");
51 assert(_page_size != 0, "uninitialized, check declaration order");
52 const size_t granularity = os::vm_allocation_granularity();
53 return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
54 }
55
56 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
57 int max_covered_regions):
58 ModRefBarrierSet(max_covered_regions),
59 _whole_heap(whole_heap),
60 _guard_index(0),
61 _guard_region(),
62 _last_valid_index(0),
63 _page_size(os::vm_page_size()),
64 _byte_map_size(0),
65 _covered(NULL),
66 _committed(NULL),
67 _cur_covered_regions(0),
68 _byte_map(NULL),
69 byte_map_base(NULL),
70 // LNC functionality
71 _lowest_non_clean(NULL),
72 _lowest_non_clean_chunk_size(NULL),
73 _lowest_non_clean_base_chunk_index(NULL),
74 _last_LNC_resizing_collection(NULL)
75 {
76 _kind = BarrierSet::CardTableModRef;
77
78 assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
|
36 #include "services/memTracker.hpp"
37 #include "utilities/macros.hpp"
38 #ifdef COMPILER1
39 #include "c1/c1_LIR.hpp"
40 #include "c1/c1_LIRGenerator.hpp"
41 #endif
42
43 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
44 // enumerate ref fields that have been modified (since the last
45 // enumeration.)
46
47 size_t CardTableModRefBS::compute_byte_map_size()
48 {
49 assert(_guard_index == cards_required(_whole_heap.word_size()) - 1,
50 "uninitialized, check declaration order");
51 assert(_page_size != 0, "uninitialized, check declaration order");
52 const size_t granularity = os::vm_allocation_granularity();
53 return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
54 }
55
56 CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
57 ModRefBarrierSet(),
58 _whole_heap(whole_heap),
59 _guard_index(0),
60 _guard_region(),
61 _last_valid_index(0),
62 _page_size(os::vm_page_size()),
63 _byte_map_size(0),
64 _covered(NULL),
65 _committed(NULL),
66 _cur_covered_regions(0),
67 _byte_map(NULL),
68 byte_map_base(NULL),
69 // LNC functionality
70 _lowest_non_clean(NULL),
71 _lowest_non_clean_chunk_size(NULL),
72 _lowest_non_clean_base_chunk_index(NULL),
73 _last_LNC_resizing_collection(NULL)
74 {
75 _kind = BarrierSet::CardTableModRef;
76
77 assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
|