Mercurial > hg > graal-compiler
comparison src/share/vm/opto/memnode.cpp @ 4821:52474ec73861
7132936: guarantee(t != NULL) failed: must be con
Summary: Use !higher_equal() check to skip top and values which fit.
Reviewed-by: never
author | kvn |
---|---|
date | Tue, 24 Jan 2012 17:04:51 -0800 |
parents | 53a127075045 |
children | 0919b2e7895d |
comparison
equal
deleted
inserted
replaced
4819:dddf0be88eb1 | 4821:52474ec73861 |
---|---|
1762 } | 1762 } |
1763 | 1763 |
1764 const Type* LoadBNode::Value(PhaseTransform *phase) const { | 1764 const Type* LoadBNode::Value(PhaseTransform *phase) const { |
1765 Node* mem = in(MemNode::Memory); | 1765 Node* mem = in(MemNode::Memory); |
1766 Node* value = can_see_stored_value(mem,phase); | 1766 Node* value = can_see_stored_value(mem,phase); |
1767 if (value != NULL && value->is_Con()) { | 1767 if (value != NULL && value->is_Con() && |
1768 !value->bottom_type()->higher_equal(_type)) { | |
1768 // If the input to the store does not fit with the load's result type, | 1769 // If the input to the store does not fit with the load's result type, |
1769 // it must be truncated. We can't delay until Ideal call since | 1770 // it must be truncated. We can't delay until Ideal call since |
1770 // a singleton Value is needed for split_thru_phi optimization. | 1771 // a singleton Value is needed for split_thru_phi optimization. |
1771 int con = value->get_int(); | 1772 int con = value->get_int(); |
1772 return TypeInt::make((con << 24) >> 24); | 1773 return TypeInt::make((con << 24) >> 24); |
1791 } | 1792 } |
1792 | 1793 |
1793 const Type* LoadUBNode::Value(PhaseTransform *phase) const { | 1794 const Type* LoadUBNode::Value(PhaseTransform *phase) const { |
1794 Node* mem = in(MemNode::Memory); | 1795 Node* mem = in(MemNode::Memory); |
1795 Node* value = can_see_stored_value(mem,phase); | 1796 Node* value = can_see_stored_value(mem,phase); |
1796 if (value != NULL && value->is_Con()) { | 1797 if (value != NULL && value->is_Con() && |
1798 !value->bottom_type()->higher_equal(_type)) { | |
1797 // If the input to the store does not fit with the load's result type, | 1799 // If the input to the store does not fit with the load's result type, |
1798 // it must be truncated. We can't delay until Ideal call since | 1800 // it must be truncated. We can't delay until Ideal call since |
1799 // a singleton Value is needed for split_thru_phi optimization. | 1801 // a singleton Value is needed for split_thru_phi optimization. |
1800 int con = value->get_int(); | 1802 int con = value->get_int(); |
1801 return TypeInt::make(con & 0xFF); | 1803 return TypeInt::make(con & 0xFF); |
1820 } | 1822 } |
1821 | 1823 |
1822 const Type* LoadUSNode::Value(PhaseTransform *phase) const { | 1824 const Type* LoadUSNode::Value(PhaseTransform *phase) const { |
1823 Node* mem = in(MemNode::Memory); | 1825 Node* mem = in(MemNode::Memory); |
1824 Node* value = can_see_stored_value(mem,phase); | 1826 Node* value = can_see_stored_value(mem,phase); |
1825 if (value != NULL && value->is_Con()) { | 1827 if (value != NULL && value->is_Con() && |
1828 !value->bottom_type()->higher_equal(_type)) { | |
1826 // If the input to the store does not fit with the load's result type, | 1829 // If the input to the store does not fit with the load's result type, |
1827 // it must be truncated. We can't delay until Ideal call since | 1830 // it must be truncated. We can't delay until Ideal call since |
1828 // a singleton Value is needed for split_thru_phi optimization. | 1831 // a singleton Value is needed for split_thru_phi optimization. |
1829 int con = value->get_int(); | 1832 int con = value->get_int(); |
1830 return TypeInt::make(con & 0xFFFF); | 1833 return TypeInt::make(con & 0xFFFF); |
1851 } | 1854 } |
1852 | 1855 |
1853 const Type* LoadSNode::Value(PhaseTransform *phase) const { | 1856 const Type* LoadSNode::Value(PhaseTransform *phase) const { |
1854 Node* mem = in(MemNode::Memory); | 1857 Node* mem = in(MemNode::Memory); |
1855 Node* value = can_see_stored_value(mem,phase); | 1858 Node* value = can_see_stored_value(mem,phase); |
1856 if (value != NULL && value->is_Con()) { | 1859 if (value != NULL && value->is_Con() && |
1860 !value->bottom_type()->higher_equal(_type)) { | |
1857 // If the input to the store does not fit with the load's result type, | 1861 // If the input to the store does not fit with the load's result type, |
1858 // it must be truncated. We can't delay until Ideal call since | 1862 // it must be truncated. We can't delay until Ideal call since |
1859 // a singleton Value is needed for split_thru_phi optimization. | 1863 // a singleton Value is needed for split_thru_phi optimization. |
1860 int con = value->get_int(); | 1864 int con = value->get_int(); |
1861 return TypeInt::make((con << 16) >> 16); | 1865 return TypeInt::make((con << 16) >> 16); |