src/share/vm/memory/threadLocalAllocBuffer.hpp

changeset 3052
1af104d6cf99
parent 2423
b1a2afa37ec4
child 3900
d2a62e0f25eb
equal deleted inserted replaced
3051:11211f7cb5a0 3052:1af104d6cf99
122 inline HeapWord* allocate(size_t size); 122 inline HeapWord* allocate(size_t size);
123 123
124 // Reserve space at the end of TLAB 124 // Reserve space at the end of TLAB
125 static size_t end_reserve() { 125 static size_t end_reserve() {
126 int reserve_size = typeArrayOopDesc::header_size(T_INT); 126 int reserve_size = typeArrayOopDesc::header_size(T_INT);
127 if (AllocatePrefetchStyle == 3) { 127 return MAX2(reserve_size, VM_Version::reserve_for_allocation_prefetch());
128 // BIS is used to prefetch - we need a space for it.
129 // +1 for rounding up to next cache line +1 to be safe
130 int lines = AllocatePrefetchLines + 2;
131 int step_size = AllocatePrefetchStepSize;
132 int distance = AllocatePrefetchDistance;
133 int prefetch_end = (distance + step_size*lines)/(int)HeapWordSize;
134 reserve_size = MAX2(reserve_size, prefetch_end);
135 }
136 return reserve_size;
137 } 128 }
138 static size_t alignment_reserve() { return align_object_size(end_reserve()); } 129 static size_t alignment_reserve() { return align_object_size(end_reserve()); }
139 static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; } 130 static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; }
140 131
141 // Return tlab size or remaining space in eden such that the 132 // Return tlab size or remaining space in eden such that the

mercurial