Changeset: f3e78730a824 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f3e78730a824
Modified Files:
monetdb5/mal/mal_instruction.c
monetdb5/optimizer/opt_inline.c
Branch: default
Log Message:
don't recusively call opt-inline
diffs (87 lines):
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -623,7 +623,7 @@ findVariableLength(MalBlkPtr mb, const c
int i;
for (i = mb->vtop - 1; i >= 0; i--) {
- const char *s = mb->var[i].name;
+ const char *s = mb->var[i].name;
if (s && strncmp(name, s, len) == 0 && s[len] == 0)
return i;
@@ -780,7 +780,7 @@ getVarName(MalBlkPtr mb, int idx)
char *s = mb->var[idx].name;
if( getVarKind(mb,idx) == 0)
setVarKind(mb,idx, REFMARKER);
-
+
if( *s && s[1] != '_' && (s[0] != 'X' && s[0] != 'C'))
return s;
if ( *s == 0)
@@ -798,16 +798,18 @@ newVariable(MalBlkPtr mb, const char *na
mb->errors = createMalException(mb,0,TYPE, "newVariable: id too
long");
return -1;
}
- if (makeVarSpace(mb))
+ if (makeVarSpace(mb)) {
+ assert(0);
/* no space for a new variable */
return -1;
+ }
n = mb->vtop;
if( name == 0 || len == 0){
mb->var[n].name[0] = 0;
} else {
/* avoid calling strcpy_len since we're not interested in the
* source length, and that may be very large */
- char *nme = mb->var[n].name;
+ char *nme = mb->var[n].name;
for (size_t i = 0; i < len; i++)
nme[i] = name[i];
nme[len] = 0;
diff --git a/monetdb5/optimizer/opt_inline.c b/monetdb5/optimizer/opt_inline.c
--- a/monetdb5/optimizer/opt_inline.c
+++ b/monetdb5/optimizer/opt_inline.c
@@ -25,28 +25,16 @@ isCorrectInline(MalBlkPtr mb){
}
-static bool OPTinlineMultiplex(Client cntxt, MalBlkPtr mb, InstrPtr p){
+static bool
+OPTinlineMultiplex(MalBlkPtr mb, InstrPtr p)
+{
Symbol s;
str mod,fcn;
mod = VALget(&getVar(mb, getArg(p, p->retc+0))->value);
fcn = VALget(&getVar(mb, getArg(p, p->retc+1))->value);
- //if( (s= findSymbol(cntxt->usermodule, mod,fcn)) ==0 )
- if( (s= findSymbolInModule(getModule(putName(mod)), putName(fcn))) ==0 )
- return false;
- if (s->def == mb) /* avoid infinite recursion */
+ if ((s = findSymbolInModule(getModule(putName(mod)), putName(fcn))) ==
0)
return false;
- /*
- * Before we decide to propagate the inline request
- * to the multiplex operation, we check some basic properties
- * of the target function. Moreover, we apply the inline optimizer
- * to the target function as well.
- * This code should be protected against overflow due to recursive
calls.
- * In general, this is a hard problem. For now, we just expand.
- */
- MT_lock_set(&mal_contextLock);
- (void) OPTinlineImplementation(cntxt, s->def, NULL, p);
- MT_lock_unset(&mal_contextLock);
return s->def->inlineProp;
}
@@ -73,7 +61,7 @@ OPTinlineImplementation(Client cntxt, Ma
* They are produced by SQL compiler.
*/
if (isMultiplex(q)) {
- OPTinlineMultiplex(cntxt,mb,q);
+ OPTinlineMultiplex(mb,q);
} else
/*
* Check if the function definition is tagged as being
inlined.
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list