327 // The address of the call instruction needs to be 4-byte aligned to |
327 // The address of the call instruction needs to be 4-byte aligned to |
328 // ensure that it does not span a cache line so that it can be patched. |
328 // ensure that it does not span a cache line so that it can be patched. |
329 int CallStaticJavaDirectNode::compute_padding(int current_offset) const { |
329 int CallStaticJavaDirectNode::compute_padding(int current_offset) const { |
330 current_offset += pre_call_resets_size(); // skip fldcw, if any |
330 current_offset += pre_call_resets_size(); // skip fldcw, if any |
331 current_offset += 1; // skip call opcode byte |
331 current_offset += 1; // skip call opcode byte |
332 return round_to(current_offset, alignment_required()) - current_offset; |
332 return align_up(current_offset, alignment_required()) - current_offset; |
333 } |
333 } |
334 |
334 |
335 // The address of the call instruction needs to be 4-byte aligned to |
335 // The address of the call instruction needs to be 4-byte aligned to |
336 // ensure that it does not span a cache line so that it can be patched. |
336 // ensure that it does not span a cache line so that it can be patched. |
337 int CallDynamicJavaDirectNode::compute_padding(int current_offset) const { |
337 int CallDynamicJavaDirectNode::compute_padding(int current_offset) const { |
338 current_offset += pre_call_resets_size(); // skip fldcw, if any |
338 current_offset += pre_call_resets_size(); // skip fldcw, if any |
339 current_offset += 5; // skip MOV instruction |
339 current_offset += 5; // skip MOV instruction |
340 current_offset += 1; // skip call opcode byte |
340 current_offset += 1; // skip call opcode byte |
341 return round_to(current_offset, alignment_required()) - current_offset; |
341 return align_up(current_offset, alignment_required()) - current_offset; |
342 } |
342 } |
343 |
343 |
344 // EMIT_RM() |
344 // EMIT_RM() |
345 void emit_rm(CodeBuffer &cbuf, int f1, int f2, int f3) { |
345 void emit_rm(CodeBuffer &cbuf, int f1, int f2, int f3) { |
346 unsigned char c = (unsigned char)((f1 << 6) | (f2 << 3) | f3); |
346 unsigned char c = (unsigned char)((f1 << 6) | (f2 << 3) | f3); |
3273 // representing the register number (i.e. - use a register name) or |
3273 // representing the register number (i.e. - use a register name) or |
3274 // stack slot. |
3274 // stack slot. |
3275 // Ret Addr is on stack in slot 0 if no locks or verification or alignment. |
3275 // Ret Addr is on stack in slot 0 if no locks or verification or alignment. |
3276 // Otherwise, it is above the locks and verification slot and alignment word |
3276 // Otherwise, it is above the locks and verification slot and alignment word |
3277 return_addr(STACK - 1 + |
3277 return_addr(STACK - 1 + |
3278 round_to((Compile::current()->in_preserve_stack_slots() + |
3278 align_up((Compile::current()->in_preserve_stack_slots() + |
3279 Compile::current()->fixed_slots()), |
3279 Compile::current()->fixed_slots()), |
3280 stack_alignment_in_slots())); |
3280 stack_alignment_in_slots())); |
3281 |
3281 |
3282 // Body of function which returns an integer array locating |
3282 // Body of function which returns an integer array locating |
3283 // arguments either in registers or in stack slots. Passed an array |
3283 // arguments either in registers or in stack slots. Passed an array |