comparison src/cpu/ppc/vm/sharedRuntime_ppc.cpp @ 14418:cfd05ec74089

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(). Reviewed-by: kvn
author goetz
date Wed, 18 Sep 2013 14:34:56 -0700
parents ec28f9c041ff
children b0133e4187d3
comparison
equal deleted inserted replaced
14417:f3806614494a 14418:cfd05ec74089
732 case T_SHORT: 732 case T_SHORT:
733 case T_INT: 733 case T_INT:
734 // We must cast ints to longs and use full 64 bit stack slots 734 // We must cast ints to longs and use full 64 bit stack slots
735 // here. We do the cast in GraphKit::gen_stub() and just guard 735 // here. We do the cast in GraphKit::gen_stub() and just guard
736 // here against loosing that change. 736 // here against loosing that change.
737 Unimplemented(); // TODO: PPC port 737 assert(CCallingConventionRequiresIntsAsLongs,
738 /*
739 assert(SharedRuntime::c_calling_convention_requires_ints_as_longs(),
740 "argument of type int should be promoted to type long"); 738 "argument of type int should be promoted to type long");
741 */
742 guarantee(i > 0 && sig_bt[i-1] == T_LONG, 739 guarantee(i > 0 && sig_bt[i-1] == T_LONG,
743 "argument of type (bt) should have been promoted to type (T_LONG,bt) for bt in " 740 "argument of type (bt) should have been promoted to type (T_LONG,bt) for bt in "
744 "{T_BOOLEAN, T_CHAR, T_BYTE, T_SHORT, T_INT}"); 741 "{T_BOOLEAN, T_CHAR, T_BYTE, T_SHORT, T_INT}");
745 // Do not count halves. 742 // Do not count halves.
746 regs[i].set_bad(); 743 regs[i].set_bad();
853 assert_different_registers(sender_SP, code, ientry, return_pc, tmp); 850 assert_different_registers(sender_SP, code, ientry, return_pc, tmp);
854 851
855 // Adapter needs TOP_IJAVA_FRAME_ABI. 852 // Adapter needs TOP_IJAVA_FRAME_ABI.
856 const int adapter_size = frame::top_ijava_frame_abi_size + 853 const int adapter_size = frame::top_ijava_frame_abi_size +
857 round_to(total_args_passed * wordSize, frame::alignment_in_bytes); 854 round_to(total_args_passed * wordSize, frame::alignment_in_bytes);
858
859 855
860 // regular (verified) c2i entry point 856 // regular (verified) c2i entry point
861 c2i_entrypoint = __ pc(); 857 c2i_entrypoint = __ pc();
862 858
863 // Does compiled code exists? If yes, patch the caller's callsite. 859 // Does compiled code exists? If yes, patch the caller's callsite.