* src/vm/jit/code.h (codeinfo): Rearranged fields.
* src/vm/jit/i386/md.c, src/vm/jit/i386/asmpart.S, src/vm/jit/replace.c:
Comment changes.
--- /dev/null
+STACK FRAME FORMAT
+=====================
+Author: Edwin Steiner
+
+
+Overview
+--------
+
+For the sake of efficiency CACAO uses its own stack frame layout that does
+not comply with the usual frame layout on the native ABI. This document
+tries to collect the stack frame layouts used on the various architectures.
+
+
+i386 stack frames
+-----------------
+
+>>>> sp in method (after initial sub) <<<<
+
+u4[] arguments for calling methods
+u4[] local variable slots allocated on stack
+u4[] callee-saved registers
+
+>>>> sp on method entry <<<<
+
+u4 return address
+u4[] arguments on stack
+
+
+
codeinfo *prev; /* previous codeinfo of this method*/
/* machine code */
- s4 mcodelength; /* length of generated machine code*/
u1 *mcode; /* pointer to machine code */
u1 *entrypoint; /* machine code entry point */
+ s4 mcodelength; /* length of generated machine code*/
bool isleafmethod; /* does method call subroutines */
/* replacement */
rplpoint *rplpoints; /* replacement points */
- s4 rplpointcount; /* number of replacement points */
s2 *regalloc; /* register allocation info */
+ s4 rplpointcount; /* number of replacement points */
s4 globalcount; /* number of global allocations */
s4 regalloccount; /* number of total allocations */
Changes: Joseph Wenninger
Edwin Steiner
- $Id: asmpart.S 4611 2006-03-15 11:18:30Z twisti $
+ $Id: asmpart.S 4613 2006-03-15 12:04:05Z edwin $
*/
/* asm_replacement_out *********************************************************
This code is jumped to from the replacement-out stubs that are executed
- when a thread reaches a activated replacement point.
+ when a thread reaches an activated replacement point.
The purpose of asm_replacement_out is to read out the parts of the
execution state that cannot be accessed from C code, store this state,
- and call the C function replace_me.
+ and then call the C function replace_me.
Stack layout:
0 rplpoint * info on the replacement point that was reached
movl $0,(4+2*8+offes_regs)(sp)
mov sizeexecutionstate(sp),itmp1 /* rplpoint * */
- push sp /* XXX */ /* arg1: execution state */
+ push sp /* arg1: execution state */
push itmp1 /* arg0: replacement point */
call replace_me /* call C function replace_me */
call abort /* NEVER REACHED */
Changes: Edwin Steiner
- $Id: md.c 4612 2006-03-15 11:38:02Z edwin $
+ $Id: md.c 4613 2006-03-15 12:04:05Z edwin $
*/
fflush(stdout);
}
- /* XXX if required asm_cacheflush(rp->pc,4); */
+ /* XXX if required asm_cacheflush(rp->pc,8); */
}
/*
IN:
rp...............replacement point that has been reached
- es...............executions state read by asm_replacement_out
+ es...............execution state read by asm_replacement_out
*******************************************************************************/