--- old/src/share/vm/opto/macro.cpp 2017-07-24 10:39:03.965574197 +0530 +++ new/src/share/vm/opto/macro.cpp 2017-07-24 10:39:03.849458512 +0530 @@ -1775,7 +1775,7 @@ i_o = pf_phi_abio; } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { // Insert a prefetch for each allocation. - // This code is used for Sparc with BIS. + // This code is used to generate 1 prefetch instruction per cache line. Node *pf_region = new (C) RegionNode(3); Node *pf_phi_rawmem = new (C) PhiNode( pf_region, Type::MEMORY, TypeRawPtr::BOTTOM ); @@ -1791,6 +1791,8 @@ transform_later(cache_adr); cache_adr = new (C) CastP2XNode(needgc_false, cache_adr); transform_later(cache_adr); + // Address is aligned to execute prefetch to the beginning of cache line size + // (it is important when BIS instruction is used on SPARC as prefetch). Node* mask = _igvn.MakeConX(~(intptr_t)(step_size-1)); cache_adr = new (C) AndXNode(cache_adr, mask); transform_later(cache_adr);