[Monetdb-developers] [Monetdb-checkins] MonetDB5/src/optimizer opt_inline.mx, , 1.22, 1.23

Sjoerd Mullender sjoerd at acm.org
Mon Jul 20 16:54:40 CEST 2009


Should this be applied to the Stable branch?

Martin Kersten wrote:
> Update of /cvsroot/monetdb/MonetDB5/src/optimizer
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11631
> 
> Modified Files:
> 	opt_inline.mx 
> Log Message:
> Protect lower levels against compound inline functions as well.
> 
> 
> U opt_inline.mx
> Index: opt_inline.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/opt_inline.mx,v
> retrieving revision 1.22
> retrieving revision 1.23
> diff -u -d -r1.22 -r1.23
> --- opt_inline.mx	16 May 2009 08:54:40 -0000	1.22
> +++ opt_inline.mx	20 Jul 2009 14:37:32 -0000	1.23
> @@ -50,6 +50,21 @@
>  
>  extern int OPTinlineMultiplex(Client cntxt, MalBlkPtr mb, InstrPtr p);
>  
> +static int
> +isCorrectInline(MalBlkPtr mb){
> +	/* make sure we have a simple inline function with a singe return */
> +	InstrPtr p;
> +	int i, retseen=0;
> +
> +	for( i= 1; i < mb->stop; i++){
> +		p= getInstrPtr(mb,i);
> +		if ( p->token == RETURNsymbol || p->token == YIELDsymbol || 
> +			 p->barrier == RETURNsymbol || p->barrier == YIELDsymbol)
> +			retseen++;
> +	}
> +	return retseen == 1;
> +}
> +
>  int
>  OPTinlineImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
>  {
> @@ -85,7 +100,8 @@
>  Check if the function definition is tagged as being inlined.
>  @c
>  			if (sig->token == FUNCTIONsymbol &&
> -			    varGetProp(q->blk, getArg(sig, 0), inlineProp) != NULL) {
> +			    varGetProp(q->blk, getArg(sig, 0), inlineProp) != NULL &&
> +				isCorrectInline(q->blk) ) {
>  				(void) inlineMALblock(mb,i,q->blk);
>  				i--;
>  				actions++;
> 
> 
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize  
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Monetdb-checkins mailing list
> Monetdb-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins


-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 369 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20090720/59aa10d4/attachment.sig>


More information about the developers-list mailing list