hotspot/src/cpu/x86/vm/x86_64.ad
changeset 46620 750c6edff33b
parent 46440 61025eecb743
child 46735 219c4312853e
equal deleted inserted replaced
46619:a3919f5e8d2b 46620:750c6edff33b
   577 // ensure that it does not span a cache line so that it can be patched.
   577 // ensure that it does not span a cache line so that it can be patched.
   578 int CallStaticJavaDirectNode::compute_padding(int current_offset) const
   578 int CallStaticJavaDirectNode::compute_padding(int current_offset) const
   579 {
   579 {
   580   current_offset += clear_avx_size(); // skip vzeroupper
   580   current_offset += clear_avx_size(); // skip vzeroupper
   581   current_offset += 1; // skip call opcode byte
   581   current_offset += 1; // skip call opcode byte
   582   return round_to(current_offset, alignment_required()) - current_offset;
   582   return align_up(current_offset, alignment_required()) - current_offset;
   583 }
   583 }
   584 
   584 
   585 // The address of the call instruction needs to be 4-byte aligned to
   585 // The address of the call instruction needs to be 4-byte aligned to
   586 // ensure that it does not span a cache line so that it can be patched.
   586 // ensure that it does not span a cache line so that it can be patched.
   587 int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
   587 int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
   588 {
   588 {
   589   current_offset += clear_avx_size(); // skip vzeroupper
   589   current_offset += clear_avx_size(); // skip vzeroupper
   590   current_offset += 11; // skip movq instruction + call opcode byte
   590   current_offset += 11; // skip movq instruction + call opcode byte
   591   return round_to(current_offset, alignment_required()) - current_offset;
   591   return align_up(current_offset, alignment_required()) - current_offset;
   592 }
   592 }
   593 
   593 
   594 // EMIT_RM()
   594 // EMIT_RM()
   595 void emit_rm(CodeBuffer &cbuf, int f1, int f2, int f3) {
   595 void emit_rm(CodeBuffer &cbuf, int f1, int f2, int f3) {
   596   unsigned char c = (unsigned char) ((f1 << 6) | (f2 << 3) | f3);
   596   unsigned char c = (unsigned char) ((f1 << 6) | (f2 << 3) | f3);
  2805   // representing the register number (i.e. - use a register name) or
  2805   // representing the register number (i.e. - use a register name) or
  2806   // stack slot.
  2806   // stack slot.
  2807   // Ret Addr is on stack in slot 0 if no locks or verification or alignment.
  2807   // Ret Addr is on stack in slot 0 if no locks or verification or alignment.
  2808   // Otherwise, it is above the locks and verification slot and alignment word
  2808   // Otherwise, it is above the locks and verification slot and alignment word
  2809   return_addr(STACK - 2 +
  2809   return_addr(STACK - 2 +
  2810               round_to((Compile::current()->in_preserve_stack_slots() +
  2810               align_up((Compile::current()->in_preserve_stack_slots() +
  2811                         Compile::current()->fixed_slots()),
  2811                         Compile::current()->fixed_slots()),
  2812                        stack_alignment_in_slots()));
  2812                        stack_alignment_in_slots()));
  2813 
  2813 
  2814   // Body of function which returns an integer array locating
  2814   // Body of function which returns an integer array locating
  2815   // arguments either in registers or in stack slots.  Passed an array
  2815   // arguments either in registers or in stack slots.  Passed an array