hotspot/src/share/vm/opto/library_call.cpp
changeset 33589 7cbd1b2c139b
parent 33198 b37ad9fbf681
child 33606 af4ec8a4635b
equal deleted inserted replaced
33580:c2d95df2c54e 33589:7cbd1b2c139b
  1362 // public static double Math.sqrt(double)
  1362 // public static double Math.sqrt(double)
  1363 // public static double Math.log(double)
  1363 // public static double Math.log(double)
  1364 // public static double Math.log10(double)
  1364 // public static double Math.log10(double)
  1365 bool LibraryCallKit::inline_math(vmIntrinsics::ID id) {
  1365 bool LibraryCallKit::inline_math(vmIntrinsics::ID id) {
  1366   Node* arg = round_double_node(argument(0));
  1366   Node* arg = round_double_node(argument(0));
  1367   Node* n;
  1367   Node* n = NULL;
  1368   switch (id) {
  1368   switch (id) {
  1369   case vmIntrinsics::_dabs:   n = new AbsDNode(                arg);  break;
  1369   case vmIntrinsics::_dabs:   n = new AbsDNode(                arg);  break;
  1370   case vmIntrinsics::_dsqrt:  n = new SqrtDNode(C, control(),  arg);  break;
  1370   case vmIntrinsics::_dsqrt:  n = new SqrtDNode(C, control(),  arg);  break;
  1371   case vmIntrinsics::_dlog:   n = new LogDNode(C, control(),   arg);  break;
  1371   case vmIntrinsics::_dlog:   n = new LogDNode(C, control(),   arg);  break;
  1372   case vmIntrinsics::_dlog10: n = new Log10DNode(C, control(), arg);  break;
  1372   case vmIntrinsics::_dlog10: n = new Log10DNode(C, control(), arg);  break;
  2106 // inline short     Short.reverseBytes(short)
  2106 // inline short     Short.reverseBytes(short)
  2107 // inline int     Integer.reverseBytes(int)
  2107 // inline int     Integer.reverseBytes(int)
  2108 // inline long       Long.reverseBytes(long)
  2108 // inline long       Long.reverseBytes(long)
  2109 bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) {
  2109 bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) {
  2110   Node* arg = argument(0);
  2110   Node* arg = argument(0);
  2111   Node* n;
  2111   Node* n = NULL;
  2112   switch (id) {
  2112   switch (id) {
  2113   case vmIntrinsics::_numberOfLeadingZeros_i:   n = new CountLeadingZerosINode( arg);  break;
  2113   case vmIntrinsics::_numberOfLeadingZeros_i:   n = new CountLeadingZerosINode( arg);  break;
  2114   case vmIntrinsics::_numberOfLeadingZeros_l:   n = new CountLeadingZerosLNode( arg);  break;
  2114   case vmIntrinsics::_numberOfLeadingZeros_l:   n = new CountLeadingZerosLNode( arg);  break;
  2115   case vmIntrinsics::_numberOfTrailingZeros_i:  n = new CountTrailingZerosINode(arg);  break;
  2115   case vmIntrinsics::_numberOfTrailingZeros_i:  n = new CountTrailingZerosINode(arg);  break;
  2116   case vmIntrinsics::_numberOfTrailingZeros_l:  n = new CountTrailingZerosLNode(arg);  break;
  2116   case vmIntrinsics::_numberOfTrailingZeros_l:  n = new CountTrailingZerosLNode(arg);  break;
  2646   //          dependency which will confuse the scheduler.
  2646   //          dependency which will confuse the scheduler.
  2647   Node *mem = memory(alias_idx);
  2647   Node *mem = memory(alias_idx);
  2648 
  2648 
  2649   // For now, we handle only those cases that actually exist: ints,
  2649   // For now, we handle only those cases that actually exist: ints,
  2650   // longs, and Object. Adding others should be straightforward.
  2650   // longs, and Object. Adding others should be straightforward.
  2651   Node* load_store;
  2651   Node* load_store = NULL;
  2652   switch(type) {
  2652   switch(type) {
  2653   case T_INT:
  2653   case T_INT:
  2654     if (kind == LS_xadd) {
  2654     if (kind == LS_xadd) {
  2655       load_store = _gvn.transform(new GetAndAddINode(control(), mem, adr, newval, adr_type));
  2655       load_store = _gvn.transform(new GetAndAddINode(control(), mem, adr, newval, adr_type));
  2656     } else if (kind == LS_xchg) {
  2656     } else if (kind == LS_xchg) {
  3652   Node* original          = argument(0);
  3652   Node* original          = argument(0);
  3653   Node* start             = is_copyOfRange? argument(1): intcon(0);
  3653   Node* start             = is_copyOfRange? argument(1): intcon(0);
  3654   Node* end               = is_copyOfRange? argument(2): argument(1);
  3654   Node* end               = is_copyOfRange? argument(2): argument(1);
  3655   Node* array_type_mirror = is_copyOfRange? argument(3): argument(2);
  3655   Node* array_type_mirror = is_copyOfRange? argument(3): argument(2);
  3656 
  3656 
  3657   Node* newcopy;
  3657   Node* newcopy = NULL;
  3658 
  3658 
  3659   // Set the original stack and the reexecute bit for the interpreter to reexecute
  3659   // Set the original stack and the reexecute bit for the interpreter to reexecute
  3660   // the bytecode that invokes Arrays.copyOf if deoptimization happens.
  3660   // the bytecode that invokes Arrays.copyOf if deoptimization happens.
  3661   { PreserveReexecuteState preexecs(this);
  3661   { PreserveReexecuteState preexecs(this);
  3662     jvms()->set_should_reexecute(true);
  3662     jvms()->set_should_reexecute(true);
  4087   return false;  // bail-out; let JVM_GetCallerClass do the work
  4087   return false;  // bail-out; let JVM_GetCallerClass do the work
  4088 }
  4088 }
  4089 
  4089 
  4090 bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) {
  4090 bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) {
  4091   Node* arg = argument(0);
  4091   Node* arg = argument(0);
  4092   Node* result;
  4092   Node* result = NULL;
  4093 
  4093 
  4094   switch (id) {
  4094   switch (id) {
  4095   case vmIntrinsics::_floatToRawIntBits:    result = new MoveF2INode(arg);  break;
  4095   case vmIntrinsics::_floatToRawIntBits:    result = new MoveF2INode(arg);  break;
  4096   case vmIntrinsics::_intBitsToFloat:       result = new MoveI2FNode(arg);  break;
  4096   case vmIntrinsics::_intBitsToFloat:       result = new MoveI2FNode(arg);  break;
  4097   case vmIntrinsics::_doubleToRawLongBits:  result = new MoveD2LNode(arg);  break;
  4097   case vmIntrinsics::_doubleToRawLongBits:  result = new MoveD2LNode(arg);  break;
  5716 }
  5716 }
  5717 
  5717 
  5718 
  5718 
  5719 //------------------------------inline_aescrypt_Block-----------------------
  5719 //------------------------------inline_aescrypt_Block-----------------------
  5720 bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) {
  5720 bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) {
  5721   address stubAddr;
  5721   address stubAddr = NULL;
  5722   const char *stubName;
  5722   const char *stubName;
  5723   assert(UseAES, "need AES instruction support");
  5723   assert(UseAES, "need AES instruction support");
  5724 
  5724 
  5725   switch(id) {
  5725   switch(id) {
  5726   case vmIntrinsics::_aescrypt_encryptBlock:
  5726   case vmIntrinsics::_aescrypt_encryptBlock:
  5782   return true;
  5782   return true;
  5783 }
  5783 }
  5784 
  5784 
  5785 //------------------------------inline_cipherBlockChaining_AESCrypt-----------------------
  5785 //------------------------------inline_cipherBlockChaining_AESCrypt-----------------------
  5786 bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) {
  5786 bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) {
  5787   address stubAddr;
  5787   address stubAddr = NULL;
  5788   const char *stubName;
  5788   const char *stubName = NULL;
  5789 
  5789 
  5790   assert(UseAES, "need AES instruction support");
  5790   assert(UseAES, "need AES instruction support");
  5791 
  5791 
  5792   switch(id) {
  5792   switch(id) {
  5793   case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
  5793   case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: