src/share/vm/runtime/sharedRuntime.hpp

Print this page
rev 5186 : 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 in PhaseIdealLoop::intrinsify_fill().

*** 356,365 **** --- 356,377 ---- const VMRegPair* regs) NOT_DEBUG_RETURN; // Ditto except for calling C static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed); + // Querry whether this platforms requires that 32 bit integers are + // passed as 64 bit wide entities in C calls. (This is the case on PPC + // and z/Arch.) + static bool c_calling_convention_requires_ints_as_longs(); + // Compute the new number of arguments in the signature if 32 bit ints + // must be converted to longs. + 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. + 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.
*** 368,378 **** // 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. --- 380,390 ---- // 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.