2999 __ trigfunc('c');
3000 __ fstp_d(Address(rsp, 0));
3001 __ movdbl(xmm0, Address(rsp, 0));
3002 __ addq(rsp, 8);
3003 __ ret(0);
3004 }
3005 {
3006 StubCodeMark mark(this, "StubRoutines", "tan");
3007 StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
3008
3009 __ subq(rsp, 8);
3010 __ movdbl(Address(rsp, 0), xmm0);
3011 __ fld_d(Address(rsp, 0));
3012 __ trigfunc('t');
3013 __ fstp_d(Address(rsp, 0));
3014 __ movdbl(xmm0, Address(rsp, 0));
3015 __ addq(rsp, 8);
3016 __ ret(0);
3017 }
3018 {
3019 StubCodeMark mark(this, "StubRoutines", "exp");
3020 StubRoutines::_intrinsic_exp = (double (*)(double)) __ pc();
3021
3022 __ subq(rsp, 8);
3023 __ movdbl(Address(rsp, 0), xmm0);
3024 __ fld_d(Address(rsp, 0));
3025 __ exp_with_fallback(0);
3026 __ fstp_d(Address(rsp, 0));
3027 __ movdbl(xmm0, Address(rsp, 0));
3028 __ addq(rsp, 8);
3029 __ ret(0);
3030 }
3031 {
3032 StubCodeMark mark(this, "StubRoutines", "pow");
3033 StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc();
3034
3035 __ subq(rsp, 8);
3036 __ movdbl(Address(rsp, 0), xmm1);
3037 __ fld_d(Address(rsp, 0));
3038 __ movdbl(Address(rsp, 0), xmm0);
3039 __ fld_d(Address(rsp, 0));
3040 __ pow_with_fallback(0);
3041 __ fstp_d(Address(rsp, 0));
3042 __ movdbl(xmm0, Address(rsp, 0));
3043 __ addq(rsp, 8);
3044 __ ret(0);
3045 }
3046 }
3047
3048 // AES intrinsic stubs
3049 enum {AESBlockSize = 16};
3050
3051 address generate_key_shuffle_mask() {
4042 __ enter(); // required for proper stackwalking of RuntimeStub frame
4043
4044 setup_arg_regs(4); // out => rdi, in => rsi, offset => rdx
4045 // len => rcx, k => r8
4046 // r9 and r10 may be used to save non-volatile registers
4047 #ifdef _WIN64
4048 // last argument is on stack on Win64
4049 __ movl(k, Address(rsp, 6 * wordSize));
4050 #endif
4051 __ movptr(r11, rdx); // move offset in rdx to offset(r11)
4052 __ mul_add(out, in, offset, len, k, tmp1, tmp2, tmp3, tmp4, tmp5, rdx, rax);
4053
4054 restore_arg_regs();
4055
4056 __ leave(); // required for proper stackwalking of RuntimeStub frame
4057 __ ret(0);
4058
4059 return start;
4060 }
4061
4062
4063 #undef __
4064 #define __ masm->
4065
4066 // Continuation point for throwing of implicit exceptions that are
4067 // not handled in the current activation. Fabricates an exception
4068 // oop and initiates normal exception dispatching in this
4069 // frame. Since we need to preserve callee-saved values (currently
4070 // only for C2, but done for C1 as well) we need a callee-saved oop
4071 // map and therefore have to make these stubs into RuntimeStubs
4072 // rather than BufferBlobs. If the compiler needs all registers to
4073 // be preserved between the fault point and the exception handler
4074 // then it must assume responsibility for that in
4075 // AbstractCompiler::continuation_for_implicit_null_exception or
4076 // continuation_for_implicit_division_by_zero_exception. All other
4077 // implicit exceptions (e.g., NullPointerException or
4078 // AbstractMethodError on entry) are either at call sites or
4079 // otherwise assume that stack unwinding will be initiated, so
4080 // caller saved registers were assumed volatile in the compiler.
4081 address generate_throw_exception(const char* name,
4222 StubRoutines::_handler_for_unsafe_access_entry =
4223 generate_handler_for_unsafe_access();
4224
4225 // platform dependent
4226 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp();
4227 StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp();
4228
4229 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr();
4230
4231 // Build this early so it's available for the interpreter.
4232 StubRoutines::_throw_StackOverflowError_entry =
4233 generate_throw_exception("StackOverflowError throw_exception",
4234 CAST_FROM_FN_PTR(address,
4235 SharedRuntime::
4236 throw_StackOverflowError));
4237 if (UseCRC32Intrinsics) {
4238 // set table address before stub generation which use it
4239 StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
4240 StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32();
4241 }
4242 }
4243
4244 void generate_all() {
4245 // Generates all stubs and initializes the entry points
4246
4247 // These entry points require SharedInfo::stack0 to be set up in
4248 // non-core builds and need to be relocatable, so they each
4249 // fabricate a RuntimeStub internally.
4250 StubRoutines::_throw_AbstractMethodError_entry =
4251 generate_throw_exception("AbstractMethodError throw_exception",
4252 CAST_FROM_FN_PTR(address,
4253 SharedRuntime::
4254 throw_AbstractMethodError));
4255
4256 StubRoutines::_throw_IncompatibleClassChangeError_entry =
4257 generate_throw_exception("IncompatibleClassChangeError throw_exception",
4258 CAST_FROM_FN_PTR(address,
4259 SharedRuntime::
4260 throw_IncompatibleClassChangeError));
4261
|
2999 __ trigfunc('c');
3000 __ fstp_d(Address(rsp, 0));
3001 __ movdbl(xmm0, Address(rsp, 0));
3002 __ addq(rsp, 8);
3003 __ ret(0);
3004 }
3005 {
3006 StubCodeMark mark(this, "StubRoutines", "tan");
3007 StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
3008
3009 __ subq(rsp, 8);
3010 __ movdbl(Address(rsp, 0), xmm0);
3011 __ fld_d(Address(rsp, 0));
3012 __ trigfunc('t');
3013 __ fstp_d(Address(rsp, 0));
3014 __ movdbl(xmm0, Address(rsp, 0));
3015 __ addq(rsp, 8);
3016 __ ret(0);
3017 }
3018 {
3019 StubCodeMark mark(this, "StubRoutines", "pow");
3020 StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc();
3021
3022 __ subq(rsp, 8);
3023 __ movdbl(Address(rsp, 0), xmm1);
3024 __ fld_d(Address(rsp, 0));
3025 __ movdbl(Address(rsp, 0), xmm0);
3026 __ fld_d(Address(rsp, 0));
3027 __ pow_with_fallback(0);
3028 __ fstp_d(Address(rsp, 0));
3029 __ movdbl(xmm0, Address(rsp, 0));
3030 __ addq(rsp, 8);
3031 __ ret(0);
3032 }
3033 }
3034
3035 // AES intrinsic stubs
3036 enum {AESBlockSize = 16};
3037
3038 address generate_key_shuffle_mask() {
4029 __ enter(); // required for proper stackwalking of RuntimeStub frame
4030
4031 setup_arg_regs(4); // out => rdi, in => rsi, offset => rdx
4032 // len => rcx, k => r8
4033 // r9 and r10 may be used to save non-volatile registers
4034 #ifdef _WIN64
4035 // last argument is on stack on Win64
4036 __ movl(k, Address(rsp, 6 * wordSize));
4037 #endif
4038 __ movptr(r11, rdx); // move offset in rdx to offset(r11)
4039 __ mul_add(out, in, offset, len, k, tmp1, tmp2, tmp3, tmp4, tmp5, rdx, rax);
4040
4041 restore_arg_regs();
4042
4043 __ leave(); // required for proper stackwalking of RuntimeStub frame
4044 __ ret(0);
4045
4046 return start;
4047 }
4048
4049 address generate_libmExp() {
4050 address start = __ pc();
4051
4052 const XMMRegister x0 = xmm0;
4053 const XMMRegister x1 = xmm1;
4054 const XMMRegister x2 = xmm2;
4055 const XMMRegister x3 = xmm3;
4056
4057 const XMMRegister x4 = xmm4;
4058 const XMMRegister x5 = xmm5;
4059 const XMMRegister x6 = xmm6;
4060 const XMMRegister x7 = xmm7;
4061
4062 const Register tmp = r11;
4063
4064 BLOCK_COMMENT("Entry:");
4065 __ enter(); // required for proper stackwalking of RuntimeStub frame
4066
4067 #ifdef _WIN64
4068 // save the xmm registers which must be preserved 6-7
4069 __ movdqu(xmm_save(6), as_XMMRegister(6));
4070 __ movdqu(xmm_save(7), as_XMMRegister(7));
4071 #endif
4072 __ fast_exp(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
4073
4074 #ifdef _WIN64
4075 // restore xmm regs belonging to calling function
4076 __ movdqu(as_XMMRegister(6), xmm_save(6));
4077 __ movdqu(as_XMMRegister(7), xmm_save(7));
4078 #endif
4079
4080 __ leave(); // required for proper stackwalking of RuntimeStub frame
4081 __ ret(0);
4082
4083 return start;
4084
4085 }
4086
4087
4088 #undef __
4089 #define __ masm->
4090
4091 // Continuation point for throwing of implicit exceptions that are
4092 // not handled in the current activation. Fabricates an exception
4093 // oop and initiates normal exception dispatching in this
4094 // frame. Since we need to preserve callee-saved values (currently
4095 // only for C2, but done for C1 as well) we need a callee-saved oop
4096 // map and therefore have to make these stubs into RuntimeStubs
4097 // rather than BufferBlobs. If the compiler needs all registers to
4098 // be preserved between the fault point and the exception handler
4099 // then it must assume responsibility for that in
4100 // AbstractCompiler::continuation_for_implicit_null_exception or
4101 // continuation_for_implicit_division_by_zero_exception. All other
4102 // implicit exceptions (e.g., NullPointerException or
4103 // AbstractMethodError on entry) are either at call sites or
4104 // otherwise assume that stack unwinding will be initiated, so
4105 // caller saved registers were assumed volatile in the compiler.
4106 address generate_throw_exception(const char* name,
4247 StubRoutines::_handler_for_unsafe_access_entry =
4248 generate_handler_for_unsafe_access();
4249
4250 // platform dependent
4251 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp();
4252 StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp();
4253
4254 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr();
4255
4256 // Build this early so it's available for the interpreter.
4257 StubRoutines::_throw_StackOverflowError_entry =
4258 generate_throw_exception("StackOverflowError throw_exception",
4259 CAST_FROM_FN_PTR(address,
4260 SharedRuntime::
4261 throw_StackOverflowError));
4262 if (UseCRC32Intrinsics) {
4263 // set table address before stub generation which use it
4264 StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
4265 StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32();
4266 }
4267 StubRoutines::_dexp = generate_libmExp();
4268 }
4269
4270 void generate_all() {
4271 // Generates all stubs and initializes the entry points
4272
4273 // These entry points require SharedInfo::stack0 to be set up in
4274 // non-core builds and need to be relocatable, so they each
4275 // fabricate a RuntimeStub internally.
4276 StubRoutines::_throw_AbstractMethodError_entry =
4277 generate_throw_exception("AbstractMethodError throw_exception",
4278 CAST_FROM_FN_PTR(address,
4279 SharedRuntime::
4280 throw_AbstractMethodError));
4281
4282 StubRoutines::_throw_IncompatibleClassChangeError_entry =
4283 generate_throw_exception("IncompatibleClassChangeError throw_exception",
4284 CAST_FROM_FN_PTR(address,
4285 SharedRuntime::
4286 throw_IncompatibleClassChangeError));
4287
|