< prev index next >

src/cpu/x86/vm/interpreter_x86_64.cpp

Print this page




 239   //      __ should_not_reach_here();
 240   //    }
 241   // Universe::is_jdk12x_version() always returns false since
 242   // the JDK version is not yet determined when this method is called.
 243   // This method is called during interpreter_init() whereas
 244   // JDK version is only determined when universe2_init() is called.
 245 
 246   // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
 247   //       java methods.  Interpreter::method_kind(...) will select
 248   //       this entry point for the corresponding methods in JDK 1.3.
 249   // get argument
 250 
 251   if (kind == Interpreter::java_lang_math_sqrt) {
 252     __ sqrtsd(xmm0, Address(rsp, wordSize));
 253   } else if (kind == Interpreter::java_lang_math_exp) {
 254     __ movdbl(xmm0, Address(rsp, wordSize));
 255     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
 256   } else if (kind == Interpreter::java_lang_math_log) {
 257     __ movdbl(xmm0, Address(rsp, wordSize));
 258     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));














 259   } else {
 260     __ fld_d(Address(rsp, wordSize));
 261     switch (kind) {
 262       case Interpreter::java_lang_math_sin :
 263           __ trigfunc('s');
 264           break;
 265       case Interpreter::java_lang_math_cos :
 266           __ trigfunc('c');
 267           break;
 268       case Interpreter::java_lang_math_tan :
 269           __ trigfunc('t');
 270           break;
 271       case Interpreter::java_lang_math_abs:
 272           __ fabs();
 273           break;
 274       case Interpreter::java_lang_math_log10:
 275           __ flog10();
 276           break;
 277       case Interpreter::java_lang_math_pow:
 278           __ fld_d(Address(rsp, 3*wordSize)); // second argument (one
 279                                               // empty stack slot)
 280           __ pow_with_fallback(0);
 281           break;
 282       default                              :
 283           ShouldNotReachHere();
 284     }
 285 
 286     // return double result in xmm0 for interpreter and compilers.
 287     __ subptr(rsp, 2*wordSize);




 239   //      __ should_not_reach_here();
 240   //    }
 241   // Universe::is_jdk12x_version() always returns false since
 242   // the JDK version is not yet determined when this method is called.
 243   // This method is called during interpreter_init() whereas
 244   // JDK version is only determined when universe2_init() is called.
 245 
 246   // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
 247   //       java methods.  Interpreter::method_kind(...) will select
 248   //       this entry point for the corresponding methods in JDK 1.3.
 249   // get argument
 250 
 251   if (kind == Interpreter::java_lang_math_sqrt) {
 252     __ sqrtsd(xmm0, Address(rsp, wordSize));
 253   } else if (kind == Interpreter::java_lang_math_exp) {
 254     __ movdbl(xmm0, Address(rsp, wordSize));
 255     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
 256   } else if (kind == Interpreter::java_lang_math_log) {
 257     __ movdbl(xmm0, Address(rsp, wordSize));
 258     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
 259   } else if (kind == Interpreter::java_lang_math_sin) {
 260     __ movdbl(xmm0, Address(rsp, wordSize));
 261     if (StubRoutines::dsin() != NULL) {
 262       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin())));
 263     } else {
 264       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin)));
 265     }
 266   } else if (kind == Interpreter::java_lang_math_cos) {
 267     __ movdbl(xmm0, Address(rsp, wordSize));
 268     if (StubRoutines::dcos() != NULL) {
 269       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos())));
 270     } else {
 271       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos)));
 272     }
 273   } else {
 274     __ fld_d(Address(rsp, wordSize));
 275     switch (kind) {






 276       case Interpreter::java_lang_math_tan :
 277           __ trigfunc('t');
 278           break;
 279       case Interpreter::java_lang_math_abs:
 280           __ fabs();
 281           break;
 282       case Interpreter::java_lang_math_log10:
 283           __ flog10();
 284           break;
 285       case Interpreter::java_lang_math_pow:
 286           __ fld_d(Address(rsp, 3*wordSize)); // second argument (one
 287                                               // empty stack slot)
 288           __ pow_with_fallback(0);
 289           break;
 290       default                              :
 291           ShouldNotReachHere();
 292     }
 293 
 294     // return double result in xmm0 for interpreter and compilers.
 295     __ subptr(rsp, 2*wordSize);


< prev index next >