* doc/stack_frames.txt: Added file.
authoredwin <none@none>
Wed, 15 Mar 2006 12:04:05 +0000 (12:04 +0000)
committeredwin <none@none>
Wed, 15 Mar 2006 12:04:05 +0000 (12:04 +0000)
* 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.

doc/stack_frames.txt [new file with mode: 0644]
src/vm/jit/code.h
src/vm/jit/i386/asmpart.S
src/vm/jit/i386/md.c
src/vm/jit/replace.c

diff --git a/doc/stack_frames.txt b/doc/stack_frames.txt
new file mode 100644 (file)
index 0000000..c2223f0
--- /dev/null
@@ -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
+
+
+
index 441e7bf513150c4a2d56b83240fbcc237213b12c..dd68217561f94b2f2cea80781d5afc2241e1a67d 100644 (file)
@@ -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     */
 
index 7e961126841c07e9f2d2a88d3f2ff91c896c6ec1..78763dc956acde2c32336183822516ea35687dbb 100644 (file)
@@ -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                      */
index 3d3d1544f78162cabb0355fdaecbce1e903b1cbb..07328061a21feded02a0c1d7927ffed401e76587 100644 (file)
@@ -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); */
 }
 
 /*
index 22c37b58f544cc21c16042f396bcb35ff2aec470..e3f43829513cbf212247b048da6c5269ef9b0a2f 100644 (file)
@@ -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
   
 *******************************************************************************/