Mac OS X i486 ABI -- 16-byte stack alignment

Landon Fuller landonf at
Wed Nov 7 14:46:09 PST 2007

On Nov 7, 2007, at 14:16, Paul Hohensee wrote:

> Take a look at the x64 code.  The x64 ABI requires 16-byte  
> alignment at
> call sites.  Compiler-generated code maintains 16-byte alignment at  
> all
> times, but the template interpreter doesn't, so calling out from it  
> means
> aligning the stack.
> See, e.g., call_VM_base in assembler_x86_64.cpp.

x64's call_VM_base() can assume 8 bytes in either direction will  
align the stack, as it uses 8-byte word size. It also looks like all  
call_VM_base() arguments must be register-passed. x64's 16-byte  
alignment looks like:
     testl(rsp, 15);
     jcc(Assembler::zero, L);

     subq(rsp, 8);
     call(entry_point, relocInfo::runtime_call_type);
     addq(rsp, 8);

Am I mistaken? -- On x86-32, the stack can be 4, 8, or 12 bytes  
offset from 16 byte alignment, and the stack has to be padded to  
ensure that it's still aligned once all the arguments have been  
pushed on the stack -- I'm not sure how to make the Darwin x86-32  
alignment simplier.

Thank you,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : 

More information about the hotspot-dev mailing list