comparison src/share/vm/opto/runtime.cpp @ 14518:d8041d695d19

Merged with jdk9/dev/hotspot changeset 3812c088b945
author twisti
date Tue, 11 Mar 2014 18:45:59 -0700
parents 6b2d8d20ecbd 8a9bb7821e28
children 311bf6c7488b
comparison
equal deleted inserted replaced
14141:f97c5ec83832 14518:d8041d695d19
82 # include "adfiles/ad_zero.hpp" 82 # include "adfiles/ad_zero.hpp"
83 #endif 83 #endif
84 #ifdef TARGET_ARCH_MODEL_arm 84 #ifdef TARGET_ARCH_MODEL_arm
85 # include "adfiles/ad_arm.hpp" 85 # include "adfiles/ad_arm.hpp"
86 #endif 86 #endif
87 #ifdef TARGET_ARCH_MODEL_ppc 87 #ifdef TARGET_ARCH_MODEL_ppc_32
88 # include "adfiles/ad_ppc.hpp" 88 # include "adfiles/ad_ppc_32.hpp"
89 #endif
90 #ifdef TARGET_ARCH_MODEL_ppc_64
91 # include "adfiles/ad_ppc_64.hpp"
89 #endif 92 #endif
90 93
91 94
92 // For debugging purposes: 95 // For debugging purposes:
93 // To force FullGCALot inside a runtime function, add the following two lines 96 // To force FullGCALot inside a runtime function, add the following two lines
567 } 570 }
568 571
569 const TypeFunc *OptoRuntime::uncommon_trap_Type() { 572 const TypeFunc *OptoRuntime::uncommon_trap_Type() {
570 // create input type (domain) 573 // create input type (domain)
571 const Type **fields = TypeTuple::fields(1); 574 const Type **fields = TypeTuple::fields(1);
572 // Symbol* name of class to be loaded 575 fields[TypeFunc::Parms+0] = TypeInt::INT; // trap_reason (deopt reason and action)
573 fields[TypeFunc::Parms+0] = TypeInt::INT;
574 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields); 576 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
575 577
576 // create result type (range) 578 // create result type (range)
577 fields = TypeTuple::fields(0); 579 fields = TypeTuple::fields(0);
578 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields); 580 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
792 return make_arraycopy_Type(ac_generic); 794 return make_arraycopy_Type(ac_generic);
793 } 795 }
794 796
795 797
796 const TypeFunc* OptoRuntime::array_fill_Type() { 798 const TypeFunc* OptoRuntime::array_fill_Type() {
799 const Type** fields;
800 int argp = TypeFunc::Parms;
801 if (CCallingConventionRequiresIntsAsLongs) {
797 // create input type (domain): pointer, int, size_t 802 // create input type (domain): pointer, int, size_t
798 const Type** fields = TypeTuple::fields(3 LP64_ONLY( + 1)); 803 fields = TypeTuple::fields(3 LP64_ONLY( + 2));
799 int argp = TypeFunc::Parms; 804 fields[argp++] = TypePtr::NOTNULL;
800 fields[argp++] = TypePtr::NOTNULL; 805 fields[argp++] = TypeLong::LONG;
801 fields[argp++] = TypeInt::INT; 806 fields[argp++] = Type::HALF;
807 } else {
808 // create input type (domain): pointer, int, size_t
809 fields = TypeTuple::fields(3 LP64_ONLY( + 1));
810 fields[argp++] = TypePtr::NOTNULL;
811 fields[argp++] = TypeInt::INT;
812 }
802 fields[argp++] = TypeX_X; // size in whatevers (size_t) 813 fields[argp++] = TypeX_X; // size in whatevers (size_t)
803 LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length 814 LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length
804 const TypeTuple *domain = TypeTuple::make(argp, fields); 815 const TypeTuple *domain = TypeTuple::make(argp, fields);
805 816
806 // create result type 817 // create result type
813 824
814 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant) 825 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant)
815 const TypeFunc* OptoRuntime::aescrypt_block_Type() { 826 const TypeFunc* OptoRuntime::aescrypt_block_Type() {
816 // create input type (domain) 827 // create input type (domain)
817 int num_args = 3; 828 int num_args = 3;
829 if (Matcher::pass_original_key_for_aes()) {
830 num_args = 4;
831 }
818 int argcnt = num_args; 832 int argcnt = num_args;
819 const Type** fields = TypeTuple::fields(argcnt); 833 const Type** fields = TypeTuple::fields(argcnt);
820 int argp = TypeFunc::Parms; 834 int argp = TypeFunc::Parms;
821 fields[argp++] = TypePtr::NOTNULL; // src 835 fields[argp++] = TypePtr::NOTNULL; // src
822 fields[argp++] = TypePtr::NOTNULL; // dest 836 fields[argp++] = TypePtr::NOTNULL; // dest
823 fields[argp++] = TypePtr::NOTNULL; // k array 837 fields[argp++] = TypePtr::NOTNULL; // k array
838 if (Matcher::pass_original_key_for_aes()) {
839 fields[argp++] = TypePtr::NOTNULL; // original k array
840 }
824 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 841 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
825 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 842 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
826 843
827 // no result type needed 844 // no result type needed
828 fields = TypeTuple::fields(1); 845 fields = TypeTuple::fields(1);
855 872
856 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void 873 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void
857 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { 874 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
858 // create input type (domain) 875 // create input type (domain)
859 int num_args = 5; 876 int num_args = 5;
877 if (Matcher::pass_original_key_for_aes()) {
878 num_args = 6;
879 }
860 int argcnt = num_args; 880 int argcnt = num_args;
861 const Type** fields = TypeTuple::fields(argcnt); 881 const Type** fields = TypeTuple::fields(argcnt);
862 int argp = TypeFunc::Parms; 882 int argp = TypeFunc::Parms;
863 fields[argp++] = TypePtr::NOTNULL; // src 883 fields[argp++] = TypePtr::NOTNULL; // src
864 fields[argp++] = TypePtr::NOTNULL; // dest 884 fields[argp++] = TypePtr::NOTNULL; // dest
865 fields[argp++] = TypePtr::NOTNULL; // k array 885 fields[argp++] = TypePtr::NOTNULL; // k array
866 fields[argp++] = TypePtr::NOTNULL; // r array 886 fields[argp++] = TypePtr::NOTNULL; // r array
867 fields[argp++] = TypeInt::INT; // src len 887 fields[argp++] = TypeInt::INT; // src len
888 if (Matcher::pass_original_key_for_aes()) {
889 fields[argp++] = TypePtr::NOTNULL; // original k array
890 }
868 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 891 assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
869 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 892 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
870 893
871 // no result type needed 894 // returning cipher len (int)
872 fields = TypeTuple::fields(1); 895 fields = TypeTuple::fields(1);
873 fields[TypeFunc::Parms+0] = NULL; // void 896 fields[TypeFunc::Parms+0] = TypeInt::INT;
874 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); 897 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
875 return TypeFunc::make(domain, range); 898 return TypeFunc::make(domain, range);
876 } 899 }
877 900
878 //------------- Interpreter state access for on stack replacement 901 //------------- Interpreter state access for on stack replacement
879 const TypeFunc* OptoRuntime::osr_end_Type() { 902 const TypeFunc* OptoRuntime::osr_end_Type() {
1034 // Adjust the pc back to the original throwing pc 1057 // Adjust the pc back to the original throwing pc
1035 pc = deoptee.pc(); 1058 pc = deoptee.pc();
1036 } 1059 }
1037 1060
1038 // If we are forcing an unwind because of stack overflow then deopt is 1061 // If we are forcing an unwind because of stack overflow then deopt is
1039 // irrelevant sice we are throwing the frame away anyway. 1062 // irrelevant since we are throwing the frame away anyway.
1040 1063
1041 if (deopting && !force_unwind) { 1064 if (deopting && !force_unwind) {
1042 handler_address = SharedRuntime::deopt_blob()->unpack_with_exception(); 1065 handler_address = SharedRuntime::deopt_blob()->unpack_with_exception();
1043 } else { 1066 } else {
1044 1067
1077 // If there is a compiled exception handler in this method, we will continue there; 1100 // If there is a compiled exception handler in this method, we will continue there;
1078 // otherwise we will unwind the stack and continue at the caller of top frame method 1101 // otherwise we will unwind the stack and continue at the caller of top frame method
1079 // Note we enter without the usual JRT wrapper. We will call a helper routine that 1102 // Note we enter without the usual JRT wrapper. We will call a helper routine that
1080 // will do the normal VM entry. We do it this way so that we can see if the nmethod 1103 // will do the normal VM entry. We do it this way so that we can see if the nmethod
1081 // we looked up the handler for has been deoptimized in the meantime. If it has been 1104 // we looked up the handler for has been deoptimized in the meantime. If it has been
1082 // we must not use the handler and instread return the deopt blob. 1105 // we must not use the handler and instead return the deopt blob.
1083 address OptoRuntime::handle_exception_C(JavaThread* thread) { 1106 address OptoRuntime::handle_exception_C(JavaThread* thread) {
1084 // 1107 //
1085 // We are in Java not VM and in debug mode we have a NoHandleMark 1108 // We are in Java not VM and in debug mode we have a NoHandleMark
1086 // 1109 //
1087 #ifndef PRODUCT 1110 #ifndef PRODUCT