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

@@ -732,15 +732,12 @@
     case T_SHORT:
     case T_INT:
       // We must cast ints to longs and use full 64 bit stack slots
       // here. We do the cast in GraphKit::gen_stub() and just guard
       // here against loosing that change.
-      Unimplemented(); // TODO: PPC port
-      /*
-      assert(SharedRuntime::c_calling_convention_requires_ints_as_longs(),
+      assert(CCallingConventionRequiresIntsAsLongs,
              "argument of type int should be promoted to type long");
-      */
       guarantee(i > 0 && sig_bt[i-1] == T_LONG,
                 "argument of type (bt) should have been promoted to type (T_LONG,bt) for bt in "
                 "{T_BOOLEAN, T_CHAR, T_BYTE, T_SHORT, T_INT}");
       // Do not count halves.

@@ -854,11 +851,10 @@
   // Adapter needs TOP_IJAVA_FRAME_ABI.
   const int adapter_size = frame::top_ijava_frame_abi_size +
                            round_to(total_args_passed * wordSize, frame::alignment_in_bytes);
   // regular (verified) c2i entry point
   c2i_entrypoint = __ pc();
   // Does compiled code exists? If yes, patch the caller's callsite.
   __ ld(code, method_(code));