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

src/share/vm/opto/library_call.cpp

Print this page
rev 722 : [mq]: 6823354


 205                                Node* copy_length,
 206                                int nargs);
 207   Node* generate_checkcast_arraycopy(const TypePtr* adr_type,
 208                                      Node* dest_elem_klass,
 209                                      Node* src,  Node* src_offset,
 210                                      Node* dest, Node* dest_offset,
 211                                      Node* copy_length, int nargs);
 212   Node* generate_generic_arraycopy(const TypePtr* adr_type,
 213                                    Node* src,  Node* src_offset,
 214                                    Node* dest, Node* dest_offset,
 215                                    Node* copy_length, int nargs);
 216   void generate_unchecked_arraycopy(const TypePtr* adr_type,
 217                                     BasicType basic_elem_type,
 218                                     bool disjoint_bases,
 219                                     Node* src,  Node* src_offset,
 220                                     Node* dest, Node* dest_offset,
 221                                     Node* copy_length);
 222   bool inline_unsafe_CAS(BasicType type);
 223   bool inline_unsafe_ordered_store(BasicType type);
 224   bool inline_fp_conversions(vmIntrinsics::ID id);


 225   bool inline_bitCount(vmIntrinsics::ID id);
 226   bool inline_reverseBytes(vmIntrinsics::ID id);
 227 };
 228 
 229 
 230 //---------------------------make_vm_intrinsic----------------------------
 231 CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
 232   vmIntrinsics::ID id = m->intrinsic_id();
 233   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 234 
 235   if (DisableIntrinsic[0] != '\0'
 236       && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) {
 237     // disabled by a user request on the command line:
 238     // example: -XX:DisableIntrinsic=_hashCode,_getClass
 239     return NULL;
 240   }
 241 
 242   if (!m->is_loaded()) {
 243     // do not attempt to inline unloaded methods
 244     return NULL;


 613     return inline_native_subtype_check();
 614 
 615   case vmIntrinsics::_isInstance:
 616   case vmIntrinsics::_getModifiers:
 617   case vmIntrinsics::_isInterface:
 618   case vmIntrinsics::_isArray:
 619   case vmIntrinsics::_isPrimitive:
 620   case vmIntrinsics::_getSuperclass:
 621   case vmIntrinsics::_getComponentType:
 622   case vmIntrinsics::_getClassAccessFlags:
 623     return inline_native_Class_query(intrinsic_id());
 624 
 625   case vmIntrinsics::_floatToRawIntBits:
 626   case vmIntrinsics::_floatToIntBits:
 627   case vmIntrinsics::_intBitsToFloat:
 628   case vmIntrinsics::_doubleToRawLongBits:
 629   case vmIntrinsics::_doubleToLongBits:
 630   case vmIntrinsics::_longBitsToDouble:
 631     return inline_fp_conversions(intrinsic_id());
 632 








 633   case vmIntrinsics::_bitCount_i:
 634   case vmIntrinsics::_bitCount_l:
 635     return inline_bitCount(intrinsic_id());
 636 
 637   case vmIntrinsics::_reverseBytes_i:
 638   case vmIntrinsics::_reverseBytes_l:
 639     return inline_reverseBytes((vmIntrinsics::ID) intrinsic_id());
 640 
 641   case vmIntrinsics::_get_AtomicLong:
 642     return inline_native_AtomicLong_get();
 643   case vmIntrinsics::_attemptUpdate:
 644     return inline_native_AtomicLong_attemptUpdate();
 645 
 646   case vmIntrinsics::_getCallerClass:
 647     return inline_native_Reflection_getCallerClass();
 648 
 649   default:
 650     // If you get here, it may be that someone has added a new intrinsic
 651     // to the list in vmSymbols.hpp without implementing it here.
 652 #ifndef PRODUCT


1827         !MacroAssembler::needs_explicit_null_check(offset_type->_hi)) {
1828       return Type::OopPtr;
1829     }
1830     // Otherwise, it might either be oop+off or NULL+addr.
1831     return Type::AnyPtr;
1832   } else {
1833     // No information:
1834     return Type::AnyPtr;
1835   }
1836 }
1837 
1838 inline Node* LibraryCallKit::make_unsafe_address(Node* base, Node* offset) {
1839   int kind = classify_unsafe_addr(base, offset);
1840   if (kind == Type::RawPtr) {
1841     return basic_plus_adr(top(), base, offset);
1842   } else {
1843     return basic_plus_adr(base, offset);
1844   }
1845 }
1846 










































1847 //----------------------------inline_bitCount_int/long-----------------------
1848 // inline int Integer.bitCount(int)
1849 // inline int Long.bitCount(long)
1850 bool LibraryCallKit::inline_bitCount(vmIntrinsics::ID id) {
1851   assert(id == vmIntrinsics::_bitCount_i || id == vmIntrinsics::_bitCount_l, "not bitCount");
1852   if (id == vmIntrinsics::_bitCount_i && !Matcher::has_match_rule(Op_PopCountI)) return false;
1853   if (id == vmIntrinsics::_bitCount_l && !Matcher::has_match_rule(Op_PopCountL)) return false;
1854   _sp += arg_size();  // restore stack pointer
1855   switch (id) {
1856   case vmIntrinsics::_bitCount_i:
1857     push(_gvn.transform(new (C, 2) PopCountINode(pop())));
1858     break;
1859   case vmIntrinsics::_bitCount_l:
1860     push(_gvn.transform(new (C, 2) PopCountLNode(pop_pair())));
1861     break;
1862   default:
1863     ShouldNotReachHere();
1864   }
1865   return true;
1866 }




 205                                Node* copy_length,
 206                                int nargs);
 207   Node* generate_checkcast_arraycopy(const TypePtr* adr_type,
 208                                      Node* dest_elem_klass,
 209                                      Node* src,  Node* src_offset,
 210                                      Node* dest, Node* dest_offset,
 211                                      Node* copy_length, int nargs);
 212   Node* generate_generic_arraycopy(const TypePtr* adr_type,
 213                                    Node* src,  Node* src_offset,
 214                                    Node* dest, Node* dest_offset,
 215                                    Node* copy_length, int nargs);
 216   void generate_unchecked_arraycopy(const TypePtr* adr_type,
 217                                     BasicType basic_elem_type,
 218                                     bool disjoint_bases,
 219                                     Node* src,  Node* src_offset,
 220                                     Node* dest, Node* dest_offset,
 221                                     Node* copy_length);
 222   bool inline_unsafe_CAS(BasicType type);
 223   bool inline_unsafe_ordered_store(BasicType type);
 224   bool inline_fp_conversions(vmIntrinsics::ID id);
 225   bool inline_numberOfLeadingZeros(vmIntrinsics::ID id);
 226   bool inline_numberOfTrailingZeros(vmIntrinsics::ID id);
 227   bool inline_bitCount(vmIntrinsics::ID id);
 228   bool inline_reverseBytes(vmIntrinsics::ID id);
 229 };
 230 
 231 
 232 //---------------------------make_vm_intrinsic----------------------------
 233 CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) {
 234   vmIntrinsics::ID id = m->intrinsic_id();
 235   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 236 
 237   if (DisableIntrinsic[0] != '\0'
 238       && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) {
 239     // disabled by a user request on the command line:
 240     // example: -XX:DisableIntrinsic=_hashCode,_getClass
 241     return NULL;
 242   }
 243 
 244   if (!m->is_loaded()) {
 245     // do not attempt to inline unloaded methods
 246     return NULL;


 615     return inline_native_subtype_check();
 616 
 617   case vmIntrinsics::_isInstance:
 618   case vmIntrinsics::_getModifiers:
 619   case vmIntrinsics::_isInterface:
 620   case vmIntrinsics::_isArray:
 621   case vmIntrinsics::_isPrimitive:
 622   case vmIntrinsics::_getSuperclass:
 623   case vmIntrinsics::_getComponentType:
 624   case vmIntrinsics::_getClassAccessFlags:
 625     return inline_native_Class_query(intrinsic_id());
 626 
 627   case vmIntrinsics::_floatToRawIntBits:
 628   case vmIntrinsics::_floatToIntBits:
 629   case vmIntrinsics::_intBitsToFloat:
 630   case vmIntrinsics::_doubleToRawLongBits:
 631   case vmIntrinsics::_doubleToLongBits:
 632   case vmIntrinsics::_longBitsToDouble:
 633     return inline_fp_conversions(intrinsic_id());
 634 
 635   case vmIntrinsics::_numberOfLeadingZeros_i:
 636   case vmIntrinsics::_numberOfLeadingZeros_l:
 637     return inline_numberOfLeadingZeros(intrinsic_id());
 638 
 639   case vmIntrinsics::_numberOfTrailingZeros_i:
 640   case vmIntrinsics::_numberOfTrailingZeros_l:
 641     return inline_numberOfTrailingZeros(intrinsic_id());
 642 
 643   case vmIntrinsics::_bitCount_i:
 644   case vmIntrinsics::_bitCount_l:
 645     return inline_bitCount(intrinsic_id());
 646 
 647   case vmIntrinsics::_reverseBytes_i:
 648   case vmIntrinsics::_reverseBytes_l:
 649     return inline_reverseBytes((vmIntrinsics::ID) intrinsic_id());
 650 
 651   case vmIntrinsics::_get_AtomicLong:
 652     return inline_native_AtomicLong_get();
 653   case vmIntrinsics::_attemptUpdate:
 654     return inline_native_AtomicLong_attemptUpdate();
 655 
 656   case vmIntrinsics::_getCallerClass:
 657     return inline_native_Reflection_getCallerClass();
 658 
 659   default:
 660     // If you get here, it may be that someone has added a new intrinsic
 661     // to the list in vmSymbols.hpp without implementing it here.
 662 #ifndef PRODUCT


1837         !MacroAssembler::needs_explicit_null_check(offset_type->_hi)) {
1838       return Type::OopPtr;
1839     }
1840     // Otherwise, it might either be oop+off or NULL+addr.
1841     return Type::AnyPtr;
1842   } else {
1843     // No information:
1844     return Type::AnyPtr;
1845   }
1846 }
1847 
1848 inline Node* LibraryCallKit::make_unsafe_address(Node* base, Node* offset) {
1849   int kind = classify_unsafe_addr(base, offset);
1850   if (kind == Type::RawPtr) {
1851     return basic_plus_adr(top(), base, offset);
1852   } else {
1853     return basic_plus_adr(base, offset);
1854   }
1855 }
1856 
1857 //-------------------inline_numberOfLeadingZeros_int/long-----------------------
1858 // inline int Integer.numberOfLeadingZeros(int)
1859 // inline int Long.numberOfLeadingZeros(long)
1860 bool LibraryCallKit::inline_numberOfLeadingZeros(vmIntrinsics::ID id) {
1861   assert(id == vmIntrinsics::_numberOfLeadingZeros_i || id == vmIntrinsics::_numberOfLeadingZeros_l, "not numberOfLeadingZeros");
1862   if (id == vmIntrinsics::_numberOfLeadingZeros_i && !Matcher::match_rule_supported(Op_CountLeadingZerosI)) return false;
1863   if (id == vmIntrinsics::_numberOfLeadingZeros_l && !Matcher::match_rule_supported(Op_CountLeadingZerosL)) return false;
1864   _sp += arg_size();  // restore stack pointer
1865   switch (id) {
1866   case vmIntrinsics::_numberOfLeadingZeros_i:
1867     push(_gvn.transform(new (C, 2) CountLeadingZerosINode(pop())));
1868     break;
1869   case vmIntrinsics::_numberOfLeadingZeros_l:
1870     push(_gvn.transform(new (C, 2) CountLeadingZerosLNode(pop_pair())));
1871     break;
1872   default:
1873     ShouldNotReachHere();
1874   }
1875   return true;
1876 }
1877 
1878 //-------------------inline_numberOfTrailingZeros_int/long----------------------
1879 // inline int Integer.numberOfTrailingZeros(int)
1880 // inline int Long.numberOfTrailingZeros(long)
1881 bool LibraryCallKit::inline_numberOfTrailingZeros(vmIntrinsics::ID id) {
1882   assert(id == vmIntrinsics::_numberOfTrailingZeros_i || id == vmIntrinsics::_numberOfTrailingZeros_l, "not numberOfTrailingZeros");
1883   if (id == vmIntrinsics::_numberOfTrailingZeros_i && !Matcher::match_rule_supported(Op_CountTrailingZerosI)) return false;
1884   if (id == vmIntrinsics::_numberOfTrailingZeros_l && !Matcher::match_rule_supported(Op_CountTrailingZerosL)) return false;
1885   _sp += arg_size();  // restore stack pointer
1886   switch (id) {
1887   case vmIntrinsics::_numberOfTrailingZeros_i:
1888     push(_gvn.transform(new (C, 2) CountTrailingZerosINode(pop())));
1889     break;
1890   case vmIntrinsics::_numberOfTrailingZeros_l:
1891     push(_gvn.transform(new (C, 2) CountTrailingZerosLNode(pop_pair())));
1892     break;
1893   default:
1894     ShouldNotReachHere();
1895   }
1896   return true;
1897 }
1898 
1899 //----------------------------inline_bitCount_int/long-----------------------
1900 // inline int Integer.bitCount(int)
1901 // inline int Long.bitCount(long)
1902 bool LibraryCallKit::inline_bitCount(vmIntrinsics::ID id) {
1903   assert(id == vmIntrinsics::_bitCount_i || id == vmIntrinsics::_bitCount_l, "not bitCount");
1904   if (id == vmIntrinsics::_bitCount_i && !Matcher::has_match_rule(Op_PopCountI)) return false;
1905   if (id == vmIntrinsics::_bitCount_l && !Matcher::has_match_rule(Op_PopCountL)) return false;
1906   _sp += arg_size();  // restore stack pointer
1907   switch (id) {
1908   case vmIntrinsics::_bitCount_i:
1909     push(_gvn.transform(new (C, 2) PopCountINode(pop())));
1910     break;
1911   case vmIntrinsics::_bitCount_l:
1912     push(_gvn.transform(new (C, 2) PopCountLNode(pop_pair())));
1913     break;
1914   default:
1915     ShouldNotReachHere();
1916   }
1917   return true;
1918 }


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