From: edwin Date: Wed, 15 Mar 2006 12:04:05 +0000 (+0000) Subject: * doc/stack_frames.txt: Added file. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=4e10d4a9cba173105c25d0aaf2d0de75f3e5a6b4;hp=f17a11ca14218235bda9871b089f8049a74c4e22;p=cacao.git * doc/stack_frames.txt: Added file. * 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. --- diff --git a/doc/stack_frames.txt b/doc/stack_frames.txt new file mode 100644 index 000000000..c2223f076 --- /dev/null +++ b/doc/stack_frames.txt @@ -0,0 +1,29 @@ +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 + + + diff --git a/src/vm/jit/code.h b/src/vm/jit/code.h index 441e7bf51..dd6821756 100644 --- a/src/vm/jit/code.h +++ b/src/vm/jit/code.h @@ -50,15 +50,15 @@ struct codeinfo { 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 */ diff --git a/src/vm/jit/i386/asmpart.S b/src/vm/jit/i386/asmpart.S index 7e9611268..78763dc95 100644 --- a/src/vm/jit/i386/asmpart.S +++ b/src/vm/jit/i386/asmpart.S @@ -31,7 +31,7 @@ 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 $ */ @@ -540,11 +540,11 @@ L_asm_wrapper_patcher_exception: /* 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 @@ -562,7 +562,7 @@ asm_replacement_out: 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 */ diff --git a/src/vm/jit/i386/md.c b/src/vm/jit/i386/md.c index 3d3d1544f..07328061a 100644 --- a/src/vm/jit/i386/md.c +++ b/src/vm/jit/i386/md.c @@ -28,7 +28,7 @@ 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 $ */ @@ -127,7 +127,7 @@ void md_patch_replacement_point(rplpoint *rp) fflush(stdout); } - /* XXX if required asm_cacheflush(rp->pc,4); */ + /* XXX if required asm_cacheflush(rp->pc,8); */ } /* diff --git a/src/vm/jit/replace.c b/src/vm/jit/replace.c index 22c37b58f..e3f438295 100644 --- a/src/vm/jit/replace.c +++ b/src/vm/jit/replace.c @@ -269,7 +269,7 @@ void replace_deactivate_replacement_point(rplpoint *rp) IN: rp...............replacement point that has been reached - es...............executions state read by asm_replacement_out + es...............execution state read by asm_replacement_out *******************************************************************************/