767 case T_DOUBLE: return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt ); |
767 case T_DOUBLE: return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt ); |
768 case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr() ); |
768 case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr() ); |
769 case T_OBJECT: |
769 case T_OBJECT: |
770 #ifdef _LP64 |
770 #ifdef _LP64 |
771 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
771 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
772 const TypeNarrowOop* narrowtype; |
772 Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); |
773 if (rt->isa_narrowoop()) { |
773 return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr()); |
774 narrowtype = rt->is_narrowoop(); |
|
775 } else { |
|
776 narrowtype = rt->is_oopptr()->make_narrowoop(); |
|
777 } |
|
778 Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, narrowtype)); |
|
779 |
|
780 return DecodeNNode::decode(&gvn, load); |
|
781 } else |
774 } else |
782 #endif |
775 #endif |
783 { |
776 { |
784 assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop"); |
777 assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop"); |
785 return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); |
778 return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); |
1629 // sanity check the alias category against the created node type |
1622 // sanity check the alias category against the created node type |
1630 const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr(); |
1623 const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr(); |
1631 assert(adr_type != NULL, "expecting TypeOopPtr"); |
1624 assert(adr_type != NULL, "expecting TypeOopPtr"); |
1632 #ifdef _LP64 |
1625 #ifdef _LP64 |
1633 if (adr_type->is_ptr_to_narrowoop()) { |
1626 if (adr_type->is_ptr_to_narrowoop()) { |
1634 const TypeNarrowOop* narrowtype = tk->is_oopptr()->make_narrowoop(); |
1627 Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop())); |
1635 Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, narrowtype)); |
1628 return new (C, 2) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr()); |
1636 return DecodeNNode::decode(&gvn, load_klass); |
|
1637 } |
1629 } |
1638 #endif |
1630 #endif |
1639 assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop"); |
1631 assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop"); |
1640 return new (C, 3) LoadKlassNode(ctl, mem, adr, at, tk); |
1632 return new (C, 3) LoadKlassNode(ctl, mem, adr, at, tk); |
1641 } |
1633 } |
1841 |
1833 |
1842 |
1834 |
1843 //------------------------------Value------------------------------------------ |
1835 //------------------------------Value------------------------------------------ |
1844 const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { |
1836 const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { |
1845 const Type *t = klass_value_common(phase); |
1837 const Type *t = klass_value_common(phase); |
1846 |
1838 if (t == Type::TOP) |
1847 if (t == TypePtr::NULL_PTR) { |
1839 return t; |
1848 return TypeNarrowOop::NULL_PTR; |
1840 |
1849 } |
1841 return t->make_narrowoop(); |
1850 if (t != Type::TOP && !t->isa_narrowoop()) { |
|
1851 assert(t->is_oopptr(), "sanity"); |
|
1852 t = t->is_oopptr()->make_narrowoop(); |
|
1853 } |
|
1854 return t; |
|
1855 } |
1842 } |
1856 |
1843 |
1857 //------------------------------Identity--------------------------------------- |
1844 //------------------------------Identity--------------------------------------- |
1858 // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. |
1845 // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. |
1859 // Also feed through the klass in Allocate(...klass...)._klass. |
1846 // Also feed through the klass in Allocate(...klass...)._klass. |
1862 |
1849 |
1863 const Type *t = phase->type( x ); |
1850 const Type *t = phase->type( x ); |
1864 if( t == Type::TOP ) return x; |
1851 if( t == Type::TOP ) return x; |
1865 if( t->isa_narrowoop()) return x; |
1852 if( t->isa_narrowoop()) return x; |
1866 |
1853 |
1867 return EncodePNode::encode(phase, x); |
1854 return phase->transform(new (phase->C, 2) EncodePNode(x, t->make_narrowoop())); |
1868 } |
1855 } |
1869 |
1856 |
1870 //------------------------------Value----------------------------------------- |
1857 //------------------------------Value----------------------------------------- |
1871 const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { |
1858 const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { |
1872 // Either input is TOP ==> the result is TOP |
1859 // Either input is TOP ==> the result is TOP |
1928 case T_OBJECT: |
1915 case T_OBJECT: |
1929 #ifdef _LP64 |
1916 #ifdef _LP64 |
1930 if (adr->bottom_type()->is_ptr_to_narrowoop() || |
1917 if (adr->bottom_type()->is_ptr_to_narrowoop() || |
1931 (UseCompressedOops && val->bottom_type()->isa_klassptr() && |
1918 (UseCompressedOops && val->bottom_type()->isa_klassptr() && |
1932 adr->bottom_type()->isa_rawptr())) { |
1919 adr->bottom_type()->isa_rawptr())) { |
1933 const TypePtr* type = val->bottom_type()->is_ptr(); |
1920 val = gvn.transform(new (C, 2) EncodePNode(val, val->bottom_type()->make_narrowoop())); |
1934 Node* cp = EncodePNode::encode(&gvn, val); |
1921 return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, val); |
1935 return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, cp); |
|
1936 } else |
1922 } else |
1937 #endif |
1923 #endif |
1938 { |
1924 { |
1939 return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val); |
1925 return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val); |
1940 } |
1926 } |
1941 } |
1927 } |
1942 ShouldNotReachHere(); |
1928 ShouldNotReachHere(); |
1943 return (StoreNode*)NULL; |
1929 return (StoreNode*)NULL; |
1944 } |
1930 } |
1945 |
1931 |