* src/vm/jit/alpha/codegen.c (codegen): Use codeinfo instead of
authortwisti <none@none>
Tue, 20 Jun 2006 11:55:40 +0000 (11:55 +0000)
committertwisti <none@none>
Tue, 20 Jun 2006 11:55:40 +0000 (11:55 +0000)
methodinfo.
(createcompilerstub): Likewise.
(createnativestub): Likewise.

* src/vm/jit/alpha/asmpart.S (asm_vm_call_method): Likewise.

src/vm/jit/alpha/asmpart.S
src/vm/jit/alpha/codegen.c

index 08939eb49f7c4258f7136bcebf7ce1317b73221d..99159066f5a021fb2667afca62c5cb336b57208c 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
                Edwin Steiner
 
-   $Id: asmpart.S 4922 2006-05-15 14:39:05Z twisti $
+   $Id: asmpart.S 5042 2006-06-20 11:55:40Z twisti $
 
 */
 
        .long   0                           /* isleaf                             */
        .long   0                           /* IsSync                             */
        .long   0                           /* frame size                         */
-       .quad   0                           /* method pointer (pointer to name)   */
+       .quad   0                           /* codeinfo pointer                   */
 
 asm_vm_call_method:
 asm_vm_call_method_int:
index f4cb5628f15440a5f8a347d031203952c8bd1b06..d23a9d77c04b7085bcdd3e01e4a3b4bd40e69cfc 100644 (file)
@@ -32,7 +32,7 @@
             Christian Ullrich
             Edwin Steiner
 
-   $Id: codegen.c 4937 2006-05-18 14:33:32Z edwin $
+   $Id: codegen.c 5042 2006-06-20 11:55:40Z twisti $
 
 */
 
@@ -83,6 +83,7 @@
 bool codegen(jitdata *jd)
 {
        methodinfo         *m;
+       codeinfo           *code;
        codegendata        *cd;
        registerdata       *rd;
        s4                  len, s1, s2, s3, d, disp;
@@ -100,9 +101,10 @@ bool codegen(jitdata *jd)
 
        /* get required compiler data */
 
-       m  = jd->m;
-       cd = jd->cd;
-       rd = jd->rd;
+       m    = jd->m;
+       code = jd->code;
+       cd   = jd->cd;
+       rd   = jd->rd;
 
        /* prevent compiler warnings */
 
@@ -135,8 +137,8 @@ bool codegen(jitdata *jd)
        stackframesize = (stackframesize + 1) & ~1;    /* align stack to 16-bytes */
 #endif
 
-       (void) dseg_addaddress(cd, m);                          /* MethodPointer  */
-       (void) dseg_adds4(cd, stackframesize * 8);              /* FrameSize      */
+       (void) dseg_addaddress(cd, code);                      /* CodeinfoPointer */
+       (void) dseg_adds4(cd, stackframesize * 8);             /* FrameSize       */
 
 #if defined(ENABLE_THREADS)
        /* IsSync contains the offset relative to the stack pointer for the
@@ -146,18 +148,18 @@ bool codegen(jitdata *jd)
        */
 
        if (checksync && (m->flags & ACC_SYNCHRONIZED))
-               (void) dseg_adds4(cd, (rd->memuse + 1) * 8);        /* IsSync         */
+               (void) dseg_adds4(cd, (rd->memuse + 1) * 8);       /* IsSync          */
        else
 #endif
-               (void) dseg_adds4(cd, 0);                           /* IsSync         */
-                                              
-       (void) dseg_adds4(cd, m->isleafmethod);                 /* IsLeaf         */
-       (void) dseg_adds4(cd, INT_SAV_CNT - rd->savintreguse);  /* IntSave        */
-       (void) dseg_adds4(cd, FLT_SAV_CNT - rd->savfltreguse);  /* FltSave        */
+               (void) dseg_adds4(cd, 0);                          /* IsSync          */
+
+       (void) dseg_adds4(cd, m->isleafmethod);                /* IsLeaf          */
+       (void) dseg_adds4(cd, INT_SAV_CNT - rd->savintreguse); /* IntSave         */
+       (void) dseg_adds4(cd, FLT_SAV_CNT - rd->savfltreguse); /* FltSave         */
 
        dseg_addlinenumbertablesize(cd);
 
-       (void) dseg_adds4(cd, cd->exceptiontablelength);        /* ExTableSize    */
+       (void) dseg_adds4(cd, cd->exceptiontablelength);       /* ExTableSize     */
 
        /* create exception table */
 
@@ -3951,7 +3953,7 @@ gen_method:
        
 *******************************************************************************/
 
-#define COMPILERSTUB_DATASIZE    2 * SIZEOF_VOID_P
+#define COMPILERSTUB_DATASIZE    3 * SIZEOF_VOID_P
 #define COMPILERSTUB_CODESIZE    3 * 4
 
 #define COMPILERSTUB_SIZE        COMPILERSTUB_DATASIZE + COMPILERSTUB_CODESIZE
@@ -3961,6 +3963,7 @@ u1 *createcompilerstub(methodinfo *m)
 {
        u1          *s;                     /* memory to hold the stub            */
        ptrint      *d;
+       codeinfo    *code;
        codegendata *cd;
        s4           dumpsize;              /* code generation pointer            */
 
@@ -3978,16 +3981,19 @@ u1 *createcompilerstub(methodinfo *m)
        cd = DNEW(codegendata);
        cd->mcodeptr = s;
 
-       /* Store the methodinfo* in the same place as in the methodheader
-          for compiled methods. */
+       /* Store the codeinfo pointer in the same place as in the
+          methodheader for compiled methods. */
+
+       code = code_codeinfo_new(m);
 
        d[0] = (ptrint) asm_call_jit_compiler;
        d[1] = (ptrint) m;
+       d[2] = (ptrint) code;
 
        /* code for the stub */
 
-       M_ALD(REG_ITMP1, REG_PV, -1 * 8);   /* load methodinfo pointer            */
-       M_ALD(REG_PV, REG_PV, -2 * 8);      /* load pointer to the compiler       */
+       M_ALD(REG_ITMP1, REG_PV, -2 * 8);   /* load codeinfo pointer              */
+       M_ALD(REG_PV, REG_PV, -3 * 8);      /* load pointer to the compiler       */
        M_JMP(REG_ZERO, REG_PV);            /* jump to the compiler               */
 
 #if defined(ENABLE_STATISTICS)
@@ -4012,6 +4018,7 @@ u1 *createcompilerstub(methodinfo *m)
 u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 {
        methodinfo   *m;
+       codeinfo     *code;
        codegendata  *cd;
        registerdata *rd;
        s4            stackframesize;       /* size of stackframe if needed       */
@@ -4024,9 +4031,10 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        /* get required compiler data */
 
-       m  = jd->m;
-       cd = jd->cd;
-       rd = jd->rd;
+       m    = jd->m;
+       code = jd->code;
+       cd   = jd->cd;
+       rd   = jd->rd;
 
        /* initialize variables */
 
@@ -4045,14 +4053,14 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        /* create method header */
 
-       (void) dseg_addaddress(cd, m);                          /* MethodPointer  */
-       (void) dseg_adds4(cd, stackframesize * 8);              /* FrameSize      */
-       (void) dseg_adds4(cd, 0);                               /* IsSync         */
-       (void) dseg_adds4(cd, 0);                               /* IsLeaf         */
-       (void) dseg_adds4(cd, 0);                               /* IntSave        */
-       (void) dseg_adds4(cd, 0);                               /* FltSave        */
+       (void) dseg_addaddress(cd, code);                      /* CodeinfoPointer */
+       (void) dseg_adds4(cd, stackframesize * 8);             /* FrameSize       */
+       (void) dseg_adds4(cd, 0);                              /* IsSync          */
+       (void) dseg_adds4(cd, 0);                              /* IsLeaf          */
+       (void) dseg_adds4(cd, 0);                              /* IntSave         */
+       (void) dseg_adds4(cd, 0);                              /* FltSave         */
        (void) dseg_addlinenumbertablesize(cd);
-       (void) dseg_adds4(cd, 0);                               /* ExTableSize    */
+       (void) dseg_adds4(cd, 0);                              /* ExTableSize     */
 
        /* generate stub code */