1.1 --- a/src/share/vm/opto/macro.cpp Wed Apr 07 10:35:56 2010 -0700 1.2 +++ b/src/share/vm/opto/macro.cpp Wed Apr 07 12:39:27 2010 -0700 1.3 @@ -1487,11 +1487,11 @@ 1.4 Node*& contended_phi_rawmem, 1.5 Node* old_eden_top, Node* new_eden_top, 1.6 Node* length) { 1.7 + enum { fall_in_path = 1, pf_path = 2 }; 1.8 if( UseTLAB && AllocatePrefetchStyle == 2 ) { 1.9 // Generate prefetch allocation with watermark check. 1.10 // As an allocation hits the watermark, we will prefetch starting 1.11 // at a "distance" away from watermark. 1.12 - enum { fall_in_path = 1, pf_path = 2 }; 1.13 1.14 Node *pf_region = new (C, 3) RegionNode(3); 1.15 Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, 1.16 @@ -1570,6 +1570,45 @@ 1.17 needgc_false = pf_region; 1.18 contended_phi_rawmem = pf_phi_rawmem; 1.19 i_o = pf_phi_abio; 1.20 + } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { 1.21 + // Insert a prefetch for each allocation only on the fast-path 1.22 + Node *pf_region = new (C, 3) RegionNode(3); 1.23 + Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, 1.24 + TypeRawPtr::BOTTOM ); 1.25 + 1.26 + // Generate several prefetch instructions only for arrays. 1.27 + uint lines = (length != NULL) ? AllocatePrefetchLines : 1; 1.28 + uint step_size = AllocatePrefetchStepSize; 1.29 + uint distance = AllocatePrefetchDistance; 1.30 + 1.31 + // Next cache address. 1.32 + Node *cache_adr = new (C, 4) AddPNode(old_eden_top, old_eden_top, 1.33 + _igvn.MakeConX(distance)); 1.34 + transform_later(cache_adr); 1.35 + cache_adr = new (C, 2) CastP2XNode(needgc_false, cache_adr); 1.36 + transform_later(cache_adr); 1.37 + Node* mask = _igvn.MakeConX(~(intptr_t)(step_size-1)); 1.38 + cache_adr = new (C, 3) AndXNode(cache_adr, mask); 1.39 + transform_later(cache_adr); 1.40 + cache_adr = new (C, 2) CastX2PNode(cache_adr); 1.41 + transform_later(cache_adr); 1.42 + 1.43 + // Prefetch 1.44 + Node *prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, cache_adr ); 1.45 + prefetch->set_req(0, needgc_false); 1.46 + transform_later(prefetch); 1.47 + contended_phi_rawmem = prefetch; 1.48 + Node *prefetch_adr; 1.49 + distance = step_size; 1.50 + for ( uint i = 1; i < lines; i++ ) { 1.51 + prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr, 1.52 + _igvn.MakeConX(distance) ); 1.53 + transform_later(prefetch_adr); 1.54 + prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, prefetch_adr ); 1.55 + transform_later(prefetch); 1.56 + distance += step_size; 1.57 + contended_phi_rawmem = prefetch; 1.58 + } 1.59 } else if( AllocatePrefetchStyle > 0 ) { 1.60 // Insert a prefetch for each allocation only on the fast-path 1.61 Node *prefetch_adr;