Changeset: 456afbaaf416 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=456afbaaf416
Modified Files:
        
Branch: Jun2010
Log Message:

Revert the changes of May 04 to recover performance.
(transplanted from e9c1206c500887dfb0d14813b855a9ddeb53081a)


diffs (76 lines):

diff -r 1fa658ec4c7b -r 456afbaaf416 MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx       Sat May 08 09:14:16 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx       Sat May 08 20:30:23 2010 +0200
@@ -341,7 +341,7 @@
 
        /* pass the new debug mode to the caller */
        if (stk->cmd  && env && stk->cmd!='f') env->cmd = stk->cmd; 
-       if ( garbageControl(getInstrPtr(mb,0)) )
+       if ( !stk->keepAlive && garbageControl(getInstrPtr(mb,0)) )
                garbageCollector(cntxt, mb,stk, env != stk);
        @:endProfile(stk)@
        return ret;
@@ -361,15 +361,19 @@
        MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller)
 {
        str ret;
+       int keepAlive;
 
        if (stk == NULL)
                throw(MAL, "mal.interpreter", MAL_STACK_FAIL);
+       keepAlive = stk->keepAlive;
        if(env && stk && stk->cmd!='f') stk->cmd = env->cmd ;
 
        ret = runMALsequence(cntxt, mb, startpc,  stoppc, stk, env, pcicaller);
 
        /* pass the new debug mode to the caller */
        if (env && stk->cmd!='f') env->cmd = stk->cmd;
+       if ( keepAlive == 0 && garbageControl(getInstrPtr(mb,0)) )
+               garbageCollector(cntxt, mb,stk,env!=stk);
        return ret;
 }
 @-
@@ -1336,7 +1340,6 @@
 {   
        DataFlow flow = NULL;
        str ret = MAL_SUCCEED;
-       int keepalive;
 
 #ifdef DEBUG_FLOW
        stream_printf(GDKstdout, "runMALdataflow for block %d - %d\n", 
startpc,stoppc);
@@ -1387,9 +1390,6 @@
        flow->stop = stoppc;
        flow->mb = mb;
        flow->stk = stk;
-       /* avoid the garbage collection call at the end of interpreter loop */
-       keepalive = flow->stk->keepAlive;
-       flow->stk->keepAlive= TRUE;
 
        flow->status = (char*) GDKzalloc((stoppc-startpc+1));
        flow->blocked = (char*) GDKzalloc(sizeof(char)*mb->vtop);
@@ -1397,7 +1397,6 @@
        mal_unset_lock(mal_contextLock, "runMALdataflow");
 
        ret = DFLOWscheduler(flow);
-       flow->stk->keepAlive= keepalive;
        GDKfree(flow->status);
        GDKfree(flow->blocked);
        GDKfree(flow->inuse);
@@ -1764,7 +1763,7 @@
                        sbackup[i]= 0;  
                        backup[i]= 0;  
                        garbage[i]= -1;  
-                       if (stk->stk[getArg(pci,i)].vtype == TYPE_bat && 
getEndOfLife(mb,getArg(pci,i)) == stkpc && isNotUsedIn(pci,i+1,getArg(pci,i)) 
&& stk->keepAlive == 0){
+                       if (stk->stk[getArg(pci,i)].vtype == TYPE_bat && 
getEndOfLife(mb,getArg(pci,i)) == stkpc && isNotUsedIn(pci,i+1,getArg(pci,i)) ){
                                garbage[i]= getArg(pci,i);
 #ifdef DEBUG_GC
                                stream_printf(GDKstdout,"GC %d %s 
prep\n",getArg(pci,i), getArgName(mb,pci,i));
@@ -2345,8 +2344,6 @@
        int k;
        ValPtr v;
 
-       if ( stk->keepAlive)
-               return;
 #ifdef STACKTRACE
        stream_printf(cntxt->fdout,"#--->stack before garbage collector\n");
        printStack(cntxt->fdout,mb,stk,0);
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to