hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp
changeset 46620 750c6edff33b
parent 44406 a46a6c4d1dd9
child 46625 edefffab74e2
equal deleted inserted replaced
46619:a3919f5e8d2b 46620:750c6edff33b
   742         break;
   742         break;
   743       default:
   743       default:
   744         ShouldNotReachHere();
   744         ShouldNotReachHere();
   745     }
   745     }
   746   }
   746   }
   747   return round_to(stk, 2);
   747   return align_up(stk, 2);
   748 }
   748 }
   749 
   749 
   750 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
   750 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
   751                                         VMRegPair *regs,
   751                                         VMRegPair *regs,
   752                                         VMRegPair *regs2,
   752                                         VMRegPair *regs2,
   838         break;
   838         break;
   839       default:
   839       default:
   840         ShouldNotReachHere();
   840         ShouldNotReachHere();
   841     }
   841     }
   842   }
   842   }
   843   return round_to(stk, 2);
   843   return align_up(stk, 2);
   844 }
   844 }
   845 
   845 
   846 ////////////////////////////////////////////////////////////////////////
   846 ////////////////////////////////////////////////////////////////////////
   847 //
   847 //
   848 //  Argument shufflers
   848 //  Argument shufflers
  1732             default:  ShouldNotReachHere();
  1732             default:  ShouldNotReachHere();
  1733           }
  1733           }
  1734         }
  1734         }
  1735       }
  1735       }
  1736     }  // for
  1736     }  // for
  1737     total_save_slots = double_slots * 2 + round_to(single_slots, 2); // Round to even.
  1737     total_save_slots = double_slots * 2 + align_up(single_slots, 2); // Round to even.
  1738   }
  1738   }
  1739 
  1739 
  1740   int oop_handle_slot_offset = stack_slots;
  1740   int oop_handle_slot_offset = stack_slots;
  1741   stack_slots += total_save_slots;                                        // 3)
  1741   stack_slots += total_save_slots;                                        // 3)
  1742 
  1742 
  1759   int workspace_slot_offset= stack_slots;                                 // 6)
  1759   int workspace_slot_offset= stack_slots;                                 // 6)
  1760   stack_slots         += 2;
  1760   stack_slots         += 2;
  1761 
  1761 
  1762   // Now compute actual number of stack words we need.
  1762   // Now compute actual number of stack words we need.
  1763   // Round to align stack properly.
  1763   // Round to align stack properly.
  1764   stack_slots = round_to(stack_slots,                                     // 7)
  1764   stack_slots = align_up(stack_slots,                                     // 7)
  1765                          frame::alignment_in_bytes / VMRegImpl::stack_slot_size);
  1765                          frame::alignment_in_bytes / VMRegImpl::stack_slot_size);
  1766   int frame_size_in_bytes = stack_slots * VMRegImpl::stack_slot_size;
  1766   int frame_size_in_bytes = stack_slots * VMRegImpl::stack_slot_size;
  1767 
  1767 
  1768 
  1768 
  1769   ///////////////////////////////////////////////////////////////////////
  1769   ///////////////////////////////////////////////////////////////////////
  2393   // Since all args are passed on the stack, total_args_passed*wordSize is the
  2393   // Since all args are passed on the stack, total_args_passed*wordSize is the
  2394   // space we need. We need ABI scratch area but we use the caller's since
  2394   // space we need. We need ABI scratch area but we use the caller's since
  2395   // it has already been allocated.
  2395   // it has already been allocated.
  2396 
  2396 
  2397   const int abi_scratch = frame::z_top_ijava_frame_abi_size;
  2397   const int abi_scratch = frame::z_top_ijava_frame_abi_size;
  2398   int       extraspace  = round_to(total_args_passed, 2)*wordSize + abi_scratch;
  2398   int       extraspace  = align_up(total_args_passed, 2)*wordSize + abi_scratch;
  2399   Register  sender_SP   = Z_R10;
  2399   Register  sender_SP   = Z_R10;
  2400   Register  value       = Z_R12;
  2400   Register  value       = Z_R12;
  2401 
  2401 
  2402   // Remember the senderSP so we can pop the interpreter arguments off of the stack.
  2402   // Remember the senderSP so we can pop the interpreter arguments off of the stack.
  2403   // In addition, frame manager expects initial_caller_sp in Z_R10.
  2403   // In addition, frame manager expects initial_caller_sp in Z_R10.
  2523   if (comp_args_on_stack) {
  2523   if (comp_args_on_stack) {
  2524     // Sig words on the stack are greater than VMRegImpl::stack0. Those in
  2524     // Sig words on the stack are greater than VMRegImpl::stack0. Those in
  2525     // registers are below. By subtracting stack0, we either get a negative
  2525     // registers are below. By subtracting stack0, we either get a negative
  2526     // number (all values in registers) or the maximum stack slot accessed.
  2526     // number (all values in registers) or the maximum stack slot accessed.
  2527     // Convert VMRegImpl (4 byte) stack slots to words.
  2527     // Convert VMRegImpl (4 byte) stack slots to words.
  2528     int comp_words_on_stack = round_to(comp_args_on_stack*VMRegImpl::stack_slot_size, wordSize)>>LogBytesPerWord;
  2528     int comp_words_on_stack = align_up(comp_args_on_stack*VMRegImpl::stack_slot_size, wordSize)>>LogBytesPerWord;
  2529     // Round up to miminum stack alignment, in wordSize
  2529     // Round up to miminum stack alignment, in wordSize
  2530     comp_words_on_stack = round_to(comp_words_on_stack, 2);
  2530     comp_words_on_stack = align_up(comp_words_on_stack, 2);
  2531 
  2531 
  2532     __ resize_frame(-comp_words_on_stack*wordSize, Z_R0_scratch);
  2532     __ resize_frame(-comp_words_on_stack*wordSize, Z_R0_scratch);
  2533   }
  2533   }
  2534 
  2534 
  2535   // Now generate the shuffle code. Pick up all register args and move the
  2535   // Now generate the shuffle code. Pick up all register args and move the