src/share/vm/opto/memnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6689060 Sdiff src/share/vm/opto

src/share/vm/opto/memnode.cpp

Print this page




 737          "use LoadKlassNode instead");
 738   assert(!(adr_type->isa_aryptr() &&
 739            adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
 740          "use LoadRangeNode instead");
 741   switch (bt) {
 742   case T_BOOLEAN:
 743   case T_BYTE:    return new (C, 3) LoadBNode(ctl, mem, adr, adr_type, rt->is_int()    );
 744   case T_INT:     return new (C, 3) LoadINode(ctl, mem, adr, adr_type, rt->is_int()    );
 745   case T_CHAR:    return new (C, 3) LoadCNode(ctl, mem, adr, adr_type, rt->is_int()    );
 746   case T_SHORT:   return new (C, 3) LoadSNode(ctl, mem, adr, adr_type, rt->is_int()    );
 747   case T_LONG:    return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long()   );
 748   case T_FLOAT:   return new (C, 3) LoadFNode(ctl, mem, adr, adr_type, rt              );
 749   case T_DOUBLE:  return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt              );
 750   case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr()    );
 751   case T_OBJECT:
 752 #ifdef _LP64
 753     if (adr->bottom_type()->is_narrow()) {
 754       const TypeNarrowOop* narrowtype;
 755       if (rt->isa_narrowoop()) {
 756         narrowtype = rt->is_narrowoop();
 757         rt = narrowtype->make_oopptr();
 758       } else {
 759         narrowtype = rt->is_oopptr()->make_narrowoop();
 760       }
 761       Node* load  = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, narrowtype));
 762 
 763       return new (C, 2) DecodeNNode(load, rt);
 764     } else
 765 #endif
 766       {
 767         assert(!adr->bottom_type()->is_narrow(), "should have got back a narrow oop");
 768         return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr());
 769       }
 770   }
 771   ShouldNotReachHere();
 772   return (LoadNode*)NULL;
 773 }
 774 
 775 LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt) {
 776   bool require_atomic = true;
 777   return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), require_atomic);
 778 }
 779 
 780 
 781 
 782 
 783 //------------------------------hash-------------------------------------------


1824 // Polymorphic factory method:
1825 StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt ) {
1826   Compile* C = gvn.C;
1827 
1828   switch (bt) {
1829   case T_BOOLEAN:
1830   case T_BYTE:    return new (C, 4) StoreBNode(ctl, mem, adr, adr_type, val);
1831   case T_INT:     return new (C, 4) StoreINode(ctl, mem, adr, adr_type, val);
1832   case T_CHAR:
1833   case T_SHORT:   return new (C, 4) StoreCNode(ctl, mem, adr, adr_type, val);
1834   case T_LONG:    return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val);
1835   case T_FLOAT:   return new (C, 4) StoreFNode(ctl, mem, adr, adr_type, val);
1836   case T_DOUBLE:  return new (C, 4) StoreDNode(ctl, mem, adr, adr_type, val);
1837   case T_ADDRESS:
1838   case T_OBJECT:
1839 #ifdef _LP64
1840     if (adr->bottom_type()->is_narrow() ||
1841         (UseCompressedOops && val->bottom_type()->isa_klassptr() &&
1842          adr->bottom_type()->isa_rawptr())) {
1843       const TypePtr* type = val->bottom_type()->is_ptr();
1844       Node* cp;
1845       if (type->isa_oopptr()) {
1846         const TypeNarrowOop* etype = type->is_oopptr()->make_narrowoop();
1847         cp = gvn.transform(new (C, 2) EncodePNode(val, etype));
1848       } else if (type == TypePtr::NULL_PTR) {
1849         cp = gvn.transform(new (C, 1) ConNNode(TypeNarrowOop::NULL_PTR));
1850       } else {
1851         ShouldNotReachHere();
1852       }
1853       return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, cp);
1854     } else
1855 #endif
1856       {
1857         return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val);
1858       }
1859   }
1860   ShouldNotReachHere();
1861   return (StoreNode*)NULL;
1862 }
1863 
1864 StoreLNode* StoreLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val) {
1865   bool require_atomic = true;
1866   return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val, require_atomic);
1867 }
1868 
1869 
1870 //--------------------------bottom_type----------------------------------------
1871 const Type *StoreNode::bottom_type() const {
1872   return Type::MEMORY;




 737          "use LoadKlassNode instead");
 738   assert(!(adr_type->isa_aryptr() &&
 739            adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
 740          "use LoadRangeNode instead");
 741   switch (bt) {
 742   case T_BOOLEAN:
 743   case T_BYTE:    return new (C, 3) LoadBNode(ctl, mem, adr, adr_type, rt->is_int()    );
 744   case T_INT:     return new (C, 3) LoadINode(ctl, mem, adr, adr_type, rt->is_int()    );
 745   case T_CHAR:    return new (C, 3) LoadCNode(ctl, mem, adr, adr_type, rt->is_int()    );
 746   case T_SHORT:   return new (C, 3) LoadSNode(ctl, mem, adr, adr_type, rt->is_int()    );
 747   case T_LONG:    return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long()   );
 748   case T_FLOAT:   return new (C, 3) LoadFNode(ctl, mem, adr, adr_type, rt              );
 749   case T_DOUBLE:  return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt              );
 750   case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr()    );
 751   case T_OBJECT:
 752 #ifdef _LP64
 753     if (adr->bottom_type()->is_narrow()) {
 754       const TypeNarrowOop* narrowtype;
 755       if (rt->isa_narrowoop()) {
 756         narrowtype = rt->is_narrowoop();

 757       } else {
 758         narrowtype = rt->is_oopptr()->make_narrowoop();
 759       }
 760       Node* load  = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, narrowtype));
 761 
 762       return DecodeNNode::decode(&gvn, load);
 763     } else
 764 #endif
 765       {
 766         assert(!adr->bottom_type()->is_narrow(), "should have got back a narrow oop");
 767         return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr());
 768       }
 769   }
 770   ShouldNotReachHere();
 771   return (LoadNode*)NULL;
 772 }
 773 
 774 LoadLNode* LoadLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt) {
 775   bool require_atomic = true;
 776   return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long(), require_atomic);
 777 }
 778 
 779 
 780 
 781 
 782 //------------------------------hash-------------------------------------------


1823 // Polymorphic factory method:
1824 StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt ) {
1825   Compile* C = gvn.C;
1826 
1827   switch (bt) {
1828   case T_BOOLEAN:
1829   case T_BYTE:    return new (C, 4) StoreBNode(ctl, mem, adr, adr_type, val);
1830   case T_INT:     return new (C, 4) StoreINode(ctl, mem, adr, adr_type, val);
1831   case T_CHAR:
1832   case T_SHORT:   return new (C, 4) StoreCNode(ctl, mem, adr, adr_type, val);
1833   case T_LONG:    return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val);
1834   case T_FLOAT:   return new (C, 4) StoreFNode(ctl, mem, adr, adr_type, val);
1835   case T_DOUBLE:  return new (C, 4) StoreDNode(ctl, mem, adr, adr_type, val);
1836   case T_ADDRESS:
1837   case T_OBJECT:
1838 #ifdef _LP64
1839     if (adr->bottom_type()->is_narrow() ||
1840         (UseCompressedOops && val->bottom_type()->isa_klassptr() &&
1841          adr->bottom_type()->isa_rawptr())) {
1842       const TypePtr* type = val->bottom_type()->is_ptr();
1843       Node* cp = EncodePNode::encode(&gvn, val);








1844       return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, cp);
1845     } else
1846 #endif
1847       {
1848         return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val);
1849       }
1850   }
1851   ShouldNotReachHere();
1852   return (StoreNode*)NULL;
1853 }
1854 
1855 StoreLNode* StoreLNode::make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val) {
1856   bool require_atomic = true;
1857   return new (C, 4) StoreLNode(ctl, mem, adr, adr_type, val, require_atomic);
1858 }
1859 
1860 
1861 //--------------------------bottom_type----------------------------------------
1862 const Type *StoreNode::bottom_type() const {
1863   return Type::MEMORY;


src/share/vm/opto/memnode.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File