1573 new_pf_wmt->set_req(0, need_pf_true); 1574 1575 Node *store_new_wmt = new (C, 4) StorePNode( need_pf_true, 1576 contended_phi_rawmem, eden_pf_adr, 1577 TypeRawPtr::BOTTOM, new_pf_wmt ); 1578 transform_later(store_new_wmt); 1579 1580 // adding prefetches 1581 pf_phi_abio->init_req( fall_in_path, i_o ); 1582 1583 Node *prefetch_adr; 1584 Node *prefetch; 1585 uint lines = AllocatePrefetchDistance / AllocatePrefetchStepSize; 1586 uint step_size = AllocatePrefetchStepSize; 1587 uint distance = 0; 1588 1589 for ( uint i = 0; i < lines; i++ ) { 1590 prefetch_adr = new (C, 4) AddPNode( old_pf_wm, new_pf_wmt, 1591 _igvn.MakeConX(distance) ); 1592 transform_later(prefetch_adr); 1593 prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); 1594 transform_later(prefetch); 1595 distance += step_size; 1596 i_o = prefetch; 1597 } 1598 pf_phi_abio->set_req( pf_path, i_o ); 1599 1600 pf_region->init_req( fall_in_path, need_pf_false ); 1601 pf_region->init_req( pf_path, need_pf_true ); 1602 1603 pf_phi_rawmem->init_req( fall_in_path, contended_phi_rawmem ); 1604 pf_phi_rawmem->init_req( pf_path, store_new_wmt ); 1605 1606 transform_later(pf_region); 1607 transform_later(pf_phi_rawmem); 1608 transform_later(pf_phi_abio); 1609 1610 needgc_false = pf_region; 1611 contended_phi_rawmem = pf_phi_rawmem; 1612 i_o = pf_phi_abio; 1613 } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { 1614 // Insert a prefetch for each allocation only on the fast-path 1615 Node *pf_region = new (C, 3) RegionNode(3); 1616 Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, 1617 TypeRawPtr::BOTTOM ); 1618 1619 // Generate several prefetch instructions only for arrays. 1620 uint lines = (length != NULL) ? AllocatePrefetchLines : 1; 1621 uint step_size = AllocatePrefetchStepSize; 1622 uint distance = AllocatePrefetchDistance; 1623 1624 // Next cache address. 1625 Node *cache_adr = new (C, 4) AddPNode(old_eden_top, old_eden_top, 1626 _igvn.MakeConX(distance)); 1627 transform_later(cache_adr); 1628 cache_adr = new (C, 2) CastP2XNode(needgc_false, cache_adr); 1629 transform_later(cache_adr); 1630 Node* mask = _igvn.MakeConX(~(intptr_t)(step_size-1)); 1631 cache_adr = new (C, 3) AndXNode(cache_adr, mask); 1632 transform_later(cache_adr); 1633 cache_adr = new (C, 2) CastX2PNode(cache_adr); 1634 transform_later(cache_adr); 1635 1636 // Prefetch 1637 Node *prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, cache_adr ); 1638 prefetch->set_req(0, needgc_false); 1639 transform_later(prefetch); 1640 contended_phi_rawmem = prefetch; 1641 Node *prefetch_adr; 1642 distance = step_size; 1643 for ( uint i = 1; i < lines; i++ ) { 1644 prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr, 1645 _igvn.MakeConX(distance) ); 1646 transform_later(prefetch_adr); 1647 prefetch = new (C, 3) PrefetchWriteNode( contended_phi_rawmem, prefetch_adr ); 1648 transform_later(prefetch); 1649 distance += step_size; 1650 contended_phi_rawmem = prefetch; 1651 } 1652 } else if( AllocatePrefetchStyle > 0 ) { 1653 // Insert a prefetch for each allocation only on the fast-path 1654 Node *prefetch_adr; 1655 Node *prefetch; 1656 // Generate several prefetch instructions only for arrays. 1657 uint lines = (length != NULL) ? AllocatePrefetchLines : 1; 1658 uint step_size = AllocatePrefetchStepSize; 1659 uint distance = AllocatePrefetchDistance; 1660 for ( uint i = 0; i < lines; i++ ) { 1661 prefetch_adr = new (C, 4) AddPNode( old_eden_top, new_eden_top, 1662 _igvn.MakeConX(distance) ); 1663 transform_later(prefetch_adr); 1664 prefetch = new (C, 3) PrefetchWriteNode( i_o, prefetch_adr ); 1665 // Do not let it float too high, since if eden_top == eden_end, 1666 // both might be null. 1667 if( i == 0 ) { // Set control for first prefetch, next follows it 1668 prefetch->init_req(0, needgc_false); 1669 } 1670 transform_later(prefetch); 1671 distance += step_size; 1672 i_o = prefetch; 1673 } 1674 } 1675 return i_o; 1676 } 1677 1678 1679 void PhaseMacroExpand::expand_allocate(AllocateNode *alloc) { 1680 expand_allocate_common(alloc, NULL, 1681 OptoRuntime::new_instance_Type(), 1682 OptoRuntime::new_instance_Java()); 1683 } 1684 | 1573 new_pf_wmt->set_req(0, need_pf_true); 1574 1575 Node *store_new_wmt = new (C, 4) StorePNode( need_pf_true, 1576 contended_phi_rawmem, eden_pf_adr, 1577 TypeRawPtr::BOTTOM, new_pf_wmt ); 1578 transform_later(store_new_wmt); 1579 1580 // adding prefetches 1581 pf_phi_abio->init_req( fall_in_path, i_o ); 1582 1583 Node *prefetch_adr; 1584 Node *prefetch; 1585 uint lines = AllocatePrefetchDistance / AllocatePrefetchStepSize; 1586 uint step_size = AllocatePrefetchStepSize; 1587 uint distance = 0; 1588 1589 for ( uint i = 0; i < lines; i++ ) { 1590 prefetch_adr = new (C, 4) AddPNode( old_pf_wm, new_pf_wmt, 1591 _igvn.MakeConX(distance) ); 1592 transform_later(prefetch_adr); 1593 prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr ); 1594 transform_later(prefetch); 1595 distance += step_size; 1596 i_o = prefetch; 1597 } 1598 pf_phi_abio->set_req( pf_path, i_o ); 1599 1600 pf_region->init_req( fall_in_path, need_pf_false ); 1601 pf_region->init_req( pf_path, need_pf_true ); 1602 1603 pf_phi_rawmem->init_req( fall_in_path, contended_phi_rawmem ); 1604 pf_phi_rawmem->init_req( pf_path, store_new_wmt ); 1605 1606 transform_later(pf_region); 1607 transform_later(pf_phi_rawmem); 1608 transform_later(pf_phi_abio); 1609 1610 needgc_false = pf_region; 1611 contended_phi_rawmem = pf_phi_rawmem; 1612 i_o = pf_phi_abio; 1613 } else if( UseTLAB && AllocatePrefetchStyle == 3 ) { 1614 // Insert a prefetch for each allocation. 1615 // This code is used for Sparc with BIS. 1616 Node *pf_region = new (C, 3) RegionNode(3); 1617 Node *pf_phi_rawmem = new (C, 3) PhiNode( pf_region, Type::MEMORY, 1618 TypeRawPtr::BOTTOM ); 1619 1620 // Generate several prefetch instructions. 1621 uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines; 1622 uint step_size = AllocatePrefetchStepSize; 1623 uint distance = AllocatePrefetchDistance; 1624 1625 // Next cache address. 1626 Node *cache_adr = new (C, 4) AddPNode(old_eden_top, old_eden_top, 1627 _igvn.MakeConX(distance)); 1628 transform_later(cache_adr); 1629 cache_adr = new (C, 2) CastP2XNode(needgc_false, cache_adr); 1630 transform_later(cache_adr); 1631 Node* mask = _igvn.MakeConX(~(intptr_t)(step_size-1)); 1632 cache_adr = new (C, 3) AndXNode(cache_adr, mask); 1633 transform_later(cache_adr); 1634 cache_adr = new (C, 2) CastX2PNode(cache_adr); 1635 transform_later(cache_adr); 1636 1637 // Prefetch 1638 Node *prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, cache_adr ); 1639 prefetch->set_req(0, needgc_false); 1640 transform_later(prefetch); 1641 contended_phi_rawmem = prefetch; 1642 Node *prefetch_adr; 1643 distance = step_size; 1644 for ( uint i = 1; i < lines; i++ ) { 1645 prefetch_adr = new (C, 4) AddPNode( cache_adr, cache_adr, 1646 _igvn.MakeConX(distance) ); 1647 transform_later(prefetch_adr); 1648 prefetch = new (C, 3) PrefetchAllocationNode( contended_phi_rawmem, prefetch_adr ); 1649 transform_later(prefetch); 1650 distance += step_size; 1651 contended_phi_rawmem = prefetch; 1652 } 1653 } else if( AllocatePrefetchStyle > 0 ) { 1654 // Insert a prefetch for each allocation only on the fast-path 1655 Node *prefetch_adr; 1656 Node *prefetch; 1657 // Generate several prefetch instructions. 1658 uint lines = (length != NULL) ? AllocatePrefetchLines : AllocateInstancePrefetchLines; 1659 uint step_size = AllocatePrefetchStepSize; 1660 uint distance = AllocatePrefetchDistance; 1661 for ( uint i = 0; i < lines; i++ ) { 1662 prefetch_adr = new (C, 4) AddPNode( old_eden_top, new_eden_top, 1663 _igvn.MakeConX(distance) ); 1664 transform_later(prefetch_adr); 1665 prefetch = new (C, 3) PrefetchAllocationNode( i_o, prefetch_adr ); 1666 // Do not let it float too high, since if eden_top == eden_end, 1667 // both might be null. 1668 if( i == 0 ) { // Set control for first prefetch, next follows it 1669 prefetch->init_req(0, needgc_false); 1670 } 1671 transform_later(prefetch); 1672 distance += step_size; 1673 i_o = prefetch; 1674 } 1675 } 1676 return i_o; 1677 } 1678 1679 1680 void PhaseMacroExpand::expand_allocate(AllocateNode *alloc) { 1681 expand_allocate_common(alloc, NULL, 1682 OptoRuntime::new_instance_Type(), 1683 OptoRuntime::new_instance_Java()); 1684 } 1685 |