61 assert((index) < (_reserved.word_size() >> BOTConstants::LogN_words),
62 "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT,
63 msg, (index), (_reserved.word_size() >> BOTConstants::LogN_words));
64 assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)),
65 "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT
66 " (%u) is not in committed area.",
67 (index),
68 p2i(address_for_index_raw(index)),
69 G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index)));
70 }
71 #endif // ASSERT
72
73 //////////////////////////////////////////////////////////////////////
74 // G1BlockOffsetTablePart
75 //////////////////////////////////////////////////////////////////////
76
77 G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) :
78 _bot(array),
79 _space(gsp),
80 _next_offset_threshold(NULL),
81 _next_offset_index(0)
82 { }
83
84 // The arguments follow the normal convention of denoting
85 // a right-open interval: [start, end)
86 void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) {
87
88 if (start >= end) {
89 // The start address is equal to the end address (or to
90 // the right of the end address) so there are not cards
91 // that need to be updated..
92 return;
93 }
94
95 // Write the backskip value for each region.
96 //
97 // offset
98 // card 2nd 3rd
99 // | +- 1st | |
100 // v v v v
101 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-
401 _bot->set_offset_array_raw(bottom_index, 0);
402 }
403
404 HeapWord* G1BlockOffsetTablePart::initialize_threshold() {
405 assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array),
406 "just checking");
407 _next_offset_index = _bot->index_for(_space->bottom());
408 _next_offset_index++;
409 _next_offset_threshold =
410 _bot->address_for_index(_next_offset_index);
411 return _next_offset_threshold;
412 }
413
414 void G1BlockOffsetTablePart::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) {
415 // The first BOT entry should have offset 0.
416 reset_bot();
417 alloc_block(_space->bottom(), obj_top);
418 if (fill_size > 0) {
419 alloc_block(obj_top, fill_size);
420 }
421 }
|
61 assert((index) < (_reserved.word_size() >> BOTConstants::LogN_words),
62 "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT,
63 msg, (index), (_reserved.word_size() >> BOTConstants::LogN_words));
64 assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)),
65 "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT
66 " (%u) is not in committed area.",
67 (index),
68 p2i(address_for_index_raw(index)),
69 G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index)));
70 }
71 #endif // ASSERT
72
73 //////////////////////////////////////////////////////////////////////
74 // G1BlockOffsetTablePart
75 //////////////////////////////////////////////////////////////////////
76
77 G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) :
78 _bot(array),
79 _space(gsp),
80 _next_offset_threshold(NULL),
81 _next_offset_index(0),
82 _object_can_span(false)
83 { }
84
85 // The arguments follow the normal convention of denoting
86 // a right-open interval: [start, end)
87 void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) {
88
89 if (start >= end) {
90 // The start address is equal to the end address (or to
91 // the right of the end address) so there are not cards
92 // that need to be updated..
93 return;
94 }
95
96 // Write the backskip value for each region.
97 //
98 // offset
99 // card 2nd 3rd
100 // | +- 1st | |
101 // v v v v
102 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-
402 _bot->set_offset_array_raw(bottom_index, 0);
403 }
404
405 HeapWord* G1BlockOffsetTablePart::initialize_threshold() {
406 assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array),
407 "just checking");
408 _next_offset_index = _bot->index_for(_space->bottom());
409 _next_offset_index++;
410 _next_offset_threshold =
411 _bot->address_for_index(_next_offset_index);
412 return _next_offset_threshold;
413 }
414
415 void G1BlockOffsetTablePart::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) {
416 // The first BOT entry should have offset 0.
417 reset_bot();
418 alloc_block(_space->bottom(), obj_top);
419 if (fill_size > 0) {
420 alloc_block(obj_top, fill_size);
421 }
422 }
423
424 void G1BlockOffsetTablePart::set_continues_humongous(bool is_humongous) {
425 _object_can_span = is_humongous;
426 }
|