< prev index next >

src/hotspot/share/opto/graphKit.cpp

Print this page




1549                                 const TypePtr* adr_type,
1550                                 Node* val,
1551                                 const Type* val_type,
1552                                 BasicType bt,
1553                                 DecoratorSet decorators) {
1554   // Transformation of a value which could be NULL pointer (CastPP #NULL)
1555   // could be delayed during Parse (for example, in adjust_map_after_if()).
1556   // Execute transformation here to avoid barrier generation in such case.
1557   if (_gvn.type(val) == TypePtr::NULL_PTR) {
1558     val = _gvn.makecon(TypePtr::NULL_PTR);
1559   }
1560 
1561   if (stopped()) {
1562     return top(); // Dead path ?
1563   }
1564 
1565   assert(val != NULL, "not dead path");
1566 
1567   C2AccessValuePtr addr(adr, adr_type);
1568   C2AccessValue value(val, val_type);
1569   C2Access access(this, decorators | C2_WRITE_ACCESS, bt, obj, addr);
1570   if (access.is_raw()) {
1571     return _barrier_set->BarrierSetC2::store_at(access, value);
1572   } else {
1573     return _barrier_set->store_at(access, value);
1574   }
1575 }
1576 
1577 Node* GraphKit::access_load_at(Node* obj,   // containing obj
1578                                Node* adr,   // actual adress to store val at
1579                                const TypePtr* adr_type,
1580                                const Type* val_type,
1581                                BasicType bt,
1582                                DecoratorSet decorators) {
1583   if (stopped()) {
1584     return top(); // Dead path ?
1585   }
1586 
1587   C2AccessValuePtr addr(adr, adr_type);
1588   C2Access access(this, decorators | C2_READ_ACCESS, bt, obj, addr);
1589   if (access.is_raw()) {
1590     return _barrier_set->BarrierSetC2::load_at(access, val_type);
1591   } else {
1592     return _barrier_set->load_at(access, val_type);
1593   }
1594 }
1595 
1596 Node* GraphKit::access_load(Node* adr,   // actual adress to load val at
1597                             const Type* val_type,
1598                             BasicType bt,
1599                             DecoratorSet decorators) {
1600   if (stopped()) {
1601     return top(); // Dead path ?
1602   }
1603 
1604   C2AccessValuePtr addr(adr, NULL);
1605   C2Access access(this, decorators | C2_READ_ACCESS, bt, NULL, addr);
1606   if (access.is_raw()) {
1607     return _barrier_set->BarrierSetC2::load_at(access, val_type);
1608   } else {
1609     return _barrier_set->load_at(access, val_type);
1610   }
1611 }
1612 
1613 Node* GraphKit::access_atomic_cmpxchg_val_at(Node* obj,
1614                                              Node* adr,
1615                                              const TypePtr* adr_type,
1616                                              int alias_idx,
1617                                              Node* expected_val,
1618                                              Node* new_val,
1619                                              const Type* value_type,
1620                                              BasicType bt,
1621                                              DecoratorSet decorators) {
1622   C2AccessValuePtr addr(adr, adr_type);
1623   C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1624                         bt, obj, addr, alias_idx);
1625   if (access.is_raw()) {
1626     return _barrier_set->BarrierSetC2::atomic_cmpxchg_val_at(access, expected_val, new_val, value_type);
1627   } else {
1628     return _barrier_set->atomic_cmpxchg_val_at(access, expected_val, new_val, value_type);
1629   }
1630 }
1631 
1632 Node* GraphKit::access_atomic_cmpxchg_bool_at(Node* obj,
1633                                               Node* adr,
1634                                               const TypePtr* adr_type,
1635                                               int alias_idx,
1636                                               Node* expected_val,
1637                                               Node* new_val,
1638                                               const Type* value_type,
1639                                               BasicType bt,
1640                                               DecoratorSet decorators) {
1641   C2AccessValuePtr addr(adr, adr_type);
1642   C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1643                         bt, obj, addr, alias_idx);
1644   if (access.is_raw()) {
1645     return _barrier_set->BarrierSetC2::atomic_cmpxchg_bool_at(access, expected_val, new_val, value_type);
1646   } else {
1647     return _barrier_set->atomic_cmpxchg_bool_at(access, expected_val, new_val, value_type);
1648   }
1649 }
1650 
1651 Node* GraphKit::access_atomic_xchg_at(Node* obj,
1652                                       Node* adr,
1653                                       const TypePtr* adr_type,
1654                                       int alias_idx,
1655                                       Node* new_val,
1656                                       const Type* value_type,
1657                                       BasicType bt,
1658                                       DecoratorSet decorators) {
1659   C2AccessValuePtr addr(adr, adr_type);
1660   C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1661                         bt, obj, addr, alias_idx);
1662   if (access.is_raw()) {
1663     return _barrier_set->BarrierSetC2::atomic_xchg_at(access, new_val, value_type);
1664   } else {
1665     return _barrier_set->atomic_xchg_at(access, new_val, value_type);
1666   }
1667 }
1668 
1669 Node* GraphKit::access_atomic_add_at(Node* obj,
1670                                      Node* adr,
1671                                      const TypePtr* adr_type,
1672                                      int alias_idx,
1673                                      Node* new_val,
1674                                      const Type* value_type,
1675                                      BasicType bt,
1676                                      DecoratorSet decorators) {
1677   C2AccessValuePtr addr(adr, adr_type);
1678   C2AtomicAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS, bt, obj, addr, alias_idx);
1679   if (access.is_raw()) {
1680     return _barrier_set->BarrierSetC2::atomic_add_at(access, new_val, value_type);
1681   } else {
1682     return _barrier_set->atomic_add_at(access, new_val, value_type);
1683   }
1684 }
1685 
1686 void GraphKit::access_clone(Node* src, Node* dst, Node* size, bool is_array) {
1687   return _barrier_set->clone(this, src, dst, size, is_array);
1688 }
1689 
1690 Node* GraphKit::access_resolve(Node* n, DecoratorSet decorators) {
1691   // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1692   if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1693     decorators |= ACCESS_READ | ACCESS_WRITE;
1694   }
1695   return _barrier_set->resolve(this, n, decorators);
1696 }
1697 
1698 //-------------------------array_element_address-------------------------




1549                                 const TypePtr* adr_type,
1550                                 Node* val,
1551                                 const Type* val_type,
1552                                 BasicType bt,
1553                                 DecoratorSet decorators) {
1554   // Transformation of a value which could be NULL pointer (CastPP #NULL)
1555   // could be delayed during Parse (for example, in adjust_map_after_if()).
1556   // Execute transformation here to avoid barrier generation in such case.
1557   if (_gvn.type(val) == TypePtr::NULL_PTR) {
1558     val = _gvn.makecon(TypePtr::NULL_PTR);
1559   }
1560 
1561   if (stopped()) {
1562     return top(); // Dead path ?
1563   }
1564 
1565   assert(val != NULL, "not dead path");
1566 
1567   C2AccessValuePtr addr(adr, adr_type);
1568   C2AccessValue value(val, val_type);
1569   C2ParseAccess access(this, decorators | C2_WRITE_ACCESS, bt, obj, addr);
1570   if (access.is_raw()) {
1571     return _barrier_set->BarrierSetC2::store_at(access, value);
1572   } else {
1573     return _barrier_set->store_at(access, value);
1574   }
1575 }
1576 
1577 Node* GraphKit::access_load_at(Node* obj,   // containing obj
1578                                Node* adr,   // actual adress to store val at
1579                                const TypePtr* adr_type,
1580                                const Type* val_type,
1581                                BasicType bt,
1582                                DecoratorSet decorators) {
1583   if (stopped()) {
1584     return top(); // Dead path ?
1585   }
1586 
1587   C2AccessValuePtr addr(adr, adr_type);
1588   C2ParseAccess access(this, decorators | C2_READ_ACCESS, bt, obj, addr);
1589   if (access.is_raw()) {
1590     return _barrier_set->BarrierSetC2::load_at(access, val_type);
1591   } else {
1592     return _barrier_set->load_at(access, val_type);
1593   }
1594 }
1595 
1596 Node* GraphKit::access_load(Node* adr,   // actual adress to load val at
1597                             const Type* val_type,
1598                             BasicType bt,
1599                             DecoratorSet decorators) {
1600   if (stopped()) {
1601     return top(); // Dead path ?
1602   }
1603 
1604   C2AccessValuePtr addr(adr, NULL);
1605   C2ParseAccess access(this, decorators | C2_READ_ACCESS, bt, NULL, addr);
1606   if (access.is_raw()) {
1607     return _barrier_set->BarrierSetC2::load_at(access, val_type);
1608   } else {
1609     return _barrier_set->load_at(access, val_type);
1610   }
1611 }
1612 
1613 Node* GraphKit::access_atomic_cmpxchg_val_at(Node* obj,
1614                                              Node* adr,
1615                                              const TypePtr* adr_type,
1616                                              int alias_idx,
1617                                              Node* expected_val,
1618                                              Node* new_val,
1619                                              const Type* value_type,
1620                                              BasicType bt,
1621                                              DecoratorSet decorators) {
1622   C2AccessValuePtr addr(adr, adr_type);
1623   C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1624                         bt, obj, addr, alias_idx);
1625   if (access.is_raw()) {
1626     return _barrier_set->BarrierSetC2::atomic_cmpxchg_val_at(access, expected_val, new_val, value_type);
1627   } else {
1628     return _barrier_set->atomic_cmpxchg_val_at(access, expected_val, new_val, value_type);
1629   }
1630 }
1631 
1632 Node* GraphKit::access_atomic_cmpxchg_bool_at(Node* obj,
1633                                               Node* adr,
1634                                               const TypePtr* adr_type,
1635                                               int alias_idx,
1636                                               Node* expected_val,
1637                                               Node* new_val,
1638                                               const Type* value_type,
1639                                               BasicType bt,
1640                                               DecoratorSet decorators) {
1641   C2AccessValuePtr addr(adr, adr_type);
1642   C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1643                         bt, obj, addr, alias_idx);
1644   if (access.is_raw()) {
1645     return _barrier_set->BarrierSetC2::atomic_cmpxchg_bool_at(access, expected_val, new_val, value_type);
1646   } else {
1647     return _barrier_set->atomic_cmpxchg_bool_at(access, expected_val, new_val, value_type);
1648   }
1649 }
1650 
1651 Node* GraphKit::access_atomic_xchg_at(Node* obj,
1652                                       Node* adr,
1653                                       const TypePtr* adr_type,
1654                                       int alias_idx,
1655                                       Node* new_val,
1656                                       const Type* value_type,
1657                                       BasicType bt,
1658                                       DecoratorSet decorators) {
1659   C2AccessValuePtr addr(adr, adr_type);
1660   C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS,
1661                         bt, obj, addr, alias_idx);
1662   if (access.is_raw()) {
1663     return _barrier_set->BarrierSetC2::atomic_xchg_at(access, new_val, value_type);
1664   } else {
1665     return _barrier_set->atomic_xchg_at(access, new_val, value_type);
1666   }
1667 }
1668 
1669 Node* GraphKit::access_atomic_add_at(Node* obj,
1670                                      Node* adr,
1671                                      const TypePtr* adr_type,
1672                                      int alias_idx,
1673                                      Node* new_val,
1674                                      const Type* value_type,
1675                                      BasicType bt,
1676                                      DecoratorSet decorators) {
1677   C2AccessValuePtr addr(adr, adr_type);
1678   C2AtomicParseAccess access(this, decorators | C2_READ_ACCESS | C2_WRITE_ACCESS, bt, obj, addr, alias_idx);
1679   if (access.is_raw()) {
1680     return _barrier_set->BarrierSetC2::atomic_add_at(access, new_val, value_type);
1681   } else {
1682     return _barrier_set->atomic_add_at(access, new_val, value_type);
1683   }
1684 }
1685 
1686 void GraphKit::access_clone(Node* src, Node* dst, Node* size, bool is_array) {
1687   return _barrier_set->clone(this, src, dst, size, is_array);
1688 }
1689 
1690 Node* GraphKit::access_resolve(Node* n, DecoratorSet decorators) {
1691   // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1692   if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1693     decorators |= ACCESS_READ | ACCESS_WRITE;
1694   }
1695   return _barrier_set->resolve(this, n, decorators);
1696 }
1697 
1698 //-------------------------array_element_address-------------------------


< prev index next >