src/cpu/ppc/vm/sharedRuntime_ppc.cpp

Print this page




 736     case T_ARRAY:
 737     case T_ADDRESS:
 738     case T_METADATA:
 739       // Oops are already boxed if required (JNI).
 740       if (arg < Argument::n_int_register_parameters_c) {
 741         reg = iarg_reg[arg];
 742       } else {
 743         reg = VMRegImpl::stack2reg(stk);
 744         stk += inc_stk_for_longdouble;
 745       }
 746       regs[i].set2(reg);
 747       break;
 748 
 749     //
 750     // Floats are treated differently from int regs:  The first 13 float arguments
 751     // are passed in registers (not the float args among the first 13 args).
 752     // Thus argument i is NOT passed in farg_reg[i] if it is float.  It is passed
 753     // in farg_reg[j] if argument i is the j-th float argument of this call.
 754     //
 755     case T_FLOAT:















 756       if (freg < Argument::n_float_register_parameters_c) {
 757         // Put float in register ...
 758         reg = farg_reg[freg];
 759         ++freg;
 760 
 761         // Argument i for i > 8 is placed on the stack even if it's
 762         // placed in a register (if it's a float arg). Aix disassembly
 763         // shows that xlC places these float args on the stack AND in
 764         // a register. This is not documented, but we follow this
 765         // convention, too.
 766         if (arg >= Argument::n_regs_not_on_stack_c) {
 767           // ... and on the stack.
 768           guarantee(regs2 != NULL, "must pass float in register and stack slot");
 769           VMReg reg2 = VMRegImpl::stack2reg(stk LINUX_ONLY(+1));
 770           regs2[i].set1(reg2);
 771           stk += inc_stk_for_intfloat;
 772         }
 773 
 774       } else {
 775         // Put float on stack.
 776         reg = VMRegImpl::stack2reg(stk LINUX_ONLY(+1));
 777         stk += inc_stk_for_intfloat;
 778       }
 779       regs[i].set1(reg);
 780       break;
 781     case T_DOUBLE:
 782       assert(sig_bt[i+1] == T_VOID, "expecting half");
 783       if (freg < Argument::n_float_register_parameters_c) {
 784         // Put double in register ...
 785         reg = farg_reg[freg];
 786         ++freg;
 787 
 788         // Argument i for i > 8 is placed on the stack even if it's
 789         // placed in a register (if it's a double arg). Aix disassembly
 790         // shows that xlC places these float args on the stack AND in
 791         // a register. This is not documented, but we follow this
 792         // convention, too.
 793         if (arg >= Argument::n_regs_not_on_stack_c) {
 794           // ... and on the stack.
 795           guarantee(regs2 != NULL, "must pass float in register and stack slot");
 796           VMReg reg2 = VMRegImpl::stack2reg(stk);




 736     case T_ARRAY:
 737     case T_ADDRESS:
 738     case T_METADATA:
 739       // Oops are already boxed if required (JNI).
 740       if (arg < Argument::n_int_register_parameters_c) {
 741         reg = iarg_reg[arg];
 742       } else {
 743         reg = VMRegImpl::stack2reg(stk);
 744         stk += inc_stk_for_longdouble;
 745       }
 746       regs[i].set2(reg);
 747       break;
 748 
 749     //
 750     // Floats are treated differently from int regs:  The first 13 float arguments
 751     // are passed in registers (not the float args among the first 13 args).
 752     // Thus argument i is NOT passed in farg_reg[i] if it is float.  It is passed
 753     // in farg_reg[j] if argument i is the j-th float argument of this call.
 754     //
 755     case T_FLOAT:
 756 #if defined(LINUX)
 757       // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float
 758       // in the least significant word of an argument slot.
 759 #if defined(VM_LITTLE_ENDIAN)
 760 #define FLOAT_WORD_OFFSET_IN_SLOT 0
 761 #else
 762 #define FLOAT_WORD_OFFSET_IN_SLOT 1
 763 #endif
 764 #elif defined(AIX)
 765       // Although AIX runs on big endian CPU, float is in the most
 766       // significant word of an argument slot.
 767 #define FLOAT_WORD_OFFSET_IN_SLOT 0
 768 #else
 769 #error "unknown OS"
 770 #endif
 771       if (freg < Argument::n_float_register_parameters_c) {
 772         // Put float in register ...
 773         reg = farg_reg[freg];
 774         ++freg;
 775 
 776         // Argument i for i > 8 is placed on the stack even if it's
 777         // placed in a register (if it's a float arg). Aix disassembly
 778         // shows that xlC places these float args on the stack AND in
 779         // a register. This is not documented, but we follow this
 780         // convention, too.
 781         if (arg >= Argument::n_regs_not_on_stack_c) {
 782           // ... and on the stack.
 783           guarantee(regs2 != NULL, "must pass float in register and stack slot");
 784           VMReg reg2 = VMRegImpl::stack2reg(stk + FLOAT_WORD_OFFSET_IN_SLOT);
 785           regs2[i].set1(reg2);
 786           stk += inc_stk_for_intfloat;
 787         }
 788 
 789       } else {
 790         // Put float on stack.
 791         reg = VMRegImpl::stack2reg(stk + FLOAT_WORD_OFFSET_IN_SLOT);
 792         stk += inc_stk_for_intfloat;
 793       }
 794       regs[i].set1(reg);
 795       break;
 796     case T_DOUBLE:
 797       assert(sig_bt[i+1] == T_VOID, "expecting half");
 798       if (freg < Argument::n_float_register_parameters_c) {
 799         // Put double in register ...
 800         reg = farg_reg[freg];
 801         ++freg;
 802 
 803         // Argument i for i > 8 is placed on the stack even if it's
 804         // placed in a register (if it's a double arg). Aix disassembly
 805         // shows that xlC places these float args on the stack AND in
 806         // a register. This is not documented, but we follow this
 807         // convention, too.
 808         if (arg >= Argument::n_regs_not_on_stack_c) {
 809           // ... and on the stack.
 810           guarantee(regs2 != NULL, "must pass float in register and stack slot");
 811           VMReg reg2 = VMRegImpl::stack2reg(stk);