We again use the dump memory in the jit compiler.
authortwisti <none@none>
Mon, 8 Nov 2004 11:24:50 +0000 (11:24 +0000)
committertwisti <none@none>
Mon, 8 Nov 2004 11:24:50 +0000 (11:24 +0000)
jit/codegen.inc
jit/jit.c
jit/reg.inc
jit/x86_64/codegen.c
src/vm/jit/codegen.inc
src/vm/jit/jit.c
src/vm/jit/reg.inc
src/vm/jit/x86_64/codegen.c

index 32466be6800bd7652e84a2c54933551f91fa6ebe..dcf794f7c48f3bc5dfbafc1e9d36aad20457f7b6 100644 (file)
@@ -48,7 +48,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen.inc 1463 2004-11-06 21:20:53Z motse $
+   $Id: codegen.inc 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -146,12 +146,12 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *id)
        if (useinlining && id) {
                if (id->cumextablelength > 0) {
                        cd->exceptiontablelength = id->cumextablelength;
-                       cd->exceptiontable  = MNEW(exceptiontable, id->cumextablelength + 1);
+                       cd->exceptiontable  = DMNEW(exceptiontable, id->cumextablelength + 1);
                }
 
        } else if (id && (id->method->exceptiontablelength >0)) {
                cd->exceptiontablelength = m->exceptiontablelength;
-               cd->exceptiontable  = MNEW(exceptiontable, m->exceptiontablelength + 1);
+               cd->exceptiontable  = DMNEW(exceptiontable, m->exceptiontablelength + 1);
        }
 
        if (id) {
@@ -178,12 +178,14 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *id)
 void codegen_free(methodinfo *m, codegendata *cd)
 {
        if (cd) {
+#if 0
                if (cd->exceptiontablelength) {
                        cd->exceptiontablelength = m->exceptiontablelength;
                        MFREE(cd->exceptiontable, exceptiontable, cd->exceptiontablelength + 1);
                        cd->exceptiontable = 0;
                        cd->exceptiontablelength = 0;
                }
+#endif
 
                if (cd->mcodebase) {
                        MFREE(cd->mcodebase, u1, cd->mcodesize);
index a26b0963d209040b201493c0b31550ff6036a9ca..ba1258329547c45a9d23c9085fcde3d24d641e1d 100644 (file)
--- a/jit/jit.c
+++ b/jit/jit.c
@@ -29,7 +29,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: jit.c 1456 2004-11-05 14:33:14Z twisti $
+   $Id: jit.c 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -1340,11 +1340,13 @@ static void* do_nothing_function()
 
 /* jit_compile *****************************************************************
 
-       jit_compile, new version of compiler, translates one method to machine code
+   jit_compile, new version of compiler, translates one method to machine code
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id);
+static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                       registerdata *rd, loopdata *ld,
+                                                                       t_inlining_globals *id);
 
 methodptr jit_compile(methodinfo *m)
 {
@@ -1397,21 +1399,21 @@ methodptr jit_compile(methodinfo *m)
        jitrunning = true;
 #endif
 
-       /* mark start of dump memory area */
-
-       dumpsize = dump_size();
-
        /* measure time */
 
        if (getcompilingtime)
                compilingtime_start();
 
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
+
        /* allocate memory */
 
-       cd = NEW(codegendata);
-       rd = NEW(registerdata);
-       ld = NEW(loopdata);
-       id = NEW(t_inlining_globals);
+       cd = DNEW(codegendata);
+       rd = DNEW(registerdata);
+       ld = DNEW(loopdata);
+       id = DNEW(t_inlining_globals);
 
        /* RTA static analysis must be called before inlining */
        if (opt_rt)
@@ -1449,13 +1451,6 @@ methodptr jit_compile(methodinfo *m)
 
        dump_release(dumpsize);
 
-       /* free memory */
-
-       FREE(cd, codegendata);
-       FREE(rd, registerdata);
-       FREE(ld, loopdata);
-       FREE(id, t_inlining_globals);
-
        /* measure time */
 
        if (getcompilingtime)
@@ -1478,7 +1473,15 @@ methodptr jit_compile(methodinfo *m)
 }
 
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id)
+/* jit_compile_intern **********************************************************
+
+   Static internal function which does the actual compilation.
+
+*******************************************************************************/
+
+static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                       registerdata *rd, loopdata *ld,
+                                                                       t_inlining_globals *id)
 {
        /* print log message for compiled method */
 
@@ -1529,8 +1532,6 @@ static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata
 
        /* call the compiler passes ***********************************************/
 
-       EXTABLEN
-
        if (compileverbose)
                log_message_method("Parsing: ", m);
 
index f027d8aa2187b7c9229bce3681a7f4f673a0a045..0a67f9959261753a7eba2e9086e34de6a429acd6 100644 (file)
@@ -30,7 +30,7 @@
    Changes: Stefan Ring
             Christian Thalinger
 
-   $Id: reg.inc 1459 2004-11-05 16:23:02Z twisti $
+   $Id: reg.inc 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -88,14 +88,14 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
                }
        }
 
-       rd->argintregs = MNEW(s4, rd->intreg_argnum);
-       rd->tmpintregs = MNEW(s4, rd->tmpintregcnt);
-       rd->savintregs = MNEW(s4, rd->savintregcnt);
-       rd->freeargintregs = MNEW(s4, rd->intreg_argnum);
-       rd->freetmpintregs = MNEW(s4, rd->tmpintregcnt);
-       rd->freesavintregs = MNEW(s4, rd->savintregcnt);
+       rd->argintregs = DMNEW(s4, rd->intreg_argnum);
+       rd->tmpintregs = DMNEW(s4, rd->tmpintregcnt);
+       rd->savintregs = DMNEW(s4, rd->savintregcnt);
+       rd->freeargintregs = DMNEW(s4, rd->intreg_argnum);
+       rd->freetmpintregs = DMNEW(s4, rd->tmpintregcnt);
+       rd->freesavintregs = DMNEW(s4, rd->savintregcnt);
 #ifdef USETWOREGS
-       rd->secondregs = MNEW(s4, rd->intregsnum);
+       rd->secondregs = DMNEW(s4, rd->intregsnum);
 #endif
 
        rd->intreg_argnum = 0;
@@ -168,12 +168,12 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
                }
        }
 
-       rd->argfltregs = MNEW(s4, rd->fltreg_argnum);
-       rd->tmpfltregs = MNEW(s4, rd->tmpfltregcnt);
-       rd->savfltregs = MNEW(s4, rd->savfltregcnt);
-       rd->freeargfltregs = MNEW(s4, rd->fltreg_argnum);
-       rd->freetmpfltregs = MNEW(s4, rd->tmpfltregcnt);
-       rd->freesavfltregs = MNEW(s4, rd->savfltregcnt);
+       rd->argfltregs = DMNEW(s4, rd->fltreg_argnum);
+       rd->tmpfltregs = DMNEW(s4, rd->tmpfltregcnt);
+       rd->savfltregs = DMNEW(s4, rd->savfltregcnt);
+       rd->freeargfltregs = DMNEW(s4, rd->fltreg_argnum);
+       rd->freetmpfltregs = DMNEW(s4, rd->tmpfltregcnt);
+       rd->freesavfltregs = DMNEW(s4, rd->savfltregcnt);
 
        rd->fltreg_argnum = 0;
        rd->argfltreguse = 0;
@@ -199,9 +199,9 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
        }
 
 
-       rd->freemem    = MNEW(s4, id->cummaxstack);
-       rd->locals     = MNEW(varinfo5, id->cumlocals);
-       rd->interfaces = MNEW(varinfo5, id->cummaxstack);
+       rd->freemem    = DMNEW(s4, id->cummaxstack);
+       rd->locals     = DMNEW(varinfo5, id->cumlocals);
+       rd->interfaces = DMNEW(varinfo5, id->cummaxstack);
 
        for (v = rd->locals, i = id->cumlocals; i > 0; v++, i--) {
                v[0][TYPE_INT].type = -1;
@@ -234,27 +234,7 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
 
 void reg_free(methodinfo *m, registerdata *rd)
 {
-       if (rd->argintregs) MFREE(rd->argintregs, s4, rd->intreg_argnum);
-       if (rd->argfltregs) MFREE(rd->argfltregs, s4, rd->fltreg_argnum);
-       if (rd->tmpintregs) MFREE(rd->tmpintregs, s4, rd->tmpintregcnt);
-       if (rd->savintregs) MFREE(rd->savintregs, s4, rd->savintregcnt);
-       if (rd->tmpfltregs) MFREE(rd->tmpfltregs, s4, rd->tmpfltregcnt);
-       if (rd->savfltregs) MFREE(rd->savfltregs, s4, rd->savfltregcnt);
-
-       if (rd->freeargintregs) MFREE(rd->freeargintregs, s4, rd->intreg_argnum);
-       if (rd->freeargfltregs) MFREE(rd->freeargfltregs, s4, rd->fltreg_argnum);
-       if (rd->freetmpintregs) MFREE(rd->freetmpintregs, s4, rd->tmpintregcnt);
-       if (rd->freesavintregs) MFREE(rd->freesavintregs, s4, rd->savintregcnt);
-       if (rd->freetmpfltregs) MFREE(rd->freetmpfltregs, s4, rd->tmpfltregcnt);
-       if (rd->freesavfltregs) MFREE(rd->freesavfltregs, s4, rd->savfltregcnt);
-
-#ifdef USETWOREGS
-       if (rd->secondregs) MFREE(rd->secondregs, s4, rd->intregsnum);
-#endif
-
-       if (rd->freemem) MFREE(rd->freemem, s4, m->maxstack);
-       if (rd->locals)  MFREE(rd->locals, varinfo5, m->maxlocals);
-       if (rd->interfaces) MFREE(rd->interfaces, varinfo5, m->maxstack);
+       /* void */
 }
 
 
index 6e098dfb029dd0e3983f6f708186daa67fd7f487..fec9ba945c5efd9aa449188eb0e94607d466e54e 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1451 2004-11-05 14:14:15Z twisti $
+   $Id: codegen.c 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -79,8 +79,12 @@ int nregdescfloat[] = {
 };
 
 
-/* include independent code generation stuff -- include after register        */
-/* descriptions to avoid extern definitions                                   */
+/*******************************************************************************
+
+    include independent code generation stuff -- include after register
+    descriptions to avoid extern definitions
+
+*******************************************************************************/
 
 #include "jit/codegen.inc"
 #include "jit/reg.inc"
@@ -3723,10 +3727,14 @@ gen_method: {
 u1 *createcompilerstub(methodinfo *m)
 {
        u1 *s = CNEW(u1, COMPSTUBSIZE);     /* memory to hold the stub            */
-       codegendata *cd = NEW(codegendata);
+       codegendata *cd;
+       s4 dumpsize;
+
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
 
-       /* allocate code and data memory, with using inline stuff */
-       //codegen_setup(m, cd, NULL);
+       cd = DNEW(codegendata);
        cd->mcodeptr = s;
 
        /* code for the stub */
@@ -3739,10 +3747,9 @@ u1 *createcompilerstub(methodinfo *m)
                count_cstub_len += COMPSTUBSIZE;
 #endif
 
-       /* free code and data memory */
-       //codegen_close(m, cd);
+       /* release dump area */
 
-       FREE(cd, codegendata);
+       dump_release(dumpsize);
 
        return s;
 }
@@ -3776,11 +3783,21 @@ u1 *createnativestub(functionptr f, methodinfo *m)
 {
        u1 *s = CNEW(u1, NATIVESTUBSIZE);   /* memory to hold the stub            */
        s4 stackframesize;                  /* size of stackframe if needed       */
-       codegendata *cd = NEW(codegendata);
-       registerdata *rd = NEW(registerdata);
-       t_inlining_globals *id = NEW(t_inlining_globals);
+       codegendata *cd;
+       registerdata *rd;
+       t_inlining_globals *id;
+       s4 dumpsize;
+
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
+
+       cd = DNEW(codegendata);
+       rd = DNEW(registerdata);
+       id = DNEW(t_inlining_globals);
 
        /* setup registers before using it */
+
        inlining_setup(m, id);
        reg_setup(m, rd, id);
 
@@ -4013,8 +4030,9 @@ u1 *createnativestub(functionptr f, methodinfo *m)
                count_nstub_len += NATIVESTUBSIZE;
 #endif
 
-       FREE(cd, codegendata);
-       FREE(rd, registerdata);
+       /* release dump area */
+
+       dump_release(dumpsize);
 
        return s;
 }
index 32466be6800bd7652e84a2c54933551f91fa6ebe..dcf794f7c48f3bc5dfbafc1e9d36aad20457f7b6 100644 (file)
@@ -48,7 +48,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen.inc 1463 2004-11-06 21:20:53Z motse $
+   $Id: codegen.inc 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -146,12 +146,12 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *id)
        if (useinlining && id) {
                if (id->cumextablelength > 0) {
                        cd->exceptiontablelength = id->cumextablelength;
-                       cd->exceptiontable  = MNEW(exceptiontable, id->cumextablelength + 1);
+                       cd->exceptiontable  = DMNEW(exceptiontable, id->cumextablelength + 1);
                }
 
        } else if (id && (id->method->exceptiontablelength >0)) {
                cd->exceptiontablelength = m->exceptiontablelength;
-               cd->exceptiontable  = MNEW(exceptiontable, m->exceptiontablelength + 1);
+               cd->exceptiontable  = DMNEW(exceptiontable, m->exceptiontablelength + 1);
        }
 
        if (id) {
@@ -178,12 +178,14 @@ void codegen_setup(methodinfo *m, codegendata *cd, t_inlining_globals *id)
 void codegen_free(methodinfo *m, codegendata *cd)
 {
        if (cd) {
+#if 0
                if (cd->exceptiontablelength) {
                        cd->exceptiontablelength = m->exceptiontablelength;
                        MFREE(cd->exceptiontable, exceptiontable, cd->exceptiontablelength + 1);
                        cd->exceptiontable = 0;
                        cd->exceptiontablelength = 0;
                }
+#endif
 
                if (cd->mcodebase) {
                        MFREE(cd->mcodebase, u1, cd->mcodesize);
index a26b0963d209040b201493c0b31550ff6036a9ca..ba1258329547c45a9d23c9085fcde3d24d641e1d 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: jit.c 1456 2004-11-05 14:33:14Z twisti $
+   $Id: jit.c 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -1340,11 +1340,13 @@ static void* do_nothing_function()
 
 /* jit_compile *****************************************************************
 
-       jit_compile, new version of compiler, translates one method to machine code
+   jit_compile, new version of compiler, translates one method to machine code
 
 *******************************************************************************/
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id);
+static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                       registerdata *rd, loopdata *ld,
+                                                                       t_inlining_globals *id);
 
 methodptr jit_compile(methodinfo *m)
 {
@@ -1397,21 +1399,21 @@ methodptr jit_compile(methodinfo *m)
        jitrunning = true;
 #endif
 
-       /* mark start of dump memory area */
-
-       dumpsize = dump_size();
-
        /* measure time */
 
        if (getcompilingtime)
                compilingtime_start();
 
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
+
        /* allocate memory */
 
-       cd = NEW(codegendata);
-       rd = NEW(registerdata);
-       ld = NEW(loopdata);
-       id = NEW(t_inlining_globals);
+       cd = DNEW(codegendata);
+       rd = DNEW(registerdata);
+       ld = DNEW(loopdata);
+       id = DNEW(t_inlining_globals);
 
        /* RTA static analysis must be called before inlining */
        if (opt_rt)
@@ -1449,13 +1451,6 @@ methodptr jit_compile(methodinfo *m)
 
        dump_release(dumpsize);
 
-       /* free memory */
-
-       FREE(cd, codegendata);
-       FREE(rd, registerdata);
-       FREE(ld, loopdata);
-       FREE(id, t_inlining_globals);
-
        /* measure time */
 
        if (getcompilingtime)
@@ -1478,7 +1473,15 @@ methodptr jit_compile(methodinfo *m)
 }
 
 
-static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id)
+/* jit_compile_intern **********************************************************
+
+   Static internal function which does the actual compilation.
+
+*******************************************************************************/
+
+static methodptr jit_compile_intern(methodinfo *m, codegendata *cd,
+                                                                       registerdata *rd, loopdata *ld,
+                                                                       t_inlining_globals *id)
 {
        /* print log message for compiled method */
 
@@ -1529,8 +1532,6 @@ static methodptr jit_compile_intern(methodinfo *m, codegendata *cd, registerdata
 
        /* call the compiler passes ***********************************************/
 
-       EXTABLEN
-
        if (compileverbose)
                log_message_method("Parsing: ", m);
 
index f027d8aa2187b7c9229bce3681a7f4f673a0a045..0a67f9959261753a7eba2e9086e34de6a429acd6 100644 (file)
@@ -30,7 +30,7 @@
    Changes: Stefan Ring
             Christian Thalinger
 
-   $Id: reg.inc 1459 2004-11-05 16:23:02Z twisti $
+   $Id: reg.inc 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -88,14 +88,14 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
                }
        }
 
-       rd->argintregs = MNEW(s4, rd->intreg_argnum);
-       rd->tmpintregs = MNEW(s4, rd->tmpintregcnt);
-       rd->savintregs = MNEW(s4, rd->savintregcnt);
-       rd->freeargintregs = MNEW(s4, rd->intreg_argnum);
-       rd->freetmpintregs = MNEW(s4, rd->tmpintregcnt);
-       rd->freesavintregs = MNEW(s4, rd->savintregcnt);
+       rd->argintregs = DMNEW(s4, rd->intreg_argnum);
+       rd->tmpintregs = DMNEW(s4, rd->tmpintregcnt);
+       rd->savintregs = DMNEW(s4, rd->savintregcnt);
+       rd->freeargintregs = DMNEW(s4, rd->intreg_argnum);
+       rd->freetmpintregs = DMNEW(s4, rd->tmpintregcnt);
+       rd->freesavintregs = DMNEW(s4, rd->savintregcnt);
 #ifdef USETWOREGS
-       rd->secondregs = MNEW(s4, rd->intregsnum);
+       rd->secondregs = DMNEW(s4, rd->intregsnum);
 #endif
 
        rd->intreg_argnum = 0;
@@ -168,12 +168,12 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
                }
        }
 
-       rd->argfltregs = MNEW(s4, rd->fltreg_argnum);
-       rd->tmpfltregs = MNEW(s4, rd->tmpfltregcnt);
-       rd->savfltregs = MNEW(s4, rd->savfltregcnt);
-       rd->freeargfltregs = MNEW(s4, rd->fltreg_argnum);
-       rd->freetmpfltregs = MNEW(s4, rd->tmpfltregcnt);
-       rd->freesavfltregs = MNEW(s4, rd->savfltregcnt);
+       rd->argfltregs = DMNEW(s4, rd->fltreg_argnum);
+       rd->tmpfltregs = DMNEW(s4, rd->tmpfltregcnt);
+       rd->savfltregs = DMNEW(s4, rd->savfltregcnt);
+       rd->freeargfltregs = DMNEW(s4, rd->fltreg_argnum);
+       rd->freetmpfltregs = DMNEW(s4, rd->tmpfltregcnt);
+       rd->freesavfltregs = DMNEW(s4, rd->savfltregcnt);
 
        rd->fltreg_argnum = 0;
        rd->argfltreguse = 0;
@@ -199,9 +199,9 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
        }
 
 
-       rd->freemem    = MNEW(s4, id->cummaxstack);
-       rd->locals     = MNEW(varinfo5, id->cumlocals);
-       rd->interfaces = MNEW(varinfo5, id->cummaxstack);
+       rd->freemem    = DMNEW(s4, id->cummaxstack);
+       rd->locals     = DMNEW(varinfo5, id->cumlocals);
+       rd->interfaces = DMNEW(varinfo5, id->cummaxstack);
 
        for (v = rd->locals, i = id->cumlocals; i > 0; v++, i--) {
                v[0][TYPE_INT].type = -1;
@@ -234,27 +234,7 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id)
 
 void reg_free(methodinfo *m, registerdata *rd)
 {
-       if (rd->argintregs) MFREE(rd->argintregs, s4, rd->intreg_argnum);
-       if (rd->argfltregs) MFREE(rd->argfltregs, s4, rd->fltreg_argnum);
-       if (rd->tmpintregs) MFREE(rd->tmpintregs, s4, rd->tmpintregcnt);
-       if (rd->savintregs) MFREE(rd->savintregs, s4, rd->savintregcnt);
-       if (rd->tmpfltregs) MFREE(rd->tmpfltregs, s4, rd->tmpfltregcnt);
-       if (rd->savfltregs) MFREE(rd->savfltregs, s4, rd->savfltregcnt);
-
-       if (rd->freeargintregs) MFREE(rd->freeargintregs, s4, rd->intreg_argnum);
-       if (rd->freeargfltregs) MFREE(rd->freeargfltregs, s4, rd->fltreg_argnum);
-       if (rd->freetmpintregs) MFREE(rd->freetmpintregs, s4, rd->tmpintregcnt);
-       if (rd->freesavintregs) MFREE(rd->freesavintregs, s4, rd->savintregcnt);
-       if (rd->freetmpfltregs) MFREE(rd->freetmpfltregs, s4, rd->tmpfltregcnt);
-       if (rd->freesavfltregs) MFREE(rd->freesavfltregs, s4, rd->savfltregcnt);
-
-#ifdef USETWOREGS
-       if (rd->secondregs) MFREE(rd->secondregs, s4, rd->intregsnum);
-#endif
-
-       if (rd->freemem) MFREE(rd->freemem, s4, m->maxstack);
-       if (rd->locals)  MFREE(rd->locals, varinfo5, m->maxlocals);
-       if (rd->interfaces) MFREE(rd->interfaces, varinfo5, m->maxstack);
+       /* void */
 }
 
 
index 6e098dfb029dd0e3983f6f708186daa67fd7f487..fec9ba945c5efd9aa449188eb0e94607d466e54e 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1451 2004-11-05 14:14:15Z twisti $
+   $Id: codegen.c 1466 2004-11-08 11:24:50Z twisti $
 
 */
 
@@ -79,8 +79,12 @@ int nregdescfloat[] = {
 };
 
 
-/* include independent code generation stuff -- include after register        */
-/* descriptions to avoid extern definitions                                   */
+/*******************************************************************************
+
+    include independent code generation stuff -- include after register
+    descriptions to avoid extern definitions
+
+*******************************************************************************/
 
 #include "jit/codegen.inc"
 #include "jit/reg.inc"
@@ -3723,10 +3727,14 @@ gen_method: {
 u1 *createcompilerstub(methodinfo *m)
 {
        u1 *s = CNEW(u1, COMPSTUBSIZE);     /* memory to hold the stub            */
-       codegendata *cd = NEW(codegendata);
+       codegendata *cd;
+       s4 dumpsize;
+
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
 
-       /* allocate code and data memory, with using inline stuff */
-       //codegen_setup(m, cd, NULL);
+       cd = DNEW(codegendata);
        cd->mcodeptr = s;
 
        /* code for the stub */
@@ -3739,10 +3747,9 @@ u1 *createcompilerstub(methodinfo *m)
                count_cstub_len += COMPSTUBSIZE;
 #endif
 
-       /* free code and data memory */
-       //codegen_close(m, cd);
+       /* release dump area */
 
-       FREE(cd, codegendata);
+       dump_release(dumpsize);
 
        return s;
 }
@@ -3776,11 +3783,21 @@ u1 *createnativestub(functionptr f, methodinfo *m)
 {
        u1 *s = CNEW(u1, NATIVESTUBSIZE);   /* memory to hold the stub            */
        s4 stackframesize;                  /* size of stackframe if needed       */
-       codegendata *cd = NEW(codegendata);
-       registerdata *rd = NEW(registerdata);
-       t_inlining_globals *id = NEW(t_inlining_globals);
+       codegendata *cd;
+       registerdata *rd;
+       t_inlining_globals *id;
+       s4 dumpsize;
+
+       /* mark start of dump memory area */
+
+       dumpsize = dump_size();
+
+       cd = DNEW(codegendata);
+       rd = DNEW(registerdata);
+       id = DNEW(t_inlining_globals);
 
        /* setup registers before using it */
+
        inlining_setup(m, id);
        reg_setup(m, rd, id);
 
@@ -4013,8 +4030,9 @@ u1 *createnativestub(functionptr f, methodinfo *m)
                count_nstub_len += NATIVESTUBSIZE;
 #endif
 
-       FREE(cd, codegendata);
-       FREE(rd, registerdata);
+       /* release dump area */
+
+       dump_release(dumpsize);
 
        return s;
 }