View Single Post
  #3  
Old 11-10-2013, 22:59
mcp mcp is offline
Friend
 
Join Date: Dec 2011
Posts: 73
Rept. Given: 4
Rept. Rcvd 12 Times in 11 Posts
Thanks Given: 7
Thanks Rcvd at 21 Times in 12 Posts
mcp Reputation: 12
Nearly all of your points are completely wrong.
1) The space is not reserved for register spill, in fact there is no constraint on what the callee is supposed to do with that stack space: there is no reserved purpose for that area.
2) Since the callee can always rely on the existence of that area, he is free to use it for whatever he wants (if e.g. the optimizer decides to do so). That contradicts your "won't be used" claim.
3) It is not compiler dependent, all compilers for x64 on windows have to adhere to these conventions (at least when they interface with other compiler generated code or the OS API).
4) The size of the space is not fixed at all. To the contrary: the space depends on the number of parameters passed to the callee.

MSDN documentation

Quote:
It contains at least four entries, but always enough space to hold all the parameters needed by any function that may be called. Note that space is always allocated for the register parameters, even if the parameters themselves are never homed to the stack; a callee is guaranteed that space has been allocated for all its parameters
Reply With Quote