< prev index next >

src/share/vm/opto/library_call.cpp

Print this page

        

@@ -1611,12 +1611,10 @@
 bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) {
   Node* arg = round_double_node(argument(0));
   Node* n = NULL;
 
   switch (id) {
-  case vmIntrinsics::_dsin:  n = new SinDNode(C, control(), arg);  break;
-  case vmIntrinsics::_dcos:  n = new CosDNode(C, control(), arg);  break;
   case vmIntrinsics::_dtan:  n = new TanDNode(C, control(), arg);  break;
   default:  fatal_unexpected_iid(id);  break;
   }
   n = _gvn.transform(n);
 

@@ -1675,20 +1673,10 @@
     phi->init_req(2, n);
 
     // Slow path - non-blocking leaf call
     Node* call = NULL;
     switch (id) {
-    case vmIntrinsics::_dsin:
-      call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(),
-                               CAST_FROM_FN_PTR(address, SharedRuntime::dsin),
-                               "Sin", NULL, arg, top());
-      break;
-    case vmIntrinsics::_dcos:
-      call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(),
-                               CAST_FROM_FN_PTR(address, SharedRuntime::dcos),
-                               "Cos", NULL, arg, top());
-      break;
     case vmIntrinsics::_dtan:
       call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(),
                                CAST_FROM_FN_PTR(address, SharedRuntime::dtan),
                                "Tan", NULL, arg, top());
       break;

@@ -1972,14 +1960,18 @@
 //------------------------------inline_math_native-----------------------------
 bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) {
 #define FN_PTR(f) CAST_FROM_FN_PTR(address, f)
   switch (id) {
     // These intrinsics are not properly supported on all hardware
-  case vmIntrinsics::_dcos:   return Matcher::has_match_rule(Op_CosD)   ? inline_trig(id) :
-    runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos),   "COS");
-  case vmIntrinsics::_dsin:   return Matcher::has_match_rule(Op_SinD)   ? inline_trig(id) :
+  case vmIntrinsics::_dsin:
+    return StubRoutines::dsin() != NULL ?
+      runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") :
     runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin),   "SIN");
+  case vmIntrinsics::_dcos:
+    return StubRoutines::dcos() != NULL ?
+      runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dcos(), "dcos") :
+      runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos),   "COS");
   case vmIntrinsics::_dtan:   return Matcher::has_match_rule(Op_TanD)   ? inline_trig(id) :
     runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dtan),   "TAN");
 
   case vmIntrinsics::_dlog:
     return StubRoutines::dlog() != NULL ?
< prev index next >