137 |
137 |
138 //---------------------------compute_old_SP------------------------------------ |
138 //---------------------------compute_old_SP------------------------------------ |
139 OptoReg::Name Compile::compute_old_SP() { |
139 OptoReg::Name Compile::compute_old_SP() { |
140 int fixed = fixed_slots(); |
140 int fixed = fixed_slots(); |
141 int preserve = in_preserve_stack_slots(); |
141 int preserve = in_preserve_stack_slots(); |
142 return OptoReg::stack2reg(round_to(fixed + preserve, Matcher::stack_alignment_in_slots())); |
142 return OptoReg::stack2reg(align_up(fixed + preserve, (int)Matcher::stack_alignment_in_slots())); |
143 } |
143 } |
144 |
144 |
145 |
145 |
146 |
146 |
147 #ifdef ASSERT |
147 #ifdef ASSERT |
284 // words, in case the arguments or locals need to contain doubleword stack |
284 // words, in case the arguments or locals need to contain doubleword stack |
285 // slots. The rest of the system assumes that stack slot pairs (in |
285 // slots. The rest of the system assumes that stack slot pairs (in |
286 // particular, in the spill area) which look aligned will in fact be |
286 // particular, in the spill area) which look aligned will in fact be |
287 // aligned relative to the stack pointer in the target machine. Double |
287 // aligned relative to the stack pointer in the target machine. Double |
288 // stack slots will always be allocated aligned. |
288 // stack slots will always be allocated aligned. |
289 _new_SP = OptoReg::Name(round_to(_in_arg_limit, RegMask::SlotsPerLong)); |
289 _new_SP = OptoReg::Name(align_up(_in_arg_limit, (int)RegMask::SlotsPerLong)); |
290 |
290 |
291 // Compute highest outgoing stack argument as |
291 // Compute highest outgoing stack argument as |
292 // _new_SP + out_preserve_stack_slots + max(outgoing argument size). |
292 // _new_SP + out_preserve_stack_slots + max(outgoing argument size). |
293 _out_arg_limit = OptoReg::add(_new_SP, C->out_preserve_stack_slots()); |
293 _out_arg_limit = OptoReg::add(_new_SP, C->out_preserve_stack_slots()); |
294 assert( is_even(_out_arg_limit), "out_preserve must be even" ); |
294 assert( is_even(_out_arg_limit), "out_preserve must be even" ); |