comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 14416:6a936747b569

8024344: PPC64 (part 112): C argument in register AND stack slot. Summary: On PPC, the first 13 floating point arguments to C calls are passed in floating point registers. Also, all but the first 8 arguments are passed on the stack. So there can be floating point arguments that are passed on the stack and in a register. We duplicate the regs datastructure in c_calling_convention() to represent this. Reviewed-by: kvn, cjplummer
author goetz
date Thu, 12 Sep 2013 13:51:13 -0700
parents 46c544b8fbfc
children 2b8e28fdf503
comparison
equal deleted inserted replaced
14415:666e6ce3976c 14416:6a936747b569
1116 } 1116 }
1117 1117
1118 1118
1119 int SharedRuntime::c_calling_convention(const BasicType *sig_bt, 1119 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
1120 VMRegPair *regs, 1120 VMRegPair *regs,
1121 VMRegPair *regs2,
1121 int total_args_passed) { 1122 int total_args_passed) {
1123 assert(regs2 == NULL, "not needed on sparc");
1122 1124
1123 // Return the number of VMReg stack_slots needed for the args. 1125 // Return the number of VMReg stack_slots needed for the args.
1124 // This value does not include an abi space (like register window 1126 // This value does not include an abi space (like register window
1125 // save area). 1127 // save area).
1126 1128
2094 // Now figure out where the args must be stored and how much stack space 2096 // Now figure out where the args must be stored and how much stack space
2095 // they require (neglecting out_preserve_stack_slots but space for storing 2097 // they require (neglecting out_preserve_stack_slots but space for storing
2096 // the 1st six register arguments). It's weird see int_stk_helper. 2098 // the 1st six register arguments). It's weird see int_stk_helper.
2097 // 2099 //
2098 int out_arg_slots; 2100 int out_arg_slots;
2099 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, total_c_args); 2101 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
2100 2102
2101 if (is_critical_native) { 2103 if (is_critical_native) {
2102 // Critical natives may have to call out so they need a save area 2104 // Critical natives may have to call out so they need a save area
2103 // for register arguments. 2105 // for register arguments.
2104 int double_slots = 0; 2106 int double_slots = 0;
2841 // Now figure out where the args must be stored and how much stack space 2843 // Now figure out where the args must be stored and how much stack space
2842 // they require (neglecting out_preserve_stack_slots but space for storing 2844 // they require (neglecting out_preserve_stack_slots but space for storing
2843 // the 1st six register arguments). It's weird see int_stk_helper. 2845 // the 1st six register arguments). It's weird see int_stk_helper.
2844 // 2846 //
2845 int out_arg_slots; 2847 int out_arg_slots;
2846 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, total_c_args); 2848 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args);
2847 2849
2848 // Calculate the total number of stack slots we will need. 2850 // Calculate the total number of stack slots we will need.
2849 2851
2850 // First count the abi requirement plus all of the outgoing args 2852 // First count the abi requirement plus all of the outgoing args
2851 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 2853 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots;