You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by Apache Wiki <wi...@apache.org> on 2008/05/12 11:39:44 UTC

[Harmony Wiki] Update of "Jitrino OPT/stack" by Mikhail Fursov

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Harmony Wiki" for change notification.

The following page has been changed by Mikhail Fursov:
http://wiki.apache.org/harmony/Jitrino_OPT/stack

New page:
''' 'stack' ''' -  performs forming of stack memory for a method.
[[BR]][[BR]]
The transformation performs forming of stack memory for a method,[[BR]]
, e.g. allocates memory for stack variables and input arguments, inserts [[BR]]
saving/restoring callee-save registers. Also it fills StackInfo object [[BR]]
for runtime access to information about stack layout [[BR]]

[[BR]][[BR]] This transformer ensures that
{{{
   1)  All input argument operands and stack memory operands have appropriate
       displacements from stack pointer
   
   2)  There are save/restore instructions for all callee-save registers
 
   3)  There are save/restore instructions for all caller-save registers for
       all calls in method
 
   4)  ESP has appropriate value throughout whole method
 }}}
[[BR]]
Stack layout illustration:
{{{
 
   +-------------------------------+   inargEnd
   |                               |
   |                               |
   |                               |
   +-------------------------------+   inargBase, eipEnd
   |           eip                 |
   +-------------------------------+   eipBase,icalleeEnd      <--- "virtual" ESP
   |           EBX                 |
   |           EBP                 |
   |           ESI                 |
   |           EDI                 |
   +-------------------------------+   icalleeBase, fcalleeEnd
   |                               |
   |                               |
   |                               |
   +-------------------------------+   fcalleeBase, acalleeEnd
   |                               |
   |                               |
   |                               |
   +-------------------------------+   acalleeBase, localEnd
   |                               |
   |                               |
   |                               |
   +-------------------------------+   localBase    
   |      alignment padding        |
   |-------------------------------+   <--- "real" ESP
   |           EAX                 |
   |           ECX                 |
   |           EDX                 |
   +-------------------------------+   base of caller-save regs
   
}}}