Figure D-1 Stack Frames Based On Alignment Type - Intel ARCHITECTURE IA-32 Reference Manual

Architecture optimization
Table of Contents

Advertisement

Figure D-1 Stack Frames Based on Alignment Type

ESP-based Aligned Frame
Parameters
Return Address
Padding
Register Save Area
Local Variables and
Spill Slots
__cdecl Parameter
Passing Space
__stdcall Parameter
Passing Space
As an optimization, an alternate entry point can be created that can be
called when proper stack alignment is provided by the caller. Using call
graph profiling of the VTune analyzer, calls to the normal (unaligned)
entry point can be optimized into calls to the (alternate) aligned entry
point when the stack can be proven to be properly aligned. Furthermore,
a function alignment requirement attribute can be modified throughout
the call graph so as to cause the least number of calls to unaligned entry
points. As an example of this, suppose function F has only a stack
alignment requirement of 4, but it calls function G at many call sites,
and in a loop. If G's alignment requirement is 16, then by promoting F's
alignment requirement to 16, and making all calls to G go to its aligned
entry point, the compiler can minimize the number of times that control
passes through the unaligned entry points. Example D-1 and
EBP-based Aligned Frame
Parameter
Pointer
Return Address 1
SEH/CEH Record
Local Variables and
ESP
EBP-frame Saved
Parameter Passing
Stack Alignment
Parameters
Return Address
Padding
Previous EBP
Spill Slots
Register Area
Space
D
Parameter
Pointer
EBP
ESP
D-3

Advertisement

Table of Contents
loading

Table of Contents