src/share/vm/opto/runtime.cpp

Print this page
rev 5190 : 8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
Summary: Some platforms, as ppc and s390x/zArch require that 32-bit ints are passed as 64-bit values to C functions. This change adds support to adapt the signature and to issue proper casts to c2-compiled stubs. The functions are used in generate_native_wrapper(). Adapt signature used by the compiler as in PhaseIdealLoop::intrinsify_fill().


 778 }
 779 
 780 const TypeFunc* OptoRuntime::checkcast_arraycopy_Type() {
 781   // An extension of fast_arraycopy_Type which adds type checking.
 782   return make_arraycopy_Type(ac_checkcast);
 783 }
 784 
 785 const TypeFunc* OptoRuntime::slow_arraycopy_Type() {
 786   // This signature is exactly the same as System.arraycopy.
 787   // There are no intptr_t (int/long) arguments.
 788   return make_arraycopy_Type(ac_slow);
 789 }
 790 
 791 const TypeFunc* OptoRuntime::generic_arraycopy_Type() {
 792   // This signature is like System.arraycopy, except that it returns status.
 793   return make_arraycopy_Type(ac_generic);
 794 }
 795 
 796 
 797 const TypeFunc* OptoRuntime::array_fill_Type() {
 798   // create input type (domain): pointer, int, size_t
 799   const Type** fields = TypeTuple::fields(3 LP64_ONLY( + 1));
 800   int argp = TypeFunc::Parms;









 801   fields[argp++] = TypePtr::NOTNULL;
 802   fields[argp++] = TypeInt::INT;

 803   fields[argp++] = TypeX_X;               // size in whatevers (size_t)
 804   LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length
 805   const TypeTuple *domain = TypeTuple::make(argp, fields);
 806 
 807   // create result type
 808   fields = TypeTuple::fields(1);
 809   fields[TypeFunc::Parms+0] = NULL; // void
 810   const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields);
 811 
 812   return TypeFunc::make(domain, range);
 813 }
 814 
 815 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant)
 816 const TypeFunc* OptoRuntime::aescrypt_block_Type() {
 817   // create input type (domain)
 818   int num_args      = 3;
 819   int argcnt = num_args;
 820   const Type** fields = TypeTuple::fields(argcnt);
 821   int argp = TypeFunc::Parms;
 822   fields[argp++] = TypePtr::NOTNULL;    // src




 778 }
 779 
 780 const TypeFunc* OptoRuntime::checkcast_arraycopy_Type() {
 781   // An extension of fast_arraycopy_Type which adds type checking.
 782   return make_arraycopy_Type(ac_checkcast);
 783 }
 784 
 785 const TypeFunc* OptoRuntime::slow_arraycopy_Type() {
 786   // This signature is exactly the same as System.arraycopy.
 787   // There are no intptr_t (int/long) arguments.
 788   return make_arraycopy_Type(ac_slow);
 789 }
 790 
 791 const TypeFunc* OptoRuntime::generic_arraycopy_Type() {
 792   // This signature is like System.arraycopy, except that it returns status.
 793   return make_arraycopy_Type(ac_generic);
 794 }
 795 
 796 
 797 const TypeFunc* OptoRuntime::array_fill_Type() {
 798   const Type** fields;

 799   int argp = TypeFunc::Parms;
 800   if (CCallingConventionRequiresIntsAsLongs) {
 801   // create input type (domain): pointer, int, size_t
 802     fields = TypeTuple::fields(3 LP64_ONLY( + 2));
 803     fields[argp++] = TypePtr::NOTNULL;
 804     fields[argp++] = TypeLong::LONG;
 805     fields[argp++] = Type::HALF;
 806   } else {
 807     // create input type (domain): pointer, int, size_t
 808     fields = TypeTuple::fields(3 LP64_ONLY( + 1));
 809     fields[argp++] = TypePtr::NOTNULL;
 810     fields[argp++] = TypeInt::INT;
 811   }
 812   fields[argp++] = TypeX_X;               // size in whatevers (size_t)
 813   LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length
 814   const TypeTuple *domain = TypeTuple::make(argp, fields);
 815 
 816   // create result type
 817   fields = TypeTuple::fields(1);
 818   fields[TypeFunc::Parms+0] = NULL; // void
 819   const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields);
 820 
 821   return TypeFunc::make(domain, range);
 822 }
 823 
 824 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant)
 825 const TypeFunc* OptoRuntime::aescrypt_block_Type() {
 826   // create input type (domain)
 827   int num_args      = 3;
 828   int argcnt = num_args;
 829   const Type** fields = TypeTuple::fields(argcnt);
 830   int argp = TypeFunc::Parms;
 831   fields[argp++] = TypePtr::NOTNULL;    // src