src/share/vm/memory/threadLocalAllocBuffer.hpp

changeset 1802
9e321dcfa5b7
parent 435
a61af66fc99e
child 1907
c18cbe5936b8
     1.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Apr 07 10:35:56 2010 -0700
     1.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp	Wed Apr 07 12:39:27 2010 -0700
     1.3 @@ -111,7 +111,22 @@
     1.4  
     1.5    // Allocate size HeapWords. The memory is NOT initialized to zero.
     1.6    inline HeapWord* allocate(size_t size);
     1.7 -  static size_t alignment_reserve()              { return align_object_size(typeArrayOopDesc::header_size(T_INT)); }
     1.8 +
     1.9 +  // Reserve space at the end of TLAB
    1.10 +  static size_t end_reserve() {
    1.11 +    int reserve_size = typeArrayOopDesc::header_size(T_INT);
    1.12 +    if (AllocatePrefetchStyle == 3) {
    1.13 +      // BIS is used to prefetch - we need a space for it.
    1.14 +      // +1 for rounding up to next cache line +1 to be safe
    1.15 +      int lines = AllocatePrefetchLines + 2;
    1.16 +      int step_size = AllocatePrefetchStepSize;
    1.17 +      int distance = AllocatePrefetchDistance;
    1.18 +      int prefetch_end = (distance + step_size*lines)/(int)HeapWordSize;
    1.19 +      reserve_size = MAX2(reserve_size, prefetch_end);
    1.20 +    }
    1.21 +    return reserve_size;
    1.22 +  }
    1.23 +  static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
    1.24    static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
    1.25  
    1.26    // Return tlab size or remaining space in eden such that the

mercurial