src/share/vm/runtime/sharedRuntime.hpp

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

*** 364,373 **** --- 364,383 ---- // NULL is being passed as the second VMRegPair array, so arguments are either // passed in a register OR in a stack slot. static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, VMRegPair *regs2, int total_args_passed); + // Compute the new number of arguments in the signature if 32 bit ints + // must be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs + // is true. + static int convert_ints_to_longints_argcnt(int in_args_count, BasicType* in_sig_bt); + // Adapt a method's signature if it contains 32 bit integers that must + // be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs + // is true. + static void convert_ints_to_longints(int i2l_argcnt, int& in_args_count, + BasicType*& in_sig_bt, VMRegPair*& in_regs); + // Generate I2C and C2I adapters. These adapters are simple argument marshalling // blobs. Unlike adapters in the tiger and earlier releases the code in these // blobs does not create a new frame and are therefore virtually invisible // to the stack walking code. In general these blobs extend the callers stack // as needed for the conversion of argument locations.
*** 376,386 **** // by the time we reach the blob there is compiled code available. This allows // the blob to pass the incoming stack pointer (the sender sp) in a known // location for the interpreter to record. This is used by the frame code // to correct the sender code to match up with the stack pointer when the // thread left the compiled code. In addition it allows the interpreter ! // to remove the space the c2i adapter allocated to do it argument conversion. // Although a c2i blob will always run interpreted even if compiled code is // present if we see that compiled code is present the compiled call site // will be patched/re-resolved so that later calls will run compiled. --- 386,396 ---- // by the time we reach the blob there is compiled code available. This allows // the blob to pass the incoming stack pointer (the sender sp) in a known // location for the interpreter to record. This is used by the frame code // to correct the sender code to match up with the stack pointer when the // thread left the compiled code. In addition it allows the interpreter ! // to remove the space the c2i adapter allocated to do its argument conversion. // Although a c2i blob will always run interpreted even if compiled code is // present if we see that compiled code is present the compiled call site // will be patched/re-resolved so that later calls will run compiled.