Update of /cvsroot/monetdb/MonetDB5/src/optimizer
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2062/optimizer
Modified Files:
Makefile.ag
Added Files:
opt_recycler.mx
Log Message:
This is a test checkin for the compilers
It introduces the third recycle framework, which hooks into the
interpreter directly without spelling out the signatures.
The marking of the instructions (actually the variables) should be
done still.
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/Makefile.ag,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- Makefile.ag 30 Jan 2008 13:07:08 -0000 1.54
+++ Makefile.ag 1 Mar 2008 22:52:36 -0000 1.55
@@ -33,7 +33,7 @@
opt_remoteQueries.mx opt_joinselect.mx opt_partitions.mx \
opt_evaluate.mx opt_inline.mx opt_pushranges.mx \
opt_accessmode.mx opt_joinpath.mx opt_heuristics.mx
opt_remap.mx \
- opt_statistics.mx opt_trace.mx opt_replicator.mx
+ opt_statistics.mx opt_trace.mx opt_recycler.mx
opt_replicator.mx
#SCRIPTS = mal
LIBS = ../mal/libmal ../modules/mal/lib_bpm
../modules/kernel/lib_algebra $(MONETDB_LIBS) -lbat -lstream $(MATH_LIBS) \
@@ -53,7 +53,7 @@
opt_remoteQueries.mx opt_joinselect.mx opt_partitions.mx \
opt_evaluate.mx opt_inline.mx opt_pushranges.mx \
opt_accessmode.mx opt_joinpath.mx opt_heuristics.mx
opt_remap.mx \
- opt_statistics.mx opt_trace.mx opt_replicator.mx
+ opt_statistics.mx opt_trace.mx opt_recycler.mx
opt_replicator.mx
HEADERS = h
}
@@ -71,7 +71,7 @@
opt_remoteQueries.mx opt_joinselect.mx opt_partitions.mx \
opt_evaluate.mx opt_inline.mx opt_pushranges.mx \
opt_accessmode.mx opt_joinpath.mx opt_heuristics.mx
opt_remap.mx \
- opt_statistics.mx opt_trace.mx opt_replicator.mx
+ opt_statistics.mx opt_trace.mx opt_recycler.mx
opt_replicator.mx
}
EXTRA_DIST_DIR = Tests
--- NEW FILE: opt_recycler.mx ---
@' The contents of this file are subject to the MonetDB Public License
@' Version 1.1 (the "License"); you may not use this file except in
@' compliance with the License. You may obtain a copy of the License at
@' http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
@'
@' Software distributed under the License is distributed on an "AS IS"
@' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
@' License for the specific language governing rights and limitations
@' under the License.
@'
@' The Original Code is the MonetDB Database System.
@'
@' The Initial Developer of the Original Code is CWI.
@' Portions created by CWI are Copyright (C) 1997-2008 CWI.
@' All Rights Reserved.
@f opt_recycler
@- The recycler
The recycler optimizer marks the variables subject to recycling control.
@{
@mal
pattern optimizer.recycler():str
address OPTrecycler;
pattern optimizer.recycler(mod:str, fcn:str):str
address OPTrecycler
comment "Replicator code injection";
@-
The number of overloaded instructions is kept to a minimum.
@h
#ifndef _OPT_RECYCLER_
#define _OPT_RECYCLER_
#include "opt_prelude.h"
#include "opt_support.h"
#define DEBUG_OPT_RECYCLER
@-
The variables are all checked for being eligible as a variable
subject to recycling control. A variable my only be assigned
a value once. The function is an sql.bind() or all arguments
are already recycle enabled or constant.
@c
#include "mal_config.h"
#include "opt_recycler.h"
#include "mal_instruction.h"
static int
OPTrecyclerImplementation(MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
{
int i, j, cnt, actions=0;
Lifespan span= newLifespan(mb);
(void) stk;
/* vars bound to replicator commands */
setLifespan(mb,span);
for (i = 0; i<mb->vtop; i++)
if( !isVarRecycled(mb,i)){
p= getInstrPtr(mb,i);
if( (getModuleId(p)== sqlRef && getFunctionId(p)==bindRef) ){
setVarRecycled(mb, getArg(p,0));
actions++;
} else {
cnt= 0;
for( j=p->retc; j<p->argc; j++)
if( isVarRecycled(mb, getArg(p,j)) ||
isVarConstant(mb, getArg(p,j)) )
cnt++;
if( cnt == p->argc-p->retc){
actions ++;
for( j= 0; j < p->retc; j++)
if( getLastUpdate(span, getArg(p,j)) == i ){
setVarRecycled(mb, getArg(p,j));
#ifdef DEBUG_OPT_RECYCLER
stream_printf(GDKout,"recyle
%d\n",getArg(p,j));
#endif
}
}
}
}
GDKfree(span);
return actions;
}
@include optimizerWrapper.mx
@h
@:exportOptimizer(recycler)@
#endif
@c
#include "opt_statistics.h"
@:wrapOptimizer(recycler,OPT_CHECK_ALL)@
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins