Mercurial > hg > graal-compiler
comparison src/share/vm/opto/memnode.cpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | d804e148cff8 |
children | 00af3a3a8df4 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
712 case Op_AddP: // No change to NULL-ness, so peek thru AddP's | 712 case Op_AddP: // No change to NULL-ness, so peek thru AddP's |
713 adr = adr->in(AddPNode::Base); | 713 adr = adr->in(AddPNode::Base); |
714 continue; | 714 continue; |
715 | 715 |
716 case Op_DecodeN: // No change to NULL-ness, so peek thru | 716 case Op_DecodeN: // No change to NULL-ness, so peek thru |
717 case Op_DecodeNKlass: | |
717 adr = adr->in(1); | 718 adr = adr->in(1); |
718 continue; | 719 continue; |
719 | 720 |
720 case Op_EncodeP: | 721 case Op_EncodeP: |
722 case Op_EncodePKlass: | |
721 // EncodeP node's control edge could be set by this method | 723 // EncodeP node's control edge could be set by this method |
722 // when EncodeP node depends on CastPP node. | 724 // when EncodeP node depends on CastPP node. |
723 // | 725 // |
724 // Use its control edge for memory op because EncodeP may go away | 726 // Use its control edge for memory op because EncodeP may go away |
725 // later when it is folded with following or preceding DecodeN node. | 727 // later when it is folded with following or preceding DecodeN node. |
792 case Op_LoadN: // Loading from within a klass | 794 case Op_LoadN: // Loading from within a klass |
793 case Op_LoadKlass: // Loading from within a klass | 795 case Op_LoadKlass: // Loading from within a klass |
794 case Op_LoadNKlass: // Loading from within a klass | 796 case Op_LoadNKlass: // Loading from within a klass |
795 case Op_ConP: // Loading from a klass | 797 case Op_ConP: // Loading from a klass |
796 case Op_ConN: // Loading from a klass | 798 case Op_ConN: // Loading from a klass |
799 case Op_ConNKlass: // Loading from a klass | |
797 case Op_CreateEx: // Sucking up the guts of an exception oop | 800 case Op_CreateEx: // Sucking up the guts of an exception oop |
798 case Op_Con: // Reading from TLS | 801 case Op_Con: // Reading from TLS |
799 case Op_CMoveP: // CMoveP is pinned | 802 case Op_CMoveP: // CMoveP is pinned |
800 case Op_CMoveN: // CMoveN is pinned | 803 case Op_CMoveN: // CMoveN is pinned |
801 break; // No progress | 804 break; // No progress |
839 uint LoadNode::size_of() const { return sizeof(*this); } | 842 uint LoadNode::size_of() const { return sizeof(*this); } |
840 uint LoadNode::cmp( const Node &n ) const | 843 uint LoadNode::cmp( const Node &n ) const |
841 { return !Type::cmp( _type, ((LoadNode&)n)._type ); } | 844 { return !Type::cmp( _type, ((LoadNode&)n)._type ); } |
842 const Type *LoadNode::bottom_type() const { return _type; } | 845 const Type *LoadNode::bottom_type() const { return _type; } |
843 uint LoadNode::ideal_reg() const { | 846 uint LoadNode::ideal_reg() const { |
844 return Matcher::base2reg[_type->base()]; | 847 return _type->ideal_reg(); |
845 } | 848 } |
846 | 849 |
847 #ifndef PRODUCT | 850 #ifndef PRODUCT |
848 void LoadNode::dump_spec(outputStream *st) const { | 851 void LoadNode::dump_spec(outputStream *st) const { |
849 MemNode::dump_spec(st); | 852 MemNode::dump_spec(st); |
881 assert( ctl != NULL || C->get_alias_index(adr_type) != Compile::AliasIdxRaw || | 884 assert( ctl != NULL || C->get_alias_index(adr_type) != Compile::AliasIdxRaw || |
882 // oop will be recorded in oop map if load crosses safepoint | 885 // oop will be recorded in oop map if load crosses safepoint |
883 rt->isa_oopptr() || is_immutable_value(adr), | 886 rt->isa_oopptr() || is_immutable_value(adr), |
884 "raw memory operations should have control edge"); | 887 "raw memory operations should have control edge"); |
885 switch (bt) { | 888 switch (bt) { |
886 case T_BOOLEAN: return new (C, 3) LoadUBNode(ctl, mem, adr, adr_type, rt->is_int() ); | 889 case T_BOOLEAN: return new (C) LoadUBNode(ctl, mem, adr, adr_type, rt->is_int() ); |
887 case T_BYTE: return new (C, 3) LoadBNode (ctl, mem, adr, adr_type, rt->is_int() ); | 890 case T_BYTE: return new (C) LoadBNode (ctl, mem, adr, adr_type, rt->is_int() ); |
888 case T_INT: return new (C, 3) LoadINode (ctl, mem, adr, adr_type, rt->is_int() ); | 891 case T_INT: return new (C) LoadINode (ctl, mem, adr, adr_type, rt->is_int() ); |
889 case T_CHAR: return new (C, 3) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int() ); | 892 case T_CHAR: return new (C) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int() ); |
890 case T_SHORT: return new (C, 3) LoadSNode (ctl, mem, adr, adr_type, rt->is_int() ); | 893 case T_SHORT: return new (C) LoadSNode (ctl, mem, adr, adr_type, rt->is_int() ); |
891 case T_LONG: return new (C, 3) LoadLNode (ctl, mem, adr, adr_type, rt->is_long() ); | 894 case T_LONG: return new (C) LoadLNode (ctl, mem, adr, adr_type, rt->is_long() ); |
892 case T_FLOAT: return new (C, 3) LoadFNode (ctl, mem, adr, adr_type, rt ); | 895 case T_FLOAT: return new (C) LoadFNode (ctl, mem, adr, adr_type, rt ); |
893 case T_DOUBLE: return new (C, 3) LoadDNode (ctl, mem, adr, adr_type, rt ); | 896 case T_DOUBLE: return new (C) LoadDNode (ctl, mem, adr, adr_type, rt ); |
894 case T_ADDRESS: return new (C, 3) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr() ); | 897 case T_ADDRESS: return new (C) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr() ); |
895 case T_OBJECT: | 898 case T_OBJECT: |
896 #ifdef _LP64 | 899 #ifdef _LP64 |
897 if (adr->bottom_type()->is_ptr_to_narrowoop()) { | 900 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
898 Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); | 901 Node* load = gvn.transform(new (C) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); |
899 return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr()); | 902 return new (C) DecodeNNode(load, load->bottom_type()->make_ptr()); |
900 } else | 903 } else |
901 #endif | 904 #endif |
902 { | 905 { |
903 assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop"); | 906 assert(!adr->bottom_type()->is_ptr_to_narrowoop() && !adr->bottom_type()->is_ptr_to_narrowklass(), "should have got back a narrow oop"); |
904 return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); | 907 return new (C) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); |
905 } | 908 } |
906 } | 909 } |
907 ShouldNotReachHere(); | 910 ShouldNotReachHere(); |
908 return (LoadNode*)NULL; | 911 return (LoadNode*)NULL; |
909 } | 912 } |
910 | 913 |
911 LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt) { | 914 LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt) { |
912 bool require_atomic = true; | 915 bool require_atomic = true; |
913 return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), require_atomic); | 916 return new (C) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), require_atomic); |
914 } | 917 } |
915 | 918 |
916 | 919 |
917 | 920 |
918 | 921 |
1242 if (count > 0 && fetch_autobox_base(atp, cache_low)) { | 1245 if (count > 0 && fetch_autobox_base(atp, cache_low)) { |
1243 int offset = arrayOopDesc::base_offset_in_bytes(memory_type()) - (cache_low << shift); | 1246 int offset = arrayOopDesc::base_offset_in_bytes(memory_type()) - (cache_low << shift); |
1244 // Add up all the offsets making of the address of the load | 1247 // Add up all the offsets making of the address of the load |
1245 Node* result = elements[0]; | 1248 Node* result = elements[0]; |
1246 for (int i = 1; i < count; i++) { | 1249 for (int i = 1; i < count; i++) { |
1247 result = phase->transform(new (phase->C, 3) AddXNode(result, elements[i])); | 1250 result = phase->transform(new (phase->C) AddXNode(result, elements[i])); |
1248 } | 1251 } |
1249 // Remove the constant offset from the address and then | 1252 // Remove the constant offset from the address and then |
1250 // remove the scaling of the offset to recover the original index. | 1253 // remove the scaling of the offset to recover the original index. |
1251 result = phase->transform(new (phase->C, 3) AddXNode(result, phase->MakeConX(-offset))); | 1254 result = phase->transform(new (phase->C) AddXNode(result, phase->MakeConX(-offset))); |
1252 if (result->Opcode() == Op_LShiftX && result->in(2) == phase->intcon(shift)) { | 1255 if (result->Opcode() == Op_LShiftX && result->in(2) == phase->intcon(shift)) { |
1253 // Peel the shift off directly but wrap it in a dummy node | 1256 // Peel the shift off directly but wrap it in a dummy node |
1254 // since Ideal can't return existing nodes | 1257 // since Ideal can't return existing nodes |
1255 result = new (phase->C, 3) RShiftXNode(result->in(1), phase->intcon(0)); | 1258 result = new (phase->C) RShiftXNode(result->in(1), phase->intcon(0)); |
1256 } else { | 1259 } else { |
1257 result = new (phase->C, 3) RShiftXNode(result, phase->intcon(shift)); | 1260 result = new (phase->C) RShiftXNode(result, phase->intcon(shift)); |
1258 } | 1261 } |
1259 #ifdef _LP64 | 1262 #ifdef _LP64 |
1260 result = new (phase->C, 2) ConvL2INode(phase->transform(result)); | 1263 result = new (phase->C) ConvL2INode(phase->transform(result)); |
1261 #endif | 1264 #endif |
1262 return result; | 1265 return result; |
1263 } | 1266 } |
1264 } | 1267 } |
1265 } | 1268 } |
1318 const Type* this_type = this->bottom_type(); | 1321 const Type* this_type = this->bottom_type(); |
1319 int this_index = phase->C->get_alias_index(addr_t); | 1322 int this_index = phase->C->get_alias_index(addr_t); |
1320 int this_offset = addr_t->offset(); | 1323 int this_offset = addr_t->offset(); |
1321 int this_iid = addr_t->is_oopptr()->instance_id(); | 1324 int this_iid = addr_t->is_oopptr()->instance_id(); |
1322 PhaseIterGVN *igvn = phase->is_IterGVN(); | 1325 PhaseIterGVN *igvn = phase->is_IterGVN(); |
1323 Node *phi = new (igvn->C, region->req()) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset); | 1326 Node *phi = new (igvn->C) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset); |
1324 for (uint i = 1; i < region->req(); i++) { | 1327 for (uint i = 1; i < region->req(); i++) { |
1325 Node *x; | 1328 Node *x; |
1326 Node* the_clone = NULL; | 1329 Node* the_clone = NULL; |
1327 if (region->in(i) == phase->C->top()) { | 1330 if (region->in(i) == phase->C->top()) { |
1328 x = phase->C->top(); // Dead path? Use a dead data op | 1331 x = phase->C->top(); // Dead path? Use a dead data op |
1658 // (Folds up type checking code.) | 1661 // (Folds up type checking code.) |
1659 assert(Opcode() == Op_LoadI, "must load an int from _super_check_offset"); | 1662 assert(Opcode() == Op_LoadI, "must load an int from _super_check_offset"); |
1660 return TypeInt::make(klass->super_check_offset()); | 1663 return TypeInt::make(klass->super_check_offset()); |
1661 } | 1664 } |
1662 // Compute index into primary_supers array | 1665 // Compute index into primary_supers array |
1663 juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(klassOop); | 1666 juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(Klass*); |
1664 // Check for overflowing; use unsigned compare to handle the negative case. | 1667 // Check for overflowing; use unsigned compare to handle the negative case. |
1665 if( depth < ciKlass::primary_super_limit() ) { | 1668 if( depth < ciKlass::primary_super_limit() ) { |
1666 // The field is an element of Klass::_primary_supers. Return its (constant) value. | 1669 // The field is an element of Klass::_primary_supers. Return its (constant) value. |
1667 // (Folds up type checking code.) | 1670 // (Folds up type checking code.) |
1668 assert(Opcode() == Op_LoadKlass, "must load a klass from _primary_supers"); | 1671 assert(Opcode() == Op_LoadKlass, "must load a klass from _primary_supers"); |
1669 ciKlass *ss = klass->super_of_depth(depth); | 1672 ciKlass *ss = klass->super_of_depth(depth); |
1670 return ss ? TypeKlassPtr::make(ss) : TypePtr::NULL_PTR; | 1673 return ss ? TypeKlassPtr::make(ss) : TypePtr::NULL_PTR; |
1671 } | 1674 } |
1672 const Type* aift = load_array_final_field(tkls, klass); | 1675 const Type* aift = load_array_final_field(tkls, klass); |
1673 if (aift != NULL) return aift; | 1676 if (aift != NULL) return aift; |
1674 if (tkls->offset() == in_bytes(arrayKlass::component_mirror_offset()) | 1677 if (tkls->offset() == in_bytes(ArrayKlass::component_mirror_offset()) |
1675 && klass->is_array_klass()) { | 1678 && klass->is_array_klass()) { |
1676 // The field is arrayKlass::_component_mirror. Return its (constant) value. | 1679 // The field is ArrayKlass::_component_mirror. Return its (constant) value. |
1677 // (Folds up aClassConstant.getComponentType, common in Arrays.copyOf.) | 1680 // (Folds up aClassConstant.getComponentType, common in Arrays.copyOf.) |
1678 assert(Opcode() == Op_LoadP, "must load an oop from _component_mirror"); | 1681 assert(Opcode() == Op_LoadP, "must load an oop from _component_mirror"); |
1679 return TypeInstPtr::make(klass->as_array_klass()->component_mirror()); | 1682 return TypeInstPtr::make(klass->as_array_klass()->component_mirror()); |
1680 } | 1683 } |
1681 if (tkls->offset() == in_bytes(Klass::java_mirror_offset())) { | 1684 if (tkls->offset() == in_bytes(Klass::java_mirror_offset())) { |
1688 | 1691 |
1689 // We can still check if we are loading from the primary_supers array at a | 1692 // We can still check if we are loading from the primary_supers array at a |
1690 // shallow enough depth. Even though the klass is not exact, entries less | 1693 // shallow enough depth. Even though the klass is not exact, entries less |
1691 // than or equal to its super depth are correct. | 1694 // than or equal to its super depth are correct. |
1692 if (klass->is_loaded() ) { | 1695 if (klass->is_loaded() ) { |
1693 ciType *inner = klass->klass(); | 1696 ciType *inner = klass; |
1694 while( inner->is_obj_array_klass() ) | 1697 while( inner->is_obj_array_klass() ) |
1695 inner = inner->as_obj_array_klass()->base_element_type(); | 1698 inner = inner->as_obj_array_klass()->base_element_type(); |
1696 if( inner->is_instance_klass() && | 1699 if( inner->is_instance_klass() && |
1697 !inner->as_instance_klass()->flags().is_interface() ) { | 1700 !inner->as_instance_klass()->flags().is_interface() ) { |
1698 // Compute index into primary_supers array | 1701 // Compute index into primary_supers array |
1699 juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(klassOop); | 1702 juint depth = (tkls->offset() - in_bytes(Klass::primary_supers_offset())) / sizeof(Klass*); |
1700 // Check for overflowing; use unsigned compare to handle the negative case. | 1703 // Check for overflowing; use unsigned compare to handle the negative case. |
1701 if( depth < ciKlass::primary_super_limit() && | 1704 if( depth < ciKlass::primary_super_limit() && |
1702 depth <= klass->super_depth() ) { // allow self-depth checks to handle self-check case | 1705 depth <= klass->super_depth() ) { // allow self-depth checks to handle self-check case |
1703 // The field is an element of Klass::_primary_supers. Return its (constant) value. | 1706 // The field is an element of Klass::_primary_supers. Return its (constant) value. |
1704 // (Folds up type checking code.) | 1707 // (Folds up type checking code.) |
1769 // | 1772 // |
1770 Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 1773 Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
1771 Node* mem = in(MemNode::Memory); | 1774 Node* mem = in(MemNode::Memory); |
1772 Node* value = can_see_stored_value(mem,phase); | 1775 Node* value = can_see_stored_value(mem,phase); |
1773 if( value && !phase->type(value)->higher_equal( _type ) ) { | 1776 if( value && !phase->type(value)->higher_equal( _type ) ) { |
1774 Node *result = phase->transform( new (phase->C, 3) LShiftINode(value, phase->intcon(24)) ); | 1777 Node *result = phase->transform( new (phase->C) LShiftINode(value, phase->intcon(24)) ); |
1775 return new (phase->C, 3) RShiftINode(result, phase->intcon(24)); | 1778 return new (phase->C) RShiftINode(result, phase->intcon(24)); |
1776 } | 1779 } |
1777 // Identity call will handle the case where truncation is not needed. | 1780 // Identity call will handle the case where truncation is not needed. |
1778 return LoadNode::Ideal(phase, can_reshape); | 1781 return LoadNode::Ideal(phase, can_reshape); |
1779 } | 1782 } |
1780 | 1783 |
1801 // | 1804 // |
1802 Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { | 1805 Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { |
1803 Node* mem = in(MemNode::Memory); | 1806 Node* mem = in(MemNode::Memory); |
1804 Node* value = can_see_stored_value(mem, phase); | 1807 Node* value = can_see_stored_value(mem, phase); |
1805 if (value && !phase->type(value)->higher_equal(_type)) | 1808 if (value && !phase->type(value)->higher_equal(_type)) |
1806 return new (phase->C, 3) AndINode(value, phase->intcon(0xFF)); | 1809 return new (phase->C) AndINode(value, phase->intcon(0xFF)); |
1807 // Identity call will handle the case where truncation is not needed. | 1810 // Identity call will handle the case where truncation is not needed. |
1808 return LoadNode::Ideal(phase, can_reshape); | 1811 return LoadNode::Ideal(phase, can_reshape); |
1809 } | 1812 } |
1810 | 1813 |
1811 const Type* LoadUBNode::Value(PhaseTransform *phase) const { | 1814 const Type* LoadUBNode::Value(PhaseTransform *phase) const { |
1831 // | 1834 // |
1832 Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 1835 Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
1833 Node* mem = in(MemNode::Memory); | 1836 Node* mem = in(MemNode::Memory); |
1834 Node* value = can_see_stored_value(mem,phase); | 1837 Node* value = can_see_stored_value(mem,phase); |
1835 if( value && !phase->type(value)->higher_equal( _type ) ) | 1838 if( value && !phase->type(value)->higher_equal( _type ) ) |
1836 return new (phase->C, 3) AndINode(value,phase->intcon(0xFFFF)); | 1839 return new (phase->C) AndINode(value,phase->intcon(0xFFFF)); |
1837 // Identity call will handle the case where truncation is not needed. | 1840 // Identity call will handle the case where truncation is not needed. |
1838 return LoadNode::Ideal(phase, can_reshape); | 1841 return LoadNode::Ideal(phase, can_reshape); |
1839 } | 1842 } |
1840 | 1843 |
1841 const Type* LoadUSNode::Value(PhaseTransform *phase) const { | 1844 const Type* LoadUSNode::Value(PhaseTransform *phase) const { |
1861 // | 1864 // |
1862 Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 1865 Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
1863 Node* mem = in(MemNode::Memory); | 1866 Node* mem = in(MemNode::Memory); |
1864 Node* value = can_see_stored_value(mem,phase); | 1867 Node* value = can_see_stored_value(mem,phase); |
1865 if( value && !phase->type(value)->higher_equal( _type ) ) { | 1868 if( value && !phase->type(value)->higher_equal( _type ) ) { |
1866 Node *result = phase->transform( new (phase->C, 3) LShiftINode(value, phase->intcon(16)) ); | 1869 Node *result = phase->transform( new (phase->C) LShiftINode(value, phase->intcon(16)) ); |
1867 return new (phase->C, 3) RShiftINode(result, phase->intcon(16)); | 1870 return new (phase->C) RShiftINode(result, phase->intcon(16)); |
1868 } | 1871 } |
1869 // Identity call will handle the case where truncation is not needed. | 1872 // Identity call will handle the case where truncation is not needed. |
1870 return LoadNode::Ideal(phase, can_reshape); | 1873 return LoadNode::Ideal(phase, can_reshape); |
1871 } | 1874 } |
1872 | 1875 |
1889 // Polymorphic factory method: | 1892 // Polymorphic factory method: |
1890 Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at, const TypeKlassPtr *tk ) { | 1893 Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at, const TypeKlassPtr *tk ) { |
1891 Compile* C = gvn.C; | 1894 Compile* C = gvn.C; |
1892 Node *ctl = NULL; | 1895 Node *ctl = NULL; |
1893 // sanity check the alias category against the created node type | 1896 // sanity check the alias category against the created node type |
1894 const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr(); | 1897 const TypePtr *adr_type = adr->bottom_type()->isa_ptr(); |
1895 assert(adr_type != NULL, "expecting TypeOopPtr"); | 1898 assert(adr_type != NULL, "expecting TypeKlassPtr"); |
1896 #ifdef _LP64 | 1899 #ifdef _LP64 |
1897 if (adr_type->is_ptr_to_narrowoop()) { | 1900 if (adr_type->is_ptr_to_narrowklass()) { |
1898 Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop())); | 1901 assert(UseCompressedKlassPointers, "no compressed klasses"); |
1899 return new (C, 2) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr()); | 1902 Node* load_klass = gvn.transform(new (C) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowklass())); |
1903 return new (C) DecodeNKlassNode(load_klass, load_klass->bottom_type()->make_ptr()); | |
1900 } | 1904 } |
1901 #endif | 1905 #endif |
1902 assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop"); | 1906 assert(!adr_type->is_ptr_to_narrowklass() && !adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop"); |
1903 return new (C, 3) LoadKlassNode(ctl, mem, adr, at, tk); | 1907 return new (C) LoadKlassNode(ctl, mem, adr, at, tk); |
1904 } | 1908 } |
1905 | 1909 |
1906 //------------------------------Value------------------------------------------ | 1910 //------------------------------Value------------------------------------------ |
1907 const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { | 1911 const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { |
1908 return klass_value_common(phase); | 1912 return klass_value_common(phase); |
2011 if (tkls != NULL && !StressReflectiveCode) { | 2015 if (tkls != NULL && !StressReflectiveCode) { |
2012 ciKlass* klass = tkls->klass(); | 2016 ciKlass* klass = tkls->klass(); |
2013 if( !klass->is_loaded() ) | 2017 if( !klass->is_loaded() ) |
2014 return _type; // Bail out if not loaded | 2018 return _type; // Bail out if not loaded |
2015 if( klass->is_obj_array_klass() && | 2019 if( klass->is_obj_array_klass() && |
2016 tkls->offset() == in_bytes(objArrayKlass::element_klass_offset())) { | 2020 tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) { |
2017 ciKlass* elem = klass->as_obj_array_klass()->element_klass(); | 2021 ciKlass* elem = klass->as_obj_array_klass()->element_klass(); |
2018 // // Always returning precise element type is incorrect, | 2022 // // Always returning precise element type is incorrect, |
2019 // // e.g., element type could be object and array may contain strings | 2023 // // e.g., element type could be object and array may contain strings |
2020 // return TypeKlassPtr::make(TypePtr::Constant, elem, 0); | 2024 // return TypeKlassPtr::make(TypePtr::Constant, elem, 0); |
2021 | 2025 |
2063 if (allocated_klass != NULL) { | 2067 if (allocated_klass != NULL) { |
2064 return allocated_klass; | 2068 return allocated_klass; |
2065 } | 2069 } |
2066 } | 2070 } |
2067 | 2071 |
2068 // Simplify k.java_mirror.as_klass to plain k, where k is a klassOop. | 2072 // Simplify k.java_mirror.as_klass to plain k, where k is a Klass*. |
2069 // Simplify ak.component_mirror.array_klass to plain ak, ak an arrayKlass. | 2073 // Simplify ak.component_mirror.array_klass to plain ak, ak an ArrayKlass. |
2070 // See inline_native_Class_query for occurrences of these patterns. | 2074 // See inline_native_Class_query for occurrences of these patterns. |
2071 // Java Example: x.getClass().isAssignableFrom(y) | 2075 // Java Example: x.getClass().isAssignableFrom(y) |
2072 // Java Example: Array.newInstance(x.getClass().getComponentType(), n) | 2076 // Java Example: Array.newInstance(x.getClass().getComponentType(), n) |
2073 // | 2077 // |
2074 // This improves reflective code, often making the Class | 2078 // This improves reflective code, often making the Class |
2075 // mirror go completely dead. (Current exception: Class | 2079 // mirror go completely dead. (Current exception: Class |
2076 // mirrors may appear in debug info, but we could clean them out by | 2080 // mirrors may appear in debug info, but we could clean them out by |
2077 // introducing a new debug info operator for klassOop.java_mirror). | 2081 // introducing a new debug info operator for Klass*.java_mirror). |
2078 if (toop->isa_instptr() && toop->klass() == phase->C->env()->Class_klass() | 2082 if (toop->isa_instptr() && toop->klass() == phase->C->env()->Class_klass() |
2079 && (offset == java_lang_Class::klass_offset_in_bytes() || | 2083 && (offset == java_lang_Class::klass_offset_in_bytes() || |
2080 offset == java_lang_Class::array_klass_offset_in_bytes())) { | 2084 offset == java_lang_Class::array_klass_offset_in_bytes())) { |
2081 // We are loading a special hidden field from a Class mirror, | 2085 // We are loading a special hidden field from a Class mirror, |
2082 // the field which points to its Klass or arrayKlass metaobject. | 2086 // the field which points to its Klass or ArrayKlass metaobject. |
2083 if (base->is_Load()) { | 2087 if (base->is_Load()) { |
2084 Node* adr2 = base->in(MemNode::Address); | 2088 Node* adr2 = base->in(MemNode::Address); |
2085 const TypeKlassPtr* tkls = phase->type(adr2)->isa_klassptr(); | 2089 const TypeKlassPtr* tkls = phase->type(adr2)->isa_klassptr(); |
2086 if (tkls != NULL && !tkls->empty() | 2090 if (tkls != NULL && !tkls->empty() |
2087 && (tkls->klass()->is_instance_klass() || | 2091 && (tkls->klass()->is_instance_klass() || |
2088 tkls->klass()->is_array_klass()) | 2092 tkls->klass()->is_array_klass()) |
2089 && adr2->is_AddP() | 2093 && adr2->is_AddP() |
2090 ) { | 2094 ) { |
2091 int mirror_field = in_bytes(Klass::java_mirror_offset()); | 2095 int mirror_field = in_bytes(Klass::java_mirror_offset()); |
2092 if (offset == java_lang_Class::array_klass_offset_in_bytes()) { | 2096 if (offset == java_lang_Class::array_klass_offset_in_bytes()) { |
2093 mirror_field = in_bytes(arrayKlass::component_mirror_offset()); | 2097 mirror_field = in_bytes(ArrayKlass::component_mirror_offset()); |
2094 } | 2098 } |
2095 if (tkls->offset() == mirror_field) { | 2099 if (tkls->offset() == mirror_field) { |
2096 return adr2->in(AddPNode::Base); | 2100 return adr2->in(AddPNode::Base); |
2097 } | 2101 } |
2098 } | 2102 } |
2107 const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { | 2111 const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { |
2108 const Type *t = klass_value_common(phase); | 2112 const Type *t = klass_value_common(phase); |
2109 if (t == Type::TOP) | 2113 if (t == Type::TOP) |
2110 return t; | 2114 return t; |
2111 | 2115 |
2112 return t->make_narrowoop(); | 2116 return t->make_narrowklass(); |
2113 } | 2117 } |
2114 | 2118 |
2115 //------------------------------Identity--------------------------------------- | 2119 //------------------------------Identity--------------------------------------- |
2116 // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. | 2120 // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. |
2117 // Also feed through the klass in Allocate(...klass...)._klass. | 2121 // Also feed through the klass in Allocate(...klass...)._klass. |
2118 Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { | 2122 Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { |
2119 Node *x = klass_identity_common(phase); | 2123 Node *x = klass_identity_common(phase); |
2120 | 2124 |
2121 const Type *t = phase->type( x ); | 2125 const Type *t = phase->type( x ); |
2122 if( t == Type::TOP ) return x; | 2126 if( t == Type::TOP ) return x; |
2123 if( t->isa_narrowoop()) return x; | 2127 if( t->isa_narrowklass()) return x; |
2124 | 2128 assert (!t->isa_narrowoop(), "no narrow oop here"); |
2125 return phase->transform(new (phase->C, 2) EncodePNode(x, t->make_narrowoop())); | 2129 |
2130 return phase->transform(new (phase->C) EncodePKlassNode(x, t->make_narrowklass())); | |
2126 } | 2131 } |
2127 | 2132 |
2128 //------------------------------Value----------------------------------------- | 2133 //------------------------------Value----------------------------------------- |
2129 const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { | 2134 const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { |
2130 // Either input is TOP ==> the result is TOP | 2135 // Either input is TOP ==> the result is TOP |
2214 assert( C->get_alias_index(adr_type) != Compile::AliasIdxRaw || | 2219 assert( C->get_alias_index(adr_type) != Compile::AliasIdxRaw || |
2215 ctl != NULL, "raw memory operations should have control edge"); | 2220 ctl != NULL, "raw memory operations should have control edge"); |
2216 | 2221 |
2217 switch (bt) { | 2222 switch (bt) { |
2218 case T_BOOLEAN: | 2223 case T_BOOLEAN: |
2219 case T_BYTE: return new (C, 4) StoreBNode(ctl, mem, adr, adr_type, val); | 2224 case T_BYTE: return new (C) StoreBNode(ctl, mem, adr, adr_type, val); |
2220 case T_INT: return new (C, 4) StoreINode(ctl, mem, adr, adr_type, val); | 2225 case T_INT: return new (C) StoreINode(ctl, mem, adr, adr_type, val); |
2221 case T_CHAR: | 2226 case T_CHAR: |
2222 case T_SHORT: return new (C, 4) StoreCNode(ctl, mem, adr, adr_type, val); | 2227 case T_SHORT: return new (C) StoreCNode(ctl, mem, adr, adr_type, val); |
2223 case T_LONG: return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val); | 2228 case T_LONG: return new (C) StoreLNode(ctl, mem, adr, adr_type, val); |
2224 case T_FLOAT: return new (C, 4) StoreFNode(ctl, mem, adr, adr_type, val); | 2229 case T_FLOAT: return new (C) StoreFNode(ctl, mem, adr, adr_type, val); |
2225 case T_DOUBLE: return new (C, 4) StoreDNode(ctl, mem, adr, adr_type, val); | 2230 case T_DOUBLE: return new (C) StoreDNode(ctl, mem, adr, adr_type, val); |
2231 case T_METADATA: | |
2226 case T_ADDRESS: | 2232 case T_ADDRESS: |
2227 case T_OBJECT: | 2233 case T_OBJECT: |
2228 #ifdef _LP64 | 2234 #ifdef _LP64 |
2229 if (adr->bottom_type()->is_ptr_to_narrowoop() || | 2235 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
2230 (UseCompressedOops && val->bottom_type()->isa_klassptr() && | 2236 val = gvn.transform(new (C) EncodePNode(val, val->bottom_type()->make_narrowoop())); |
2231 adr->bottom_type()->isa_rawptr())) { | 2237 return new (C) StoreNNode(ctl, mem, adr, adr_type, val); |
2232 val = gvn.transform(new (C, 2) EncodePNode(val, val->bottom_type()->make_narrowoop())); | 2238 } else if (adr->bottom_type()->is_ptr_to_narrowklass() || |
2233 return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, val); | 2239 (UseCompressedKlassPointers && val->bottom_type()->isa_klassptr() && |
2234 } else | 2240 adr->bottom_type()->isa_rawptr())) { |
2241 val = gvn.transform(new (C) EncodePKlassNode(val, val->bottom_type()->make_narrowklass())); | |
2242 return new (C) StoreNKlassNode(ctl, mem, adr, adr_type, val); | |
2243 } | |
2235 #endif | 2244 #endif |
2236 { | 2245 { |
2237 return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val); | 2246 return new (C) StorePNode(ctl, mem, adr, adr_type, val); |
2238 } | 2247 } |
2239 } | 2248 } |
2240 ShouldNotReachHere(); | 2249 ShouldNotReachHere(); |
2241 return (StoreNode*)NULL; | 2250 return (StoreNode*)NULL; |
2242 } | 2251 } |
2243 | 2252 |
2244 StoreLNode* StoreLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val) { | 2253 StoreLNode* StoreLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val) { |
2245 bool require_atomic = true; | 2254 bool require_atomic = true; |
2246 return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val, require_atomic); | 2255 return new (C) StoreLNode(ctl, mem, adr, adr_type, val, require_atomic); |
2247 } | 2256 } |
2248 | 2257 |
2249 | 2258 |
2250 //--------------------------bottom_type---------------------------------------- | 2259 //--------------------------bottom_type---------------------------------------- |
2251 const Type *StoreNode::bottom_type() const { | 2260 const Type *StoreNode::bottom_type() const { |
2548 { | 2557 { |
2549 return bottom_type(); | 2558 return bottom_type(); |
2550 } | 2559 } |
2551 | 2560 |
2552 //============================================================================= | 2561 //============================================================================= |
2553 LoadStoreNode::LoadStoreNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex ) : Node(5) { | 2562 //----------------------------------LoadStoreNode------------------------------ |
2563 LoadStoreNode::LoadStoreNode( Node *c, Node *mem, Node *adr, Node *val, const TypePtr* at, const Type* rt, uint required ) | |
2564 : Node(required), | |
2565 _type(rt), | |
2566 _adr_type(at) | |
2567 { | |
2554 init_req(MemNode::Control, c ); | 2568 init_req(MemNode::Control, c ); |
2555 init_req(MemNode::Memory , mem); | 2569 init_req(MemNode::Memory , mem); |
2556 init_req(MemNode::Address, adr); | 2570 init_req(MemNode::Address, adr); |
2557 init_req(MemNode::ValueIn, val); | 2571 init_req(MemNode::ValueIn, val); |
2558 init_req( ExpectedIn, ex ); | |
2559 init_class_id(Class_LoadStore); | 2572 init_class_id(Class_LoadStore); |
2560 | 2573 } |
2574 | |
2575 uint LoadStoreNode::ideal_reg() const { | |
2576 return _type->ideal_reg(); | |
2577 } | |
2578 | |
2579 bool LoadStoreNode::result_not_used() const { | |
2580 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { | |
2581 Node *x = fast_out(i); | |
2582 if (x->Opcode() == Op_SCMemProj) continue; | |
2583 return false; | |
2584 } | |
2585 return true; | |
2586 } | |
2587 | |
2588 uint LoadStoreNode::size_of() const { return sizeof(*this); } | |
2589 | |
2590 //============================================================================= | |
2591 //----------------------------------LoadStoreConditionalNode-------------------- | |
2592 LoadStoreConditionalNode::LoadStoreConditionalNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex ) : LoadStoreNode(c, mem, adr, val, NULL, TypeInt::BOOL, 5) { | |
2593 init_req(ExpectedIn, ex ); | |
2561 } | 2594 } |
2562 | 2595 |
2563 //============================================================================= | 2596 //============================================================================= |
2564 //-------------------------------adr_type-------------------------------------- | 2597 //-------------------------------adr_type-------------------------------------- |
2565 // Do we Match on this edge index or not? Do not match memory | 2598 // Do we Match on this edge index or not? Do not match memory |
2610 if( adr->Opcode() != Op_AddP ) Unimplemented(); | 2643 if( adr->Opcode() != Op_AddP ) Unimplemented(); |
2611 Node *base = adr->in(1); | 2644 Node *base = adr->in(1); |
2612 | 2645 |
2613 Node *zero = phase->makecon(TypeLong::ZERO); | 2646 Node *zero = phase->makecon(TypeLong::ZERO); |
2614 Node *off = phase->MakeConX(BytesPerLong); | 2647 Node *off = phase->MakeConX(BytesPerLong); |
2615 mem = new (phase->C, 4) StoreLNode(in(0),mem,adr,atp,zero); | 2648 mem = new (phase->C) StoreLNode(in(0),mem,adr,atp,zero); |
2616 count--; | 2649 count--; |
2617 while( count-- ) { | 2650 while( count-- ) { |
2618 mem = phase->transform(mem); | 2651 mem = phase->transform(mem); |
2619 adr = phase->transform(new (phase->C, 4) AddPNode(base,adr,off)); | 2652 adr = phase->transform(new (phase->C) AddPNode(base,adr,off)); |
2620 mem = new (phase->C, 4) StoreLNode(in(0),mem,adr,atp,zero); | 2653 mem = new (phase->C) StoreLNode(in(0),mem,adr,atp,zero); |
2621 } | 2654 } |
2622 return mem; | 2655 return mem; |
2623 } | 2656 } |
2624 | 2657 |
2625 //----------------------------step_through---------------------------------- | 2658 //----------------------------step_through---------------------------------- |
2656 Compile* C = phase->C; | 2689 Compile* C = phase->C; |
2657 intptr_t offset = start_offset; | 2690 intptr_t offset = start_offset; |
2658 | 2691 |
2659 int unit = BytesPerLong; | 2692 int unit = BytesPerLong; |
2660 if ((offset % unit) != 0) { | 2693 if ((offset % unit) != 0) { |
2661 Node* adr = new (C, 4) AddPNode(dest, dest, phase->MakeConX(offset)); | 2694 Node* adr = new (C) AddPNode(dest, dest, phase->MakeConX(offset)); |
2662 adr = phase->transform(adr); | 2695 adr = phase->transform(adr); |
2663 const TypePtr* atp = TypeRawPtr::BOTTOM; | 2696 const TypePtr* atp = TypeRawPtr::BOTTOM; |
2664 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); | 2697 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); |
2665 mem = phase->transform(mem); | 2698 mem = phase->transform(mem); |
2666 offset += BytesPerInt; | 2699 offset += BytesPerInt; |
2686 Node* zend = end_offset; | 2719 Node* zend = end_offset; |
2687 | 2720 |
2688 // Scale to the unit required by the CPU: | 2721 // Scale to the unit required by the CPU: |
2689 if (!Matcher::init_array_count_is_in_bytes) { | 2722 if (!Matcher::init_array_count_is_in_bytes) { |
2690 Node* shift = phase->intcon(exact_log2(unit)); | 2723 Node* shift = phase->intcon(exact_log2(unit)); |
2691 zbase = phase->transform( new(C,3) URShiftXNode(zbase, shift) ); | 2724 zbase = phase->transform( new(C) URShiftXNode(zbase, shift) ); |
2692 zend = phase->transform( new(C,3) URShiftXNode(zend, shift) ); | 2725 zend = phase->transform( new(C) URShiftXNode(zend, shift) ); |
2693 } | 2726 } |
2694 | 2727 |
2695 Node* zsize = phase->transform( new(C,3) SubXNode(zend, zbase) ); | 2728 Node* zsize = phase->transform( new(C) SubXNode(zend, zbase) ); |
2696 Node* zinit = phase->zerocon((unit == BytesPerLong) ? T_LONG : T_INT); | 2729 Node* zinit = phase->zerocon((unit == BytesPerLong) ? T_LONG : T_INT); |
2697 | 2730 |
2698 // Bulk clear double-words | 2731 // Bulk clear double-words |
2699 Node* adr = phase->transform( new(C,4) AddPNode(dest, dest, start_offset) ); | 2732 Node* adr = phase->transform( new(C) AddPNode(dest, dest, start_offset) ); |
2700 mem = new (C, 4) ClearArrayNode(ctl, mem, zsize, adr); | 2733 mem = new (C) ClearArrayNode(ctl, mem, zsize, adr); |
2701 return phase->transform(mem); | 2734 return phase->transform(mem); |
2702 } | 2735 } |
2703 | 2736 |
2704 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, | 2737 Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, |
2705 intptr_t start_offset, | 2738 intptr_t start_offset, |
2719 if (done_offset > start_offset) { | 2752 if (done_offset > start_offset) { |
2720 mem = clear_memory(ctl, mem, dest, | 2753 mem = clear_memory(ctl, mem, dest, |
2721 start_offset, phase->MakeConX(done_offset), phase); | 2754 start_offset, phase->MakeConX(done_offset), phase); |
2722 } | 2755 } |
2723 if (done_offset < end_offset) { // emit the final 32-bit store | 2756 if (done_offset < end_offset) { // emit the final 32-bit store |
2724 Node* adr = new (C, 4) AddPNode(dest, dest, phase->MakeConX(done_offset)); | 2757 Node* adr = new (C) AddPNode(dest, dest, phase->MakeConX(done_offset)); |
2725 adr = phase->transform(adr); | 2758 adr = phase->transform(adr); |
2726 const TypePtr* atp = TypeRawPtr::BOTTOM; | 2759 const TypePtr* atp = TypeRawPtr::BOTTOM; |
2727 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); | 2760 mem = StoreNode::make(*phase, ctl, mem, adr, atp, phase->zerocon(T_INT), T_INT); |
2728 mem = phase->transform(mem); | 2761 mem = phase->transform(mem); |
2729 done_offset += BytesPerInt; | 2762 done_offset += BytesPerInt; |
2785 return (&n == this); // Always fail except on self | 2818 return (&n == this); // Always fail except on self |
2786 } | 2819 } |
2787 | 2820 |
2788 //------------------------------make------------------------------------------- | 2821 //------------------------------make------------------------------------------- |
2789 MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { | 2822 MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { |
2790 int len = Precedent + (pn == NULL? 0: 1); | |
2791 switch (opcode) { | 2823 switch (opcode) { |
2792 case Op_MemBarAcquire: return new(C, len) MemBarAcquireNode(C, atp, pn); | 2824 case Op_MemBarAcquire: return new(C) MemBarAcquireNode(C, atp, pn); |
2793 case Op_MemBarRelease: return new(C, len) MemBarReleaseNode(C, atp, pn); | 2825 case Op_MemBarRelease: return new(C) MemBarReleaseNode(C, atp, pn); |
2794 case Op_MemBarAcquireLock: return new(C, len) MemBarAcquireLockNode(C, atp, pn); | 2826 case Op_MemBarAcquireLock: return new(C) MemBarAcquireLockNode(C, atp, pn); |
2795 case Op_MemBarReleaseLock: return new(C, len) MemBarReleaseLockNode(C, atp, pn); | 2827 case Op_MemBarReleaseLock: return new(C) MemBarReleaseLockNode(C, atp, pn); |
2796 case Op_MemBarVolatile: return new(C, len) MemBarVolatileNode(C, atp, pn); | 2828 case Op_MemBarVolatile: return new(C) MemBarVolatileNode(C, atp, pn); |
2797 case Op_MemBarCPUOrder: return new(C, len) MemBarCPUOrderNode(C, atp, pn); | 2829 case Op_MemBarCPUOrder: return new(C) MemBarCPUOrderNode(C, atp, pn); |
2798 case Op_Initialize: return new(C, len) InitializeNode(C, atp, pn); | 2830 case Op_Initialize: return new(C) InitializeNode(C, atp, pn); |
2799 case Op_MemBarStoreStore: return new(C, len) MemBarStoreStoreNode(C, atp, pn); | 2831 case Op_MemBarStoreStore: return new(C) MemBarStoreStoreNode(C, atp, pn); |
2800 default: ShouldNotReachHere(); return NULL; | 2832 default: ShouldNotReachHere(); return NULL; |
2801 } | 2833 } |
2802 } | 2834 } |
2803 | 2835 |
2804 //------------------------------Ideal------------------------------------------ | 2836 //------------------------------Ideal------------------------------------------ |
2824 PhaseIterGVN* igvn = phase->is_IterGVN(); | 2856 PhaseIterGVN* igvn = phase->is_IterGVN(); |
2825 igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory)); | 2857 igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory)); |
2826 igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control)); | 2858 igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control)); |
2827 // Must return either the original node (now dead) or a new node | 2859 // Must return either the original node (now dead) or a new node |
2828 // (Do not return a top here, since that would break the uniqueness of top.) | 2860 // (Do not return a top here, since that would break the uniqueness of top.) |
2829 return new (phase->C, 1) ConINode(TypeInt::ZERO); | 2861 return new (phase->C) ConINode(TypeInt::ZERO); |
2830 } | 2862 } |
2831 } | 2863 } |
2832 } | 2864 } |
2833 return NULL; | 2865 return NULL; |
2834 } | 2866 } |
2845 // Construct projections for memory. | 2877 // Construct projections for memory. |
2846 Node *MemBarNode::match( const ProjNode *proj, const Matcher *m ) { | 2878 Node *MemBarNode::match( const ProjNode *proj, const Matcher *m ) { |
2847 switch (proj->_con) { | 2879 switch (proj->_con) { |
2848 case TypeFunc::Control: | 2880 case TypeFunc::Control: |
2849 case TypeFunc::Memory: | 2881 case TypeFunc::Memory: |
2850 return new (m->C, 1) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); | 2882 return new (m->C) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); |
2851 } | 2883 } |
2852 ShouldNotReachHere(); | 2884 ShouldNotReachHere(); |
2853 return NULL; | 2885 return NULL; |
2854 } | 2886 } |
2855 | 2887 |
3189 Node* InitializeNode::make_raw_address(intptr_t offset, | 3221 Node* InitializeNode::make_raw_address(intptr_t offset, |
3190 PhaseTransform* phase) { | 3222 PhaseTransform* phase) { |
3191 Node* addr = in(RawAddress); | 3223 Node* addr = in(RawAddress); |
3192 if (offset != 0) { | 3224 if (offset != 0) { |
3193 Compile* C = phase->C; | 3225 Compile* C = phase->C; |
3194 addr = phase->transform( new (C, 4) AddPNode(C->top(), addr, | 3226 addr = phase->transform( new (C) AddPNode(C->top(), addr, |
3195 phase->MakeConX(offset)) ); | 3227 phase->MakeConX(offset)) ); |
3196 } | 3228 } |
3197 return addr; | 3229 return addr; |
3198 } | 3230 } |
3199 | 3231 |
3878 } | 3910 } |
3879 | 3911 |
3880 // Make a new, untransformed MergeMem with the same base as 'mem'. | 3912 // Make a new, untransformed MergeMem with the same base as 'mem'. |
3881 // If mem is itself a MergeMem, populate the result with the same edges. | 3913 // If mem is itself a MergeMem, populate the result with the same edges. |
3882 MergeMemNode* MergeMemNode::make(Compile* C, Node* mem) { | 3914 MergeMemNode* MergeMemNode::make(Compile* C, Node* mem) { |
3883 return new(C, 1+Compile::AliasIdxRaw) MergeMemNode(mem); | 3915 return new(C) MergeMemNode(mem); |
3884 } | 3916 } |
3885 | 3917 |
3886 //------------------------------cmp-------------------------------------------- | 3918 //------------------------------cmp-------------------------------------------- |
3887 uint MergeMemNode::hash() const { return NO_HASH; } | 3919 uint MergeMemNode::hash() const { return NO_HASH; } |
3888 uint MergeMemNode::cmp( const Node &n ) const { | 3920 uint MergeMemNode::cmp( const Node &n ) const { |