< prev index next >

src/cpu/x86/vm/stubGenerator_x86_64.cpp

Print this page




2957     StubRoutines::_arrayof_jbyte_arraycopy           = StubRoutines::_jbyte_arraycopy;
2958 
2959     StubRoutines::_arrayof_jshort_disjoint_arraycopy = StubRoutines::_jshort_disjoint_arraycopy;
2960     StubRoutines::_arrayof_jshort_arraycopy          = StubRoutines::_jshort_arraycopy;
2961 
2962     StubRoutines::_arrayof_jint_disjoint_arraycopy   = StubRoutines::_jint_disjoint_arraycopy;
2963     StubRoutines::_arrayof_jint_arraycopy            = StubRoutines::_jint_arraycopy;
2964 
2965     StubRoutines::_arrayof_jlong_disjoint_arraycopy  = StubRoutines::_jlong_disjoint_arraycopy;
2966     StubRoutines::_arrayof_jlong_arraycopy           = StubRoutines::_jlong_arraycopy;
2967 
2968     StubRoutines::_arrayof_oop_disjoint_arraycopy    = StubRoutines::_oop_disjoint_arraycopy;
2969     StubRoutines::_arrayof_oop_arraycopy             = StubRoutines::_oop_arraycopy;
2970 
2971     StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit    = StubRoutines::_oop_disjoint_arraycopy_uninit;
2972     StubRoutines::_arrayof_oop_arraycopy_uninit             = StubRoutines::_oop_arraycopy_uninit;
2973   }
2974 
2975   void generate_math_stubs() {
2976     {
2977       StubCodeMark mark(this, "StubRoutines", "log");
2978       StubRoutines::_intrinsic_log = (double (*)(double)) __ pc();
2979 
2980       __ subq(rsp, 8);
2981       __ movdbl(Address(rsp, 0), xmm0);
2982       __ fld_d(Address(rsp, 0));
2983       __ flog();
2984       __ fstp_d(Address(rsp, 0));
2985       __ movdbl(xmm0, Address(rsp, 0));
2986       __ addq(rsp, 8);
2987       __ ret(0);
2988     }
2989     {
2990       StubCodeMark mark(this, "StubRoutines", "log10");
2991       StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc();
2992 
2993       __ subq(rsp, 8);
2994       __ movdbl(Address(rsp, 0), xmm0);
2995       __ fld_d(Address(rsp, 0));
2996       __ flog10();
2997       __ fstp_d(Address(rsp, 0));
2998       __ movdbl(xmm0, Address(rsp, 0));
2999       __ addq(rsp, 8);
3000       __ ret(0);
3001     }
3002     {
3003       StubCodeMark mark(this, "StubRoutines", "sin");
3004       StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc();
3005 
3006       __ subq(rsp, 8);
3007       __ movdbl(Address(rsp, 0), xmm0);
3008       __ fld_d(Address(rsp, 0));
3009       __ trigfunc('s');


4170   address generate_libmExp() {
4171     address start = __ pc();
4172 
4173     const XMMRegister x0  = xmm0;
4174     const XMMRegister x1  = xmm1;
4175     const XMMRegister x2  = xmm2;
4176     const XMMRegister x3  = xmm3;
4177 
4178     const XMMRegister x4  = xmm4;
4179     const XMMRegister x5  = xmm5;
4180     const XMMRegister x6  = xmm6;
4181     const XMMRegister x7  = xmm7;
4182 
4183     const Register tmp   = r11;
4184 
4185     BLOCK_COMMENT("Entry:");
4186     __ enter(); // required for proper stackwalking of RuntimeStub frame
4187 
4188 #ifdef _WIN64
4189     // save the xmm registers which must be preserved 6-7
4190     __ movdqu(xmm_save(6), as_XMMRegister(6));
4191     __ movdqu(xmm_save(7), as_XMMRegister(7));

4192 #endif
4193       __ fast_exp(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
4194 
4195 #ifdef _WIN64
4196     // restore xmm regs belonging to calling function
4197     __ movdqu(as_XMMRegister(6), xmm_save(6));
4198     __ movdqu(as_XMMRegister(7), xmm_save(7));










































4199 #endif
4200 
4201     __ leave(); // required for proper stackwalking of RuntimeStub frame
4202     __ ret(0);
4203 
4204     return start;
4205 
4206   }
4207 
4208 
4209 #undef __
4210 #define __ masm->
4211 
4212   // Continuation point for throwing of implicit exceptions that are
4213   // not handled in the current activation. Fabricates an exception
4214   // oop and initiates normal exception dispatching in this
4215   // frame. Since we need to preserve callee-saved values (currently
4216   // only for C2, but done for C1 as well) we need a callee-saved oop
4217   // map and therefore have to make these stubs into RuntimeStubs
4218   // rather than BufferBlobs.  If the compiler needs all registers to


4375     StubRoutines::x86::_verify_mxcsr_entry    = generate_verify_mxcsr();
4376 
4377     // Build this early so it's available for the interpreter.
4378     StubRoutines::_throw_StackOverflowError_entry =
4379       generate_throw_exception("StackOverflowError throw_exception",
4380                                CAST_FROM_FN_PTR(address,
4381                                                 SharedRuntime::
4382                                                 throw_StackOverflowError));
4383     if (UseCRC32Intrinsics) {
4384       // set table address before stub generation which use it
4385       StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
4386       StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32();
4387     }
4388 
4389     if (UseCRC32CIntrinsics) {
4390       bool supports_clmul = VM_Version::supports_clmul();
4391       StubRoutines::x86::generate_CRC32C_table(supports_clmul);
4392       StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table;
4393       StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul);
4394     }

4395     StubRoutines::_dexp = generate_libmExp();


4396   }
4397 
4398   void generate_all() {
4399     // Generates all stubs and initializes the entry points
4400 
4401     // These entry points require SharedInfo::stack0 to be set up in
4402     // non-core builds and need to be relocatable, so they each
4403     // fabricate a RuntimeStub internally.
4404     StubRoutines::_throw_AbstractMethodError_entry =
4405       generate_throw_exception("AbstractMethodError throw_exception",
4406                                CAST_FROM_FN_PTR(address,
4407                                                 SharedRuntime::
4408                                                 throw_AbstractMethodError));
4409 
4410     StubRoutines::_throw_IncompatibleClassChangeError_entry =
4411       generate_throw_exception("IncompatibleClassChangeError throw_exception",
4412                                CAST_FROM_FN_PTR(address,
4413                                                 SharedRuntime::
4414                                                 throw_IncompatibleClassChangeError));
4415 




2957     StubRoutines::_arrayof_jbyte_arraycopy           = StubRoutines::_jbyte_arraycopy;
2958 
2959     StubRoutines::_arrayof_jshort_disjoint_arraycopy = StubRoutines::_jshort_disjoint_arraycopy;
2960     StubRoutines::_arrayof_jshort_arraycopy          = StubRoutines::_jshort_arraycopy;
2961 
2962     StubRoutines::_arrayof_jint_disjoint_arraycopy   = StubRoutines::_jint_disjoint_arraycopy;
2963     StubRoutines::_arrayof_jint_arraycopy            = StubRoutines::_jint_arraycopy;
2964 
2965     StubRoutines::_arrayof_jlong_disjoint_arraycopy  = StubRoutines::_jlong_disjoint_arraycopy;
2966     StubRoutines::_arrayof_jlong_arraycopy           = StubRoutines::_jlong_arraycopy;
2967 
2968     StubRoutines::_arrayof_oop_disjoint_arraycopy    = StubRoutines::_oop_disjoint_arraycopy;
2969     StubRoutines::_arrayof_oop_arraycopy             = StubRoutines::_oop_arraycopy;
2970 
2971     StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit    = StubRoutines::_oop_disjoint_arraycopy_uninit;
2972     StubRoutines::_arrayof_oop_arraycopy_uninit             = StubRoutines::_oop_arraycopy_uninit;
2973   }
2974 
2975   void generate_math_stubs() {
2976     {













2977       StubCodeMark mark(this, "StubRoutines", "log10");
2978       StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc();
2979 
2980       __ subq(rsp, 8);
2981       __ movdbl(Address(rsp, 0), xmm0);
2982       __ fld_d(Address(rsp, 0));
2983       __ flog10();
2984       __ fstp_d(Address(rsp, 0));
2985       __ movdbl(xmm0, Address(rsp, 0));
2986       __ addq(rsp, 8);
2987       __ ret(0);
2988     }
2989     {
2990       StubCodeMark mark(this, "StubRoutines", "sin");
2991       StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc();
2992 
2993       __ subq(rsp, 8);
2994       __ movdbl(Address(rsp, 0), xmm0);
2995       __ fld_d(Address(rsp, 0));
2996       __ trigfunc('s');


4157   address generate_libmExp() {
4158     address start = __ pc();
4159 
4160     const XMMRegister x0  = xmm0;
4161     const XMMRegister x1  = xmm1;
4162     const XMMRegister x2  = xmm2;
4163     const XMMRegister x3  = xmm3;
4164 
4165     const XMMRegister x4  = xmm4;
4166     const XMMRegister x5  = xmm5;
4167     const XMMRegister x6  = xmm6;
4168     const XMMRegister x7  = xmm7;
4169 
4170     const Register tmp   = r11;
4171 
4172     BLOCK_COMMENT("Entry:");
4173     __ enter(); // required for proper stackwalking of RuntimeStub frame
4174 
4175 #ifdef _WIN64
4176     // save the xmm registers which must be preserved 6-7
4177     __ subptr(rsp, 4 * wordSize);
4178     __ movdqu(Address(rsp, 0), xmm6);
4179     __ movdqu(Address(rsp, 2 * wordSize), xmm7);
4180 #endif
4181       __ fast_exp(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
4182 
4183 #ifdef _WIN64
4184     // restore xmm regs belonging to calling function
4185       __ movdqu(xmm6, Address(rsp, 0));
4186       __ movdqu(xmm7, Address(rsp, 2 * wordSize));
4187       __ addptr(rsp, 4 * wordSize);
4188 #endif
4189 
4190     __ leave(); // required for proper stackwalking of RuntimeStub frame
4191     __ ret(0);
4192 
4193     return start;
4194 
4195   }
4196 
4197   address generate_libmLog() {
4198     address start = __ pc();
4199 
4200     const XMMRegister x0 = xmm0;
4201     const XMMRegister x1 = xmm1;
4202     const XMMRegister x2 = xmm2;
4203     const XMMRegister x3 = xmm3;
4204 
4205     const XMMRegister x4 = xmm4;
4206     const XMMRegister x5 = xmm5;
4207     const XMMRegister x6 = xmm6;
4208     const XMMRegister x7 = xmm7;
4209 
4210     const Register tmp1 = r11;
4211     const Register tmp2 = r8;
4212 
4213     BLOCK_COMMENT("Entry:");
4214     __ enter(); // required for proper stackwalking of RuntimeStub frame
4215 
4216 #ifdef _WIN64
4217     // save the xmm registers which must be preserved 6-7
4218     __ subptr(rsp, 4 * wordSize);
4219     __ movdqu(Address(rsp, 0), xmm6);
4220     __ movdqu(Address(rsp, 2 * wordSize), xmm7);
4221 #endif
4222     __ fast_log(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2);
4223 
4224 #ifdef _WIN64
4225     // restore xmm regs belonging to calling function
4226     __ movdqu(xmm6, Address(rsp, 0));
4227     __ movdqu(xmm7, Address(rsp, 2 * wordSize));
4228     __ addptr(rsp, 4 * wordSize);
4229 #endif
4230 
4231     __ leave(); // required for proper stackwalking of RuntimeStub frame
4232     __ ret(0);
4233 
4234     return start;
4235 
4236   }
4237 
4238 
4239 #undef __
4240 #define __ masm->
4241 
4242   // Continuation point for throwing of implicit exceptions that are
4243   // not handled in the current activation. Fabricates an exception
4244   // oop and initiates normal exception dispatching in this
4245   // frame. Since we need to preserve callee-saved values (currently
4246   // only for C2, but done for C1 as well) we need a callee-saved oop
4247   // map and therefore have to make these stubs into RuntimeStubs
4248   // rather than BufferBlobs.  If the compiler needs all registers to


4405     StubRoutines::x86::_verify_mxcsr_entry    = generate_verify_mxcsr();
4406 
4407     // Build this early so it's available for the interpreter.
4408     StubRoutines::_throw_StackOverflowError_entry =
4409       generate_throw_exception("StackOverflowError throw_exception",
4410                                CAST_FROM_FN_PTR(address,
4411                                                 SharedRuntime::
4412                                                 throw_StackOverflowError));
4413     if (UseCRC32Intrinsics) {
4414       // set table address before stub generation which use it
4415       StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
4416       StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32();
4417     }
4418 
4419     if (UseCRC32CIntrinsics) {
4420       bool supports_clmul = VM_Version::supports_clmul();
4421       StubRoutines::x86::generate_CRC32C_table(supports_clmul);
4422       StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table;
4423       StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul);
4424     }
4425     if (VM_Version::supports_sse2()) {
4426       StubRoutines::_dexp = generate_libmExp();
4427       StubRoutines::_dlog = generate_libmLog();
4428     }
4429   }
4430 
4431   void generate_all() {
4432     // Generates all stubs and initializes the entry points
4433 
4434     // These entry points require SharedInfo::stack0 to be set up in
4435     // non-core builds and need to be relocatable, so they each
4436     // fabricate a RuntimeStub internally.
4437     StubRoutines::_throw_AbstractMethodError_entry =
4438       generate_throw_exception("AbstractMethodError throw_exception",
4439                                CAST_FROM_FN_PTR(address,
4440                                                 SharedRuntime::
4441                                                 throw_AbstractMethodError));
4442 
4443     StubRoutines::_throw_IncompatibleClassChangeError_entry =
4444       generate_throw_exception("IncompatibleClassChangeError throw_exception",
4445                                CAST_FROM_FN_PTR(address,
4446                                                 SharedRuntime::
4447                                                 throw_IncompatibleClassChangeError));
4448 


< prev index next >