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().

*** 793,807 **** return make_arraycopy_Type(ac_generic); } const TypeFunc* OptoRuntime::array_fill_Type() { ! // create input type (domain): pointer, int, size_t ! const Type** fields = TypeTuple::fields(3 LP64_ONLY( + 1)); int argp = TypeFunc::Parms; fields[argp++] = TypePtr::NOTNULL; fields[argp++] = TypeInt::INT; fields[argp++] = TypeX_X; // size in whatevers (size_t) LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length const TypeTuple *domain = TypeTuple::make(argp, fields); // create result type --- 793,816 ---- return make_arraycopy_Type(ac_generic); } const TypeFunc* OptoRuntime::array_fill_Type() { ! const Type** fields; int argp = TypeFunc::Parms; + if (CCallingConventionRequiresIntsAsLongs) { + // create input type (domain): pointer, int, size_t + fields = TypeTuple::fields(3 LP64_ONLY( + 2)); + fields[argp++] = TypePtr::NOTNULL; + fields[argp++] = TypeLong::LONG; + fields[argp++] = Type::HALF; + } else { + // create input type (domain): pointer, int, size_t + fields = TypeTuple::fields(3 LP64_ONLY( + 1)); fields[argp++] = TypePtr::NOTNULL; fields[argp++] = TypeInt::INT; + } fields[argp++] = TypeX_X; // size in whatevers (size_t) LP64_ONLY(fields[argp++] = Type::HALF); // other half of long length const TypeTuple *domain = TypeTuple::make(argp, fields); // create result type