109 // Don't discard tlab if remaining space is larger than this. |
109 // Don't discard tlab if remaining space is larger than this. |
110 size_t refill_waste_limit() const { return _refill_waste_limit; } |
110 size_t refill_waste_limit() const { return _refill_waste_limit; } |
111 |
111 |
112 // Allocate size HeapWords. The memory is NOT initialized to zero. |
112 // Allocate size HeapWords. The memory is NOT initialized to zero. |
113 inline HeapWord* allocate(size_t size); |
113 inline HeapWord* allocate(size_t size); |
114 static size_t alignment_reserve() { return align_object_size(typeArrayOopDesc::header_size(T_INT)); } |
114 |
|
115 // Reserve space at the end of TLAB |
|
116 static size_t end_reserve() { |
|
117 int reserve_size = typeArrayOopDesc::header_size(T_INT); |
|
118 if (AllocatePrefetchStyle == 3) { |
|
119 // BIS is used to prefetch - we need a space for it. |
|
120 // +1 for rounding up to next cache line +1 to be safe |
|
121 int lines = AllocatePrefetchLines + 2; |
|
122 int step_size = AllocatePrefetchStepSize; |
|
123 int distance = AllocatePrefetchDistance; |
|
124 int prefetch_end = (distance + step_size*lines)/(int)HeapWordSize; |
|
125 reserve_size = MAX2(reserve_size, prefetch_end); |
|
126 } |
|
127 return reserve_size; |
|
128 } |
|
129 static size_t alignment_reserve() { return align_object_size(end_reserve()); } |
115 static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; } |
130 static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; } |
116 |
131 |
117 // Return tlab size or remaining space in eden such that the |
132 // Return tlab size or remaining space in eden such that the |
118 // space is large enough to hold obj_size and necessary fill space. |
133 // space is large enough to hold obj_size and necessary fill space. |
119 // Otherwise return 0; |
134 // Otherwise return 0; |