< prev index next >

src/hotspot/cpu/x86/stubGenerator_x86_32.cpp

Print this page




 585     // Call the C code to massage the double.  Result in EAX
 586     if (t == T_INT)
 587       { BLOCK_COMMENT("SharedRuntime::d2i"); }
 588     else if (t == T_LONG)
 589       { BLOCK_COMMENT("SharedRuntime::d2l"); }
 590     __ call_VM_leaf( fcn, 2 );
 591 
 592     // Restore CPU & FPU state
 593     __ pop_FPU_state();
 594     __ pop(rbp);
 595     __ pop(rdi);
 596     __ pop(rsi);
 597     __ pop(rcx);
 598     __ pop(rbx);
 599     __ addptr(rsp, wordSize * 2);
 600 
 601     __ ret(0);
 602 
 603     return start;
 604   }

 605 



















































 606 
 607   //----------------------------------------------------------------------------------------------------
 608   // Non-destructive plausibility checks for oops
 609 
 610   address generate_verify_oop() {
 611     StubCodeMark mark(this, "StubRoutines", "verify_oop");
 612     address start = __ pc();
 613 
 614     // Incoming arguments on stack after saving rax,:
 615     //
 616     // [tos    ]: saved rdx
 617     // [tos + 1]: saved EFLAGS
 618     // [tos + 2]: return address
 619     // [tos + 3]: char* error message
 620     // [tos + 4]: oop   object to verify
 621     // [tos + 5]: saved rax, - saved by caller and bashed
 622 
 623     Label exit, error;
 624     __ pushf();
 625     __ incrementl(ExternalAddress((address) StubRoutines::verify_oop_count_addr()));


3805         StubRoutines::_dcos = generate_libmCos();
3806       }
3807       if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtan)) {
3808         StubRoutines::_dlibm_tan_cot_huge = generate_libm_tan_cot_huge();
3809         StubRoutines::_dtan = generate_libmTan();
3810       }
3811     }
3812   }
3813 
3814   void generate_all() {
3815     // Generates all stubs and initializes the entry points
3816 
3817     // These entry points require SharedInfo::stack0 to be set up in non-core builds
3818     // and need to be relocatable, so they each fabricate a RuntimeStub internally.
3819     StubRoutines::_throw_AbstractMethodError_entry         = generate_throw_exception("AbstractMethodError throw_exception",          CAST_FROM_FN_PTR(address, SharedRuntime::throw_AbstractMethodError));
3820     StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError));
3821     StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call));
3822 
3823     //------------------------------------------------------------------------------------------------------------------------
3824     // entry points that are platform specific








3825 
3826     // support for verify_oop (must happen after universe_init)
3827     StubRoutines::_verify_oop_subroutine_entry     = generate_verify_oop();
3828 
3829     // arraycopy stubs used by compilers
3830     generate_arraycopy_stubs();
3831 
3832     // don't bother generating these AES intrinsic stubs unless global flag is set
3833     if (UseAESIntrinsics) {
3834       StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask();  // might be needed by the others
3835 
3836       StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock();
3837       StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock();
3838       StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt();
3839       StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel();
3840     }
3841 
3842     if (UseAESCTRIntrinsics) {
3843       StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask();
3844       StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel();




 585     // Call the C code to massage the double.  Result in EAX
 586     if (t == T_INT)
 587       { BLOCK_COMMENT("SharedRuntime::d2i"); }
 588     else if (t == T_LONG)
 589       { BLOCK_COMMENT("SharedRuntime::d2l"); }
 590     __ call_VM_leaf( fcn, 2 );
 591 
 592     // Restore CPU & FPU state
 593     __ pop_FPU_state();
 594     __ pop(rbp);
 595     __ pop(rdi);
 596     __ pop(rsi);
 597     __ pop(rcx);
 598     __ pop(rbx);
 599     __ addptr(rsp, wordSize * 2);
 600 
 601     __ ret(0);
 602 
 603     return start;
 604   }
 605   //---------------------------------------------------------------------------------------------------
 606 
 607   address generate_vector_mask(const char *stub_name, int32_t mask) {
 608     __ align(CodeEntryAlignment);
 609     StubCodeMark mark(this, "StubRoutines", stub_name);
 610     address start = __ pc();
 611 
 612     for (int i = 0; i < 16; i++) {
 613       __ emit_data(mask, relocInfo::none, 0);
 614     }
 615 
 616     return start;
 617   }
 618 
 619   address generate_vector_mask_long_double(const char *stub_name, int32_t maskhi, int32_t masklo) {
 620     __ align(CodeEntryAlignment);
 621     StubCodeMark mark(this, "StubRoutines", stub_name);
 622     address start = __ pc();
 623 
 624     for (int i = 0; i < 8; i++) {
 625       __ emit_data(masklo, relocInfo::none, 0);
 626       __ emit_data(maskhi, relocInfo::none, 0);
 627     }
 628 
 629     return start;
 630   }
 631 
 632   //----------------------------------------------------------------------------------------------------
 633 
 634   address generate_vector_byte_perm_mask(const char *stub_name) {
 635     __ align(CodeEntryAlignment);
 636     StubCodeMark mark(this, "StubRoutines", stub_name);
 637     address start = __ pc();
 638 
 639     __ emit_data(0x00000001, relocInfo::none, 0);
 640     __ emit_data(0x00000000, relocInfo::none, 0);
 641     __ emit_data(0x00000003, relocInfo::none, 0);
 642     __ emit_data(0x00000000, relocInfo::none, 0);
 643     __ emit_data(0x00000005, relocInfo::none, 0);
 644     __ emit_data(0x00000000, relocInfo::none, 0);
 645     __ emit_data(0x00000007, relocInfo::none, 0);
 646     __ emit_data(0x00000000, relocInfo::none, 0);
 647     __ emit_data(0x00000000, relocInfo::none, 0);
 648     __ emit_data(0x00000000, relocInfo::none, 0);
 649     __ emit_data(0x00000002, relocInfo::none, 0);
 650     __ emit_data(0x00000000, relocInfo::none, 0);
 651     __ emit_data(0x00000004, relocInfo::none, 0);
 652     __ emit_data(0x00000000, relocInfo::none, 0);
 653     __ emit_data(0x00000006, relocInfo::none, 0);
 654     __ emit_data(0x00000000, relocInfo::none, 0);
 655 
 656     return start;
 657   }
 658 
 659   //----------------------------------------------------------------------------------------------------
 660   // Non-destructive plausibility checks for oops
 661 
 662   address generate_verify_oop() {
 663     StubCodeMark mark(this, "StubRoutines", "verify_oop");
 664     address start = __ pc();
 665 
 666     // Incoming arguments on stack after saving rax,:
 667     //
 668     // [tos    ]: saved rdx
 669     // [tos + 1]: saved EFLAGS
 670     // [tos + 2]: return address
 671     // [tos + 3]: char* error message
 672     // [tos + 4]: oop   object to verify
 673     // [tos + 5]: saved rax, - saved by caller and bashed
 674 
 675     Label exit, error;
 676     __ pushf();
 677     __ incrementl(ExternalAddress((address) StubRoutines::verify_oop_count_addr()));


3857         StubRoutines::_dcos = generate_libmCos();
3858       }
3859       if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtan)) {
3860         StubRoutines::_dlibm_tan_cot_huge = generate_libm_tan_cot_huge();
3861         StubRoutines::_dtan = generate_libmTan();
3862       }
3863     }
3864   }
3865 
3866   void generate_all() {
3867     // Generates all stubs and initializes the entry points
3868 
3869     // These entry points require SharedInfo::stack0 to be set up in non-core builds
3870     // and need to be relocatable, so they each fabricate a RuntimeStub internally.
3871     StubRoutines::_throw_AbstractMethodError_entry         = generate_throw_exception("AbstractMethodError throw_exception",          CAST_FROM_FN_PTR(address, SharedRuntime::throw_AbstractMethodError));
3872     StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError));
3873     StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call));
3874 
3875     //------------------------------------------------------------------------------------------------------------------------
3876     // entry points that are platform specific
3877 
3878     StubRoutines::x86::_vector_float_sign_mask = generate_vector_mask("vector_float_sign_mask", 0x7FFFFFFF);
3879     StubRoutines::x86::_vector_float_sign_flip = generate_vector_mask("vector_float_sign_flip", 0x80000000);
3880     StubRoutines::x86::_vector_double_sign_mask = generate_vector_mask_long_double("vector_double_sign_mask", 0x7FFFFFFF, 0xFFFFFFFF);
3881     StubRoutines::x86::_vector_double_sign_flip = generate_vector_mask_long_double("vector_double_sign_flip", 0x80000000, 0x00000000);
3882     StubRoutines::x86::_vector_short_to_byte_mask = generate_vector_mask("vector_short_to_byte_mask", 0x00ff00ff);
3883     StubRoutines::x86::_vector_byte_perm_mask = generate_vector_byte_perm_mask("vector_byte_perm_mask");
3884     StubRoutines::x86::_vector_long_sign_mask = generate_vector_mask_long_double("vector_long_sign_mask", 0x80000000, 0x00000000);
3885 
3886     // support for verify_oop (must happen after universe_init)
3887     StubRoutines::_verify_oop_subroutine_entry     = generate_verify_oop();
3888 
3889     // arraycopy stubs used by compilers
3890     generate_arraycopy_stubs();
3891 
3892     // don't bother generating these AES intrinsic stubs unless global flag is set
3893     if (UseAESIntrinsics) {
3894       StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask();  // might be needed by the others
3895 
3896       StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock();
3897       StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock();
3898       StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt();
3899       StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel();
3900     }
3901 
3902     if (UseAESCTRIntrinsics) {
3903       StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask();
3904       StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel();


< prev index next >