hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp
changeset 38018 1dc6c6f21231
parent 35495 e27da438fa13
child 38238 1bbcc430c78d
equal deleted inserted replaced
38017:55047d16f141 38018:1dc6c6f21231
    27 #include "interpreter/interp_masm.hpp"
    27 #include "interpreter/interp_masm.hpp"
    28 #include "interpreter/interpreter.hpp"
    28 #include "interpreter/interpreter.hpp"
    29 #include "interpreter/interpreterRuntime.hpp"
    29 #include "interpreter/interpreterRuntime.hpp"
    30 #include "interpreter/templateInterpreterGenerator.hpp"
    30 #include "interpreter/templateInterpreterGenerator.hpp"
    31 #include "runtime/arguments.hpp"
    31 #include "runtime/arguments.hpp"
       
    32 #include "runtime/sharedRuntime.hpp"
    32 
    33 
    33 #define __ _masm->
    34 #define __ _masm->
    34 
    35 
    35 #ifdef _WIN64
    36 #ifdef _WIN64
    36 address TemplateInterpreterGenerator::generate_slow_signature_handler() {
    37 address TemplateInterpreterGenerator::generate_slow_signature_handler() {
   371 
   372 
   372   if (kind == Interpreter::java_lang_math_sqrt) {
   373   if (kind == Interpreter::java_lang_math_sqrt) {
   373     __ sqrtsd(xmm0, Address(rsp, wordSize));
   374     __ sqrtsd(xmm0, Address(rsp, wordSize));
   374   } else if (kind == Interpreter::java_lang_math_exp) {
   375   } else if (kind == Interpreter::java_lang_math_exp) {
   375     __ movdbl(xmm0, Address(rsp, wordSize));
   376     __ movdbl(xmm0, Address(rsp, wordSize));
   376     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
   377     if (StubRoutines::dexp() != NULL) {
       
   378       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp())));
       
   379     } else {
       
   380       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp)));
       
   381     }
   377   } else if (kind == Interpreter::java_lang_math_log) {
   382   } else if (kind == Interpreter::java_lang_math_log) {
   378     __ movdbl(xmm0, Address(rsp, wordSize));
   383     __ movdbl(xmm0, Address(rsp, wordSize));
   379     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
   384     if (StubRoutines::dlog() != NULL) {
       
   385       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
       
   386     } else {
       
   387       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)));
       
   388     }
       
   389   } else if (kind == Interpreter::java_lang_math_log10) {
       
   390     __ movdbl(xmm0, Address(rsp, wordSize));
       
   391     if (StubRoutines::dlog10() != NULL) {
       
   392       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10())));
       
   393     } else {
       
   394       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10)));
       
   395     }
       
   396   } else if (kind == Interpreter::java_lang_math_sin) {
       
   397     __ movdbl(xmm0, Address(rsp, wordSize));
       
   398     if (StubRoutines::dsin() != NULL) {
       
   399       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin())));
       
   400     } else {
       
   401       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin)));
       
   402     }
       
   403   } else if (kind == Interpreter::java_lang_math_cos) {
       
   404     __ movdbl(xmm0, Address(rsp, wordSize));
       
   405     if (StubRoutines::dcos() != NULL) {
       
   406       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos())));
       
   407     } else {
       
   408       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos)));
       
   409     }
   380   } else if (kind == Interpreter::java_lang_math_pow) {
   410   } else if (kind == Interpreter::java_lang_math_pow) {
   381     __ movdbl(xmm1, Address(rsp, wordSize));
   411     __ movdbl(xmm1, Address(rsp, wordSize));
   382     __ movdbl(xmm0, Address(rsp, 3 * wordSize));
   412     __ movdbl(xmm0, Address(rsp, 3 * wordSize));
   383     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow())));
   413     if (StubRoutines::dpow() != NULL) {
       
   414       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow())));
       
   415     } else {
       
   416       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow)));
       
   417     }
       
   418   } else if (kind == Interpreter::java_lang_math_tan) {
       
   419     __ movdbl(xmm0, Address(rsp, wordSize));
       
   420     if (StubRoutines::dtan() != NULL) {
       
   421       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtan())));
       
   422     } else {
       
   423       __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtan)));
       
   424     }
   384   } else {
   425   } else {
   385     __ fld_d(Address(rsp, wordSize));
   426     __ fld_d(Address(rsp, wordSize));
   386     switch (kind) {
   427     switch (kind) {
   387       case Interpreter::java_lang_math_sin :
       
   388           __ trigfunc('s');
       
   389           break;
       
   390       case Interpreter::java_lang_math_cos :
       
   391           __ trigfunc('c');
       
   392           break;
       
   393       case Interpreter::java_lang_math_tan :
       
   394           __ trigfunc('t');
       
   395           break;
       
   396       case Interpreter::java_lang_math_abs:
   428       case Interpreter::java_lang_math_abs:
   397           __ fabs();
   429           __ fabs();
   398           break;
       
   399       case Interpreter::java_lang_math_log10:
       
   400           __ flog10();
       
   401           break;
   430           break;
   402       default                              :
   431       default                              :
   403           ShouldNotReachHere();
   432           ShouldNotReachHere();
   404     }
   433     }
   405 
   434