9 For the sake of efficiency CACAO uses its own stack frame layout that does
10 not comply with the usual frame layout on the native ABI. This document
11 tries to collect the stack frame layouts used on the various architectures.
17 ,--memory address rising
19 V >>>> sp in method (after initial sub) <<<<
21 | u4[] v arguments for calling methods \__ rd->memuse slots
22 V u4[] v local variable slots allocated on stack /
24 | u4[1..2] synchronized object / saved return value (only for synched methods)
26 | u8[] ^ callee-saved float registers
27 | u4[] ^ callee-saved integer registers
29 | >>>> sp on method entry, stack base for replacement <<<<
32 | u4[] arguments on stack
40 ,--memory address rising
42 V >>>> sp in method (after initial sub) (16-byte aligned in non-leaf methods) <<<<
44 | u8[] v arguments for calling methods \__ rd->memuse slots
45 V u8[] v local variable slots allocated on stack /
47 | u8 v synchronized object / saved return value (only for synched methods)
48 V u8[0..1] alignment dummy slot (in non-leaf methods to ensure
49 | 16-byte alignment of stack)
50 | u8[] ^ callee-saved float registers
51 V u8[] ^ callee-saved integer registers
53 | >>>> sp on method entry, stack base for replacement (8-byte odd) <<<<
57 V >>>>> (16-byte aligned) <<<<
59 | u8[] arguments on stack
67 ,--memory address rising
69 V >>>> sp in method (after initial sub) <<<<
71 | u8[] v arguments for calling methods \__ rd->memuse slots
72 V u8[] v local variable slots allocated on stack /
74 | u8 synchronized object / saved return value (only for synched methods)
75 | u8[0..1] alignment dummy slot
77 | u8[] ^ callee-saved float registers
78 | u8[] ^ callee-saved integer registers
80 | >>>> !!!replacement code regards this point as stack base!!! <<<<
82 V u8 ^ saved return address (only for non-leaf methods)
84 | >>>> sp on method entry <<<<
86 | u8[] arguments on stack
94 ,--memory address rising
96 V >>>> sp in method (after initial sub) (16-byte aligned) <<<<
98 | u8[] v arguments for calling methods \__ rd->memuse slots
99 V u8[] v local variable slots allocated on stack /
101 | u8 synchronized object / saved return value (only for synched methods)
102 | u8[0..1] alignment dummy slot (to ensure 16-byte alignment of sp)
104 | u8[] ^ callee-saved float registers
105 | u8[] ^ callee-saved integer registers
107 | >>>> !!!replacement code regards this point as stack base!!! <<<<
109 V u8 ^ saved return address (only for non-leaf methods)
111 | >>>> sp on method entry (16-byte aligned) <<<<
113 | u8[] arguments on stack
121 ,--memory address rising
123 V >>>> sp in method (after initial sub) (16-byte aligned) <<<<
125 | u4[] v arguments for calling methods (incl. LA) \__ rd->memuse slots
126 V u4[] v local variable slots allocated on stack /
128 | u4[2..3] synchronized object / saved return value (only for synched methods)
129 | u4[0..3] alignment slots
131 | u8[] ^ callee-saved float registers
132 | u4[] ^ callee-saved integer registers
134 | >>>> sp on method entry, stack base for replacement (16-byte aligned) <<<<
136 | u4[] arguments on stack (inludes LA == linkage area)