Mercurial > hg > truffle
diff src/share/vm/opto/macro.cpp @ 3854:1af104d6cf99
7079329: Adjust allocation prefetching for T4
Summary: on T4 2 BIS instructions should be issued to prefetch 64 bytes
Reviewed-by: iveresov, phh, twisti
author | kvn |
---|---|
date | Tue, 16 Aug 2011 16:59:46 -0700 |
parents | f1c12354c3f7 |
children | a92cdbac8b9e |
line wrap: on
line diff
--- a/src/share/vm/opto/macro.cpp Tue Aug 16 11:53:57 2011 -0700 +++ b/src/share/vm/opto/macro.cpp Tue Aug 16 16:59:46 2011 -0700 @@ -1590,7 +1590,7 @@ prefetch_adr = new (C, 4) AddPNode( old_pf_wm, new_pf_wmt, _igvn.MakeConX(distance) ); transform_later(prefetch_adr); - prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); + prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr ); transform_later(prefetch); distance += step_size; i_o = prefetch; @@ -1611,13 +1611,14 @@ contended_phi_rawmem = pf_phi_rawmem; i_o = pf_phi_abio; } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { - // Insert a prefetch for each allocation only on the fast-path + // Insert a prefetch for each allocation. + // This code is used for Sparc with BIS. Node *pf_region = new (C, 3) RegionNode(3); Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, TypeRawPtr::BOTTOM ); - // Generate several prefetch instructions only for arrays. - uint lines = (length != NULL) ? AllocatePrefetchLines : 1; + // Generate several prefetch instructions. + uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines; uint step_size = AllocatePrefetchStepSize; uint distance = AllocatePrefetchDistance; @@ -1634,7 +1635,7 @@ transform_later(cache_adr); // Prefetch - Node *prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, cache_adr ); + Node *prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, cache_adr ); prefetch->set_req(0, needgc_false); transform_later(prefetch); contended_phi_rawmem = prefetch; @@ -1644,7 +1645,7 @@ prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr, _igvn.MakeConX(distance) ); transform_later(prefetch_adr); - prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, prefetch_adr ); + prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, prefetch_adr ); transform_later(prefetch); distance += step_size; contended_phi_rawmem = prefetch; @@ -1653,15 +1654,15 @@ // Insert a prefetch for each allocation only on the fast-path Node *prefetch_adr; Node *prefetch; - // Generate several prefetch instructions only for arrays. - uint lines = (length != NULL) ? AllocatePrefetchLines : 1; + // Generate several prefetch instructions. + uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines; uint step_size = AllocatePrefetchStepSize; uint distance = AllocatePrefetchDistance; for ( uint i = 0; i < lines; i++ ) { prefetch_adr = new (C, 4) AddPNode( old_eden_top, new_eden_top, _igvn.MakeConX(distance) ); transform_later(prefetch_adr); - prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); + prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr ); // Do not let it float too high, since if eden_top == eden_end, // both might be null. if( i == 0 ) { // Set control for first prefetch, next follows it