< prev index next >

src/cpu/x86/vm/interpreter_x86_32.cpp

Print this page




 100   //       called accidentally since the SharedRuntime entry points will
 101   //       not work for JDK 1.2.
 102   //
 103   // We no longer need to check for JDK 1.2 since it's EOL'ed.
 104   // The following check existed in pre 1.6 implementation,
 105   //    if (Universe::is_jdk12x_version()) {
 106   //      __ should_not_reach_here();
 107   //    }
 108   // Universe::is_jdk12x_version() always returns false since
 109   // the JDK version is not yet determined when this method is called.
 110   // This method is called during interpreter_init() whereas
 111   // JDK version is only determined when universe2_init() is called.
 112 
 113   // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
 114   //       java methods.  Interpreter::method_kind(...) will select
 115   //       this entry point for the corresponding methods in JDK 1.3.
 116   // get argument
 117   __ fld_d(Address(rsp, 1*wordSize));
 118   switch (kind) {
 119     case Interpreter::java_lang_math_sin :
 120         __ trigfunc('s');







 121         break;
 122     case Interpreter::java_lang_math_cos :
 123         __ trigfunc('c');







 124         break;
 125     case Interpreter::java_lang_math_tan :
 126         __ trigfunc('t');
 127         break;
 128     case Interpreter::java_lang_math_sqrt:
 129         __ fsqrt();
 130         break;
 131     case Interpreter::java_lang_math_abs:
 132         __ fabs();
 133         break;
 134     case Interpreter::java_lang_math_log:
 135         __ subptr(rsp, 2 * wordSize);
 136         __ fstp_d(Address(rsp, 0));
 137         if (VM_Version::supports_sse2()) {
 138           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
 139         }
 140         else {
 141           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)));
 142         }
 143         __ addptr(rsp, 2 * wordSize);
 144         break;
 145     case Interpreter::java_lang_math_log10:
 146         __ flog10();
 147         // Store to stack to convert 80bit precision back to 64bits
 148         __ push_fTOS();
 149         __ pop_fTOS();
 150         break;
 151     case Interpreter::java_lang_math_pow:
 152       __ fld_d(Address(rsp, 3*wordSize)); // second argument
 153       __ pow_with_fallback(0);
 154       // Store to stack to convert 80bit precision back to 64bits
 155       __ push_fTOS();
 156       __ pop_fTOS();
 157       break;
 158     case Interpreter::java_lang_math_exp:
 159       __ subptr(rsp, 2*wordSize);
 160       __ fstp_d(Address(rsp, 0));




 100   //       called accidentally since the SharedRuntime entry points will
 101   //       not work for JDK 1.2.
 102   //
 103   // We no longer need to check for JDK 1.2 since it's EOL'ed.
 104   // The following check existed in pre 1.6 implementation,
 105   //    if (Universe::is_jdk12x_version()) {
 106   //      __ should_not_reach_here();
 107   //    }
 108   // Universe::is_jdk12x_version() always returns false since
 109   // the JDK version is not yet determined when this method is called.
 110   // This method is called during interpreter_init() whereas
 111   // JDK version is only determined when universe2_init() is called.
 112 
 113   // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
 114   //       java methods.  Interpreter::method_kind(...) will select
 115   //       this entry point for the corresponding methods in JDK 1.3.
 116   // get argument
 117   __ fld_d(Address(rsp, 1*wordSize));
 118   switch (kind) {
 119     case Interpreter::java_lang_math_sin :
 120         __ subptr(rsp, 2 * wordSize);
 121         __ fstp_d(Address(rsp, 0));
 122         if (VM_Version::supports_sse2() && StubRoutines::dsin() != NULL) {
 123           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin())));
 124         } else {
 125           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin)));
 126         }
 127         __ addptr(rsp, 2 * wordSize);
 128         break;
 129     case Interpreter::java_lang_math_cos :
 130         __ subptr(rsp, 2 * wordSize);
 131         __ fstp_d(Address(rsp, 0));
 132         if (VM_Version::supports_sse2() && StubRoutines::dcos() != NULL) {
 133           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos())));
 134         } else {
 135           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos)));
 136         }
 137         __ addptr(rsp, 2 * wordSize);
 138         break;
 139     case Interpreter::java_lang_math_tan :
 140         __ trigfunc('t');
 141         break;
 142     case Interpreter::java_lang_math_sqrt:
 143         __ fsqrt();
 144         break;
 145     case Interpreter::java_lang_math_abs:
 146         __ fabs();
 147         break;
 148     case Interpreter::java_lang_math_log:
 149         __ subptr(rsp, 2 * wordSize);
 150         __ fstp_d(Address(rsp, 0));
 151         if (VM_Version::supports_sse2()) {
 152           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog())));
 153         } else {

 154           __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)));
 155         }
 156         __ addptr(rsp, 2 * wordSize);
 157         break;
 158     case Interpreter::java_lang_math_log10:
 159         __ flog10();
 160         // Store to stack to convert 80bit precision back to 64bits
 161         __ push_fTOS();
 162         __ pop_fTOS();
 163         break;
 164     case Interpreter::java_lang_math_pow:
 165       __ fld_d(Address(rsp, 3*wordSize)); // second argument
 166       __ pow_with_fallback(0);
 167       // Store to stack to convert 80bit precision back to 64bits
 168       __ push_fTOS();
 169       __ pop_fTOS();
 170       break;
 171     case Interpreter::java_lang_math_exp:
 172       __ subptr(rsp, 2*wordSize);
 173       __ fstp_d(Address(rsp, 0));


< prev index next >