Re: [Monetdb-developers] [Monetdb-checkins] MonetDB5/src/optimizer opt_inline.mx, , 1.22, 1.23
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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
-- Sjoerd Mullender
participants (1)
-
Sjoerd Mullender