38 return NULL;
39 }
40 }
41
42 inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const {
43 if (addr >= _hr->bottom() && addr < _hr->end()) {
44 HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1);
45 HeapWord* n = q + block_size(q);
46 return forward_to_block_containing_addr_const(q, n, addr);
47 } else {
48 return NULL;
49 }
50 }
51
52 u_char G1BlockOffsetTable::offset_array(size_t index) const {
53 check_index(index, "index out of range");
54 return Atomic::load(&_offset_array[index]);
55 }
56
57 void G1BlockOffsetTable::set_offset_array_raw(size_t index, u_char offset) {
58 Atomic::store(offset, &_offset_array[index]);
59 }
60
61 void G1BlockOffsetTable::set_offset_array(size_t index, u_char offset) {
62 check_index(index, "index out of range");
63 set_offset_array_raw(index, offset);
64 }
65
66 void G1BlockOffsetTable::set_offset_array(size_t index, HeapWord* high, HeapWord* low) {
67 check_index(index, "index out of range");
68 assert(high >= low, "addresses out of order");
69 size_t offset = pointer_delta(high, low);
70 check_offset(offset, "offset too large");
71 set_offset_array(index, (u_char)offset);
72 }
73
74 void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offset) {
75 check_index(right, "right index out of range");
76 assert(left <= right, "indexes out of order");
77 size_t num_cards = right - left + 1;
78 memset_with_concurrent_readers
|
38 return NULL;
39 }
40 }
41
42 inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const {
43 if (addr >= _hr->bottom() && addr < _hr->end()) {
44 HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1);
45 HeapWord* n = q + block_size(q);
46 return forward_to_block_containing_addr_const(q, n, addr);
47 } else {
48 return NULL;
49 }
50 }
51
52 u_char G1BlockOffsetTable::offset_array(size_t index) const {
53 check_index(index, "index out of range");
54 return Atomic::load(&_offset_array[index]);
55 }
56
57 void G1BlockOffsetTable::set_offset_array_raw(size_t index, u_char offset) {
58 Atomic::store(&_offset_array[index], offset);
59 }
60
61 void G1BlockOffsetTable::set_offset_array(size_t index, u_char offset) {
62 check_index(index, "index out of range");
63 set_offset_array_raw(index, offset);
64 }
65
66 void G1BlockOffsetTable::set_offset_array(size_t index, HeapWord* high, HeapWord* low) {
67 check_index(index, "index out of range");
68 assert(high >= low, "addresses out of order");
69 size_t offset = pointer_delta(high, low);
70 check_offset(offset, "offset too large");
71 set_offset_array(index, (u_char)offset);
72 }
73
74 void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offset) {
75 check_index(right, "right index out of range");
76 assert(left <= right, "indexes out of order");
77 size_t num_cards = right - left + 1;
78 memset_with_concurrent_readers
|