61 |
61 |
62 inline HeapWord* G1Allocator::attempt_allocation_force(size_t word_size) { |
62 inline HeapWord* G1Allocator::attempt_allocation_force(size_t word_size) { |
63 return mutator_alloc_region()->attempt_allocation_force(word_size); |
63 return mutator_alloc_region()->attempt_allocation_force(word_size); |
64 } |
64 } |
65 |
65 |
66 inline PLAB* G1PLABAllocator::alloc_buffer(InCSetState dest) { |
66 inline PLAB* G1PLABAllocator::alloc_buffer(G1HeapRegionAttr dest) { |
67 assert(dest.is_valid(), |
67 assert(dest.is_valid(), |
68 "Allocation buffer index out of bounds: " CSETSTATE_FORMAT, dest.value()); |
68 "Allocation buffer index out of bounds: %s", dest.get_type_str()); |
69 assert(_alloc_buffers[dest.value()] != NULL, |
69 assert(_alloc_buffers[dest.type()] != NULL, |
70 "Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()); |
70 "Allocation buffer is NULL: %s", dest.get_type_str()); |
71 return _alloc_buffers[dest.value()]; |
71 return _alloc_buffers[dest.type()]; |
72 } |
72 } |
73 |
73 |
74 inline HeapWord* G1PLABAllocator::plab_allocate(InCSetState dest, |
74 inline HeapWord* G1PLABAllocator::plab_allocate(G1HeapRegionAttr dest, |
75 size_t word_sz) { |
75 size_t word_sz) { |
76 PLAB* buffer = alloc_buffer(dest); |
76 PLAB* buffer = alloc_buffer(dest); |
77 if (_survivor_alignment_bytes == 0 || !dest.is_young()) { |
77 if (_survivor_alignment_bytes == 0 || !dest.is_young()) { |
78 return buffer->allocate(word_sz); |
78 return buffer->allocate(word_sz); |
79 } else { |
79 } else { |
80 return buffer->allocate_aligned(word_sz, _survivor_alignment_bytes); |
80 return buffer->allocate_aligned(word_sz, _survivor_alignment_bytes); |
81 } |
81 } |
82 } |
82 } |
83 |
83 |
84 inline HeapWord* G1PLABAllocator::allocate(InCSetState dest, |
84 inline HeapWord* G1PLABAllocator::allocate(G1HeapRegionAttr dest, |
85 size_t word_sz, |
85 size_t word_sz, |
86 bool* refill_failed) { |
86 bool* refill_failed) { |
87 HeapWord* const obj = plab_allocate(dest, word_sz); |
87 HeapWord* const obj = plab_allocate(dest, word_sz); |
88 if (obj != NULL) { |
88 if (obj != NULL) { |
89 return obj; |
89 return obj; |