962 __ pop(c_rarg2); 963 __ pop(c_rarg3); 964 __ pop(rax); 965 966 __ ret(0); 967 968 return start; 969 } 970 971 address generate_fp_mask(const char *stub_name, int64_t mask) { 972 __ align(CodeEntryAlignment); 973 StubCodeMark mark(this, "StubRoutines", stub_name); 974 address start = __ pc(); 975 976 __ emit_data64( mask, relocInfo::none ); 977 __ emit_data64( mask, relocInfo::none ); 978 979 return start; 980 } 981 982 // Non-destructive plausibility checks for oops 983 // 984 // Arguments: 985 // all args on stack! 986 // 987 // Stack after saving c_rarg3: 988 // [tos + 0]: saved c_rarg3 989 // [tos + 1]: saved c_rarg2 990 // [tos + 2]: saved r12 (several TemplateTable methods use it) 991 // [tos + 3]: saved flags 992 // [tos + 4]: return address 993 // * [tos + 5]: error message (char*) 994 // * [tos + 6]: object to verify (oop) 995 // * [tos + 7]: saved rax - saved by caller and bashed 996 // * [tos + 8]: saved r10 (rscratch1) - saved by caller 997 // * = popped on exit 998 address generate_verify_oop() { 999 StubCodeMark mark(this, "StubRoutines", "verify_oop"); 1000 address start = __ pc(); 1001 5854 CAST_FROM_FN_PTR(address, 5855 SharedRuntime:: 5856 throw_IncompatibleClassChangeError)); 5857 5858 StubRoutines::_throw_NullPointerException_at_call_entry = 5859 generate_throw_exception("NullPointerException at call throw_exception", 5860 CAST_FROM_FN_PTR(address, 5861 SharedRuntime:: 5862 throw_NullPointerException_at_call)); 5863 5864 // entry points that are platform specific 5865 StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); 5866 StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); 5867 StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); 5868 StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); 5869 5870 StubRoutines::x86::_float_sign_mask = generate_fp_mask("float_sign_mask", 0x7FFFFFFF7FFFFFFF); 5871 StubRoutines::x86::_float_sign_flip = generate_fp_mask("float_sign_flip", 0x8000000080000000); 5872 StubRoutines::x86::_double_sign_mask = generate_fp_mask("double_sign_mask", 0x7FFFFFFFFFFFFFFF); 5873 StubRoutines::x86::_double_sign_flip = generate_fp_mask("double_sign_flip", 0x8000000000000000); 5874 5875 // support for verify_oop (must happen after universe_init) 5876 StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop(); 5877 5878 // arraycopy stubs used by compilers 5879 generate_arraycopy_stubs(); 5880 5881 // don't bother generating these AES intrinsic stubs unless global flag is set 5882 if (UseAESIntrinsics) { 5883 StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask(); // needed by the others 5884 StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); 5885 StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); 5886 StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); 5887 if (VM_Version::supports_vaes() && VM_Version::supports_avx512vl() && VM_Version::supports_avx512dq() ) { 5888 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptVectorAESCrypt(); 5889 } else { 5890 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); 5891 } 5892 } 5893 if (UseAESCTRIntrinsics){ | 962 __ pop(c_rarg2); 963 __ pop(c_rarg3); 964 __ pop(rax); 965 966 __ ret(0); 967 968 return start; 969 } 970 971 address generate_fp_mask(const char *stub_name, int64_t mask) { 972 __ align(CodeEntryAlignment); 973 StubCodeMark mark(this, "StubRoutines", stub_name); 974 address start = __ pc(); 975 976 __ emit_data64( mask, relocInfo::none ); 977 __ emit_data64( mask, relocInfo::none ); 978 979 return start; 980 } 981 982 address generate_vector_mask(const char *stub_name, int64_t mask) { 983 __ align(CodeEntryAlignment); 984 StubCodeMark mark(this, "StubRoutines", stub_name); 985 address start = __ pc(); 986 987 __ emit_data64(mask, relocInfo::none); 988 __ emit_data64(mask, relocInfo::none); 989 __ emit_data64(mask, relocInfo::none); 990 __ emit_data64(mask, relocInfo::none); 991 __ emit_data64(mask, relocInfo::none); 992 __ emit_data64(mask, relocInfo::none); 993 __ emit_data64(mask, relocInfo::none); 994 __ emit_data64(mask, relocInfo::none); 995 996 return start; 997 } 998 999 address generate_vector_byte_perm_mask(const char *stub_name) { 1000 __ align(CodeEntryAlignment); 1001 StubCodeMark mark(this, "StubRoutines", stub_name); 1002 address start = __ pc(); 1003 1004 __ emit_data64(0x0000000000000001, relocInfo::none); 1005 __ emit_data64(0x0000000000000003, relocInfo::none); 1006 __ emit_data64(0x0000000000000005, relocInfo::none); 1007 __ emit_data64(0x0000000000000007, relocInfo::none); 1008 __ emit_data64(0x0000000000000000, relocInfo::none); 1009 __ emit_data64(0x0000000000000002, relocInfo::none); 1010 __ emit_data64(0x0000000000000004, relocInfo::none); 1011 __ emit_data64(0x0000000000000006, relocInfo::none); 1012 1013 return start; 1014 } 1015 1016 // Non-destructive plausibility checks for oops 1017 // 1018 // Arguments: 1019 // all args on stack! 1020 // 1021 // Stack after saving c_rarg3: 1022 // [tos + 0]: saved c_rarg3 1023 // [tos + 1]: saved c_rarg2 1024 // [tos + 2]: saved r12 (several TemplateTable methods use it) 1025 // [tos + 3]: saved flags 1026 // [tos + 4]: return address 1027 // * [tos + 5]: error message (char*) 1028 // * [tos + 6]: object to verify (oop) 1029 // * [tos + 7]: saved rax - saved by caller and bashed 1030 // * [tos + 8]: saved r10 (rscratch1) - saved by caller 1031 // * = popped on exit 1032 address generate_verify_oop() { 1033 StubCodeMark mark(this, "StubRoutines", "verify_oop"); 1034 address start = __ pc(); 1035 5888 CAST_FROM_FN_PTR(address, 5889 SharedRuntime:: 5890 throw_IncompatibleClassChangeError)); 5891 5892 StubRoutines::_throw_NullPointerException_at_call_entry = 5893 generate_throw_exception("NullPointerException at call throw_exception", 5894 CAST_FROM_FN_PTR(address, 5895 SharedRuntime:: 5896 throw_NullPointerException_at_call)); 5897 5898 // entry points that are platform specific 5899 StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); 5900 StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); 5901 StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); 5902 StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); 5903 5904 StubRoutines::x86::_float_sign_mask = generate_fp_mask("float_sign_mask", 0x7FFFFFFF7FFFFFFF); 5905 StubRoutines::x86::_float_sign_flip = generate_fp_mask("float_sign_flip", 0x8000000080000000); 5906 StubRoutines::x86::_double_sign_mask = generate_fp_mask("double_sign_mask", 0x7FFFFFFFFFFFFFFF); 5907 StubRoutines::x86::_double_sign_flip = generate_fp_mask("double_sign_flip", 0x8000000000000000); 5908 StubRoutines::x86::_vector_float_sign_mask = generate_vector_mask("vector_float_sign_mask", 0x7FFFFFFF7FFFFFFF); 5909 StubRoutines::x86::_vector_float_sign_flip = generate_vector_mask("vector_float_sign_flip", 0x8000000080000000); 5910 StubRoutines::x86::_vector_double_sign_mask = generate_vector_mask("vector_double_sign_mask", 0x7FFFFFFFFFFFFFFF); 5911 StubRoutines::x86::_vector_double_sign_flip = generate_vector_mask("vector_double_sign_flip", 0x8000000000000000); 5912 StubRoutines::x86::_vector_short_to_byte_mask = generate_vector_mask("vector_short_to_byte_mask", 0x00ff00ff00ff00ff); 5913 StubRoutines::x86::_vector_byte_perm_mask = generate_vector_byte_perm_mask("vector_byte_perm_mask"); 5914 StubRoutines::x86::_vector_long_sign_mask = generate_vector_mask("vector_long_sign_mask", 0x8000000000000000); 5915 5916 // support for verify_oop (must happen after universe_init) 5917 StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop(); 5918 5919 // arraycopy stubs used by compilers 5920 generate_arraycopy_stubs(); 5921 5922 // don't bother generating these AES intrinsic stubs unless global flag is set 5923 if (UseAESIntrinsics) { 5924 StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask(); // needed by the others 5925 StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); 5926 StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); 5927 StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); 5928 if (VM_Version::supports_vaes() && VM_Version::supports_avx512vl() && VM_Version::supports_avx512dq() ) { 5929 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptVectorAESCrypt(); 5930 } else { 5931 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); 5932 } 5933 } 5934 if (UseAESCTRIntrinsics){ |