Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9072/src/mal
Modified Files:
mal_builder.mx mal_instruction.mx mal_interpreter.mx
mal_resolve.mx
Log Message:
mal_resolve: cleaned up prepost macro
as bats could also be a constant we no longer handel the (incorrectly)
seperate
mal_*/opt_*: ATOMcmp should use GDK types (not mal types)
opt_deadcode: fixed leak
opt_macro/opt_remap: fixed the multiplex push down, ie we can now inline
multiplex calls
approved some output mostly because of the reintroduced nil values for
return values of inlined functions.
Index: mal_builder.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_builder.mx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- mal_builder.mx 2 Jan 2008 08:18:51 -0000 1.31
+++ mal_builder.mx 7 Jan 2008 21:44:44 -0000 1.32
@@ -306,6 +306,7 @@
cst.vtype = TYPE_bat;
cst.val.bval = 0;
_t = defConstant(mb,TYPE_bat,&cst);
+ mb->var[_t]->type = tpe;
}
return pushArgument(mb, q, _t);
}
Index: mal_interpreter.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_interpreter.mx,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- mal_interpreter.mx 2 Jan 2008 08:18:51 -0000 1.206
+++ mal_interpreter.mx 7 Jan 2008 21:44:45 -0000 1.207
@@ -176,7 +176,7 @@
{
BAT *b;
- if( BBP_lrefs(bid)==1 ){
+ if (BBP_lrefs(bid) == 1){
b= BATdescriptor(bid);
if( b==0) return;
/* count it once ! */
Index: mal_instruction.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_instruction.mx,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -d -r1.294 -r1.295
--- mal_instruction.mx 4 Jan 2008 18:08:46 -0000 1.294
+++ mal_instruction.mx 7 Jan 2008 21:44:44 -0000 1.295
@@ -467,6 +467,7 @@
#define setArg(P,I,R) (P)->argv[I]= R
#define getArgName(M,P,I) getVarName((M),(P)->argv[I])
#define getArgType(M,P,I) getVarType((M),(P)->argv[I])
+#define getArgGDKType(M,P,I) getVarGDKType((M),(P)->argv[I])
mal_export InstrPtr newInstruction(MalBlkPtr mb, int kind);
mal_export InstrPtr copyInstruction(InstrPtr p);
@@ -1835,6 +1836,7 @@
k = newTmpVariable(mb, type);
setVarConstant(mb, k);
setVarFixed(mb, k);
+ clrVarCleanup(mb, k);
vr = &getVarConstant(mb, k);
*vr = *cst;
return k;
@@ -2557,23 +2559,11 @@
Dump the type and value information.
@c
advance(t);
- if (!isTmpVar(mb, getArg(p, i)) && idcmp("bat", getArgName(mb,
p, i)) == 0) {
- str hprop = 0, tprop = 0;
- str d1 = getTypeName(getHeadType(getArgType(mb, p, i)));
- str d2 = getTypeName(getTailType(getArgType(mb, p, i)));
-
- sprintf(t, ":bat[:%s%s,:%s%s]", d1, hprop, d2, tprop);
- GDKfree(d1);
- GDKfree(d2);
- advance(t);
- } else if ( isVarTypedef(mb, getArg(p, i)) ||
- ( isVarConstant(mb, getArg(p, i)) &&
- ( isVarUDFtype(mb, getArg(p, i)) ||
- ATOMcmp(getArgType(mb,p,i),
-
ATOMnilptr(getArgType(mb,p,i)),
- VALptr(&getVar(mb,
getArg(p, i))->value) ) == 0
-
- ) )) {
+ if (isVarTypedef(mb, getArg(p, i)) ||
+ (isVarConstant(mb, getArg(p, i)) &&
+ !isaBatType(getArgType(mb, p, i)) &&
+ (isVarUDFtype(mb, getArg(p, i)) ||
+ ATOMcmp(getArgGDKType(mb,p,i),
ATOMnilptr(getArgType(mb,p,i)), VALptr(&getVar(mb, getArg(p, i))->value) ) ==
0))) {
char *tnme = getTypeName(getArgType(mb, p, i));
sprintf(t, ":%s", tnme);
Index: mal_resolve.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_resolve.mx,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- mal_resolve.mx 2 Jan 2008 08:18:52 -0000 1.132
+++ mal_resolve.mx 7 Jan 2008 21:44:45 -0000 1.133
@@ -460,17 +460,14 @@
Since we now know the storage type of the receiving variable, we can
set the garbagge collection flag.
@= prepostProcess
- if( findGDKtype(@1) == TYPE_bat){
- setVarCleanup(mb,getArg(p,@2));
- getInstrPtr(@3,0)->gc |= GARBAGECONTROL;
- p->gc|= QUICKCLEANUP;
- } else if (!isPolyType(@1) && @1< TYPE_any &&
- @1>=0 && ATOMstorage(@1)== TYPE_str &&
- !isVarConstant(mb,getArg(p,@2))){
+ if (!isVarConstant(mb,getArg(p,@2)) &&
+ (findGDKtype(@1) == TYPE_bat ||
+ (!isPolyType(@1) && @1< TYPE_any &&
+ @1>=0 && ATOMstorage(@1) == TYPE_str))){
getInstrPtr(@3,0)->gc |= GARBAGECONTROL;
setVarCleanup(mb,getArg(p,@2));
p->gc|= QUICKCLEANUP;
- }
+ }
@c
#ifdef DEBUG_MAL_RESOLVE
if(tracefcn) {
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins