*** old/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp Mon May 23 12:58:29 2016
--- new/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp Mon May 23 12:58:29 2016
*** 214,239 ****
--- 214,244 ----
_target_refills = 100 / (2 * TLABWasteTargetPercent);
_target_refills = MAX2(_target_refills, (unsigned)1U);
_global_stats = new GlobalTLABStats();
// Need extra space at the end of TLAB, otherwise prefetching
// instructions will fault (due to accessing memory outside of heap).
+ #ifdef COMPILER2
+ // If the C2 compiler is present, extra space is needed at the end of
+ // TLABs, otherwise prefetching instructions generated by the C2
+ // compiler will fault (due to accessing memory outside of heap).
// The amount of space is the max of the number of lines to
// prefetch for array and for instance allocations. (Extra space must be
// reserved to accommodate both types of allocations.)
// Only SPARC-specific BIS instructions are known to fault. (Those
// instructions are generated if AllocatePrefetchStyle==3 and
// AllocatePrefetchInstr==1). To be on the safe side, however,
// extra space is reserved for all combinations of
// AllocatePrefetchStyle and AllocatePrefetchInstr.
+ // If the C2 compiler is not present, no space is reserved.
// +1 for rounding up to next cache line, +1 to be safe
int lines = MAX2(AllocatePrefetchLines, AllocateInstancePrefetchLines) + 2;
_reserve_for_allocation_prefetch = (AllocatePrefetchDistance + AllocatePrefetchStepSize * lines) /
// During jvm startup, the main (primordial) thread is initialized
// before the heap is initialized. So reinitialize it now.
guarantee(Thread::current()->is_Java_thread(), "tlab initialization thread not Java thread");