Changeset: 6bc29d6e6578 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6bc29d6e6578 Modified Files: clients/Tests/exports.stable.out monetdb5/mal/mal.h monetdb5/mal/mal_authorize.c monetdb5/mal/mal_authorize.h monetdb5/mal/mal_builder.h monetdb5/mal/mal_function.h monetdb5/mal/mal_instruction.h monetdb5/mal/mal_module.h monetdb5/mal/mal_properties.h monetdb5/mal/mal_stack.h monetdb5/mal/mal_type.h monetdb5/modules/atoms/mtime.c monetdb5/modules/mal/Tests/remote99.mal monetdb5/modules/mal/Tests/remote99.stable.out sql/backends/monet5/embeddedclient.c.in tools/merovingian/ChangeLog tools/merovingian/ChangeLog.Jan2014 tools/merovingian/client/monetdb.1 tools/merovingian/client/monetdb.c tools/merovingian/daemon/Makefile.ag tools/merovingian/daemon/controlrunner.c tools/mserver/mserver5.c Branch: default Log Message:
Merge and fix minor issues diffs (truncated from 391 to 300 lines): diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h --- a/monetdb5/mal/mal.h +++ b/monetdb5/mal/mal.h @@ -152,5 +152,129 @@ mal_export void mal_exit(void); #define MAXPATHLEN 1024 #endif +#ifdef HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif + +/* The MAL instruction block type definitions */ +typedef int malType; +typedef str (*MALfcn) (); + +typedef struct MalProp { + bte idx; + bte op; + int var; +} *MalPropPtr, MalProp; + +typedef struct SYMDEF { + struct SYMDEF *peer; /* where to look next */ + struct SYMDEF *skip; /* skip to next different symbol */ + str name; + int kind; + struct MALBLK *def; /* the details of the MAL fcn */ +} *Symbol, SymRecord; + +typedef struct VARRECORD { + str name; /* argname or lexical value repr */ + malType type; /* internal type signature */ + int flags; /* see below, reserve some space */ + int tmpindex; /* temporary variable */ + ValRecord value; + int eolife; /* pc index when it should be garbage collected */ + int propc, maxprop; /* proc count and max number of properties */ + int prps[]; /* property array */ +} *VarPtr, VarRecord; + +typedef struct { + bit token; /* instruction type */ + bit barrier; /* flow of control modifier takes: + BARRIER, LEAVE, REDO, EXIT, CATCH, RAISE */ + bit typechk; /* type check status */ + bit gc; /* garbage control flags */ + bit polymorphic; /* complex type analysis */ + bit varargs; /* variable number of arguments */ + int recycle; /* <0 or index into recycle cache */ + int jump; /* controlflow program counter */ + MALfcn fcn; /* resolved function address */ + struct MALBLK *blk; /* resolved MAL function address */ + str modname; /* module context */ + str fcnname; /* function name */ + int argc, retc, maxarg; /* total and result argument count */ + int argv[]; /* at least a few entries */ +} *InstrPtr, InstrRecord; + +/* For performance analysis we keep track of the number of calls and + * the total time spent while executing the instruction. (See + * mal_profiler.mx) The performance structures are separately + * administered, because they are only used in limited + * curcumstances. */ +typedef struct PERF { +#ifdef HAVE_TIMES + struct tms timer; /* timing information */ +#endif + struct timeval clock; /* clock */ + lng clk; /* time when instruction started */ + lng ticks; /* micro seconds spent on last call */ + lng totalticks; /* accumulate micro seconds send on this instruction */ + int calls; /* number of calls seen */ + bit trace; /* facilitate filter-based profiling */ + lng rbytes; /* bytes read by an instruction */ + lng wbytes; /* bytes written by an instruction */ +} *ProfPtr, ProfRecord; + +typedef struct MALBLK { + str binding; /* related C-function */ + str help; /* supportive commentary */ + oid tag; /* unique block tag */ + struct MALBLK *alternative; + int vtop; /* next free slot */ + int vsize; /* size of variable arena */ + VarRecord **var; /* Variable table */ + int stop; /* next free slot */ + int ssize; /* byte size of arena */ + InstrPtr *stmt; /* Instruction location */ + int ptop; /* next free slot */ + int psize; /* byte size of arena */ + MalProp *prps; /* property table */ + int errors; /* left over errors */ + int typefixed; /* no undetermined instruction */ + int flowfixed; /* all flow instructions are fixed */ + ProfPtr profiler; + struct MALBLK *history; /* of optimizer actions */ + short keephistory; /* do we need the history at all */ + short dotfile; /* send dot file to stethoscope? */ + str marker; /* history points are marked for backtracking */ + int maxarg; /* keep track on the maximal arguments used */ + ptr replica; /* for the replicator tests */ + sht recycle; /* execution subject to recycler control */ + lng recid; /* Recycler identifier */ + lng legid; /* Octopus control */ + sht trap; /* call debugger when called */ + lng starttime; /* track when the query started, for resource management */ + lng runtime; /* average execution time of block in ticks */ + int calls; /* number of calls */ + lng optimize; /* total optimizer time */ +} *MalBlkPtr, MalBlkRecord; + +/* Variable properties */ +#define VAR_CONSTANT 1 +#define VAR_TYPEVAR 2 +#define VAR_FIXTYPE 4 +#define VAR_UDFTYPE 8 +#define VAR_CLEANUP 16 +#define VAR_INIT 32 +#define VAR_USED 64 +#define VAR_DISABLED 128 /* used for comments and scheduler */ + +/* type check status is kept around to improve type checking efficiency */ +#define TYPE_ERROR -1 +#define TYPE_UNKNOWN 0 +#define TYPE_RESOLVED 2 + +#define GARBAGECONTROL 3 + +#define VARARGS 1 /* deal with variable arguments */ +#define VARRETS 2 + #define SERVERSHUTDOWNDELAY 5 /* seconds */ #endif /* _MAL_H*/ diff --git a/monetdb5/mal/mal_builder.h b/monetdb5/mal/mal_builder.h --- a/monetdb5/mal/mal_builder.h +++ b/monetdb5/mal/mal_builder.h @@ -21,6 +21,7 @@ #define _MAL_BUILDER_ #include "mal.h" +#include "mal_instruction.h" #include "mal_function.h" #include "mal_namespace.h" diff --git a/monetdb5/mal/mal_function.h b/monetdb5/mal/mal_function.h --- a/monetdb5/mal/mal_function.h +++ b/monetdb5/mal/mal_function.h @@ -20,6 +20,7 @@ #ifndef _MAL_FCN_H #define _MAL_FCN_H +#include "mal_instruction.h" #include "mal_module.h" #include "mal_resolve.h" diff --git a/monetdb5/mal/mal_instruction.h b/monetdb5/mal/mal_instruction.h --- a/monetdb5/mal/mal_instruction.h +++ b/monetdb5/mal/mal_instruction.h @@ -39,118 +39,6 @@ #define MAXLISTING 64*1024 #define SMALLBUFSIZ 64 -typedef struct SYMDEF { - struct SYMDEF *peer; /* where to look next */ - struct SYMDEF *skip; /* skip to next different symbol */ - str name; - int kind; - struct MALBLK *def; /* the details of the MAL fcn */ -} *Symbol, SymRecord; - -typedef struct VARRECORD { - str name; /* argname or lexical value repr */ - malType type; /* internal type signature */ - int flags; /* see below, reserve some space */ - int tmpindex; /* temporary variable */ - ValRecord value; - int eolife; /* pc index when it should be garbage collected */ - int propc, maxprop; /* proc count and max number of properties */ - int prps[]; /* property array */ -} *VarPtr, VarRecord; - -/* Variable properties */ -#define VAR_CONSTANT 1 -#define VAR_TYPEVAR 2 -#define VAR_FIXTYPE 4 -#define VAR_UDFTYPE 8 -#define VAR_CLEANUP 16 -#define VAR_INIT 32 -#define VAR_USED 64 -#define VAR_DISABLED 128 /* used for comments and scheduler */ - -/* type check status is kept around to improve type checking efficiency */ -#define TYPE_ERROR -1 -#define TYPE_UNKNOWN 0 -#define TYPE_RESOLVED 2 - -#define GARBAGECONTROL 3 - -#define VARARGS 1 /* deal with variable arguments */ -#define VARRETS 2 - -/* all functions return a string */ - -typedef struct { - bit token; /* instruction type */ - bit barrier; /* flow of control modifier takes: - BARRIER, LEAVE, REDO, EXIT, CATCH, RAISE */ - bit typechk; /* type check status */ - bit gc; /* garbage control flags */ - bit polymorphic; /* complex type analysis */ - bit varargs; /* variable number of arguments */ - int recycle; /* <0 or index into recycle cache */ - int jump; /* controlflow program counter */ - MALfcn fcn; /* resolved function address */ - struct MALBLK *blk; /* resolved MAL function address */ - str modname; /* module context */ - str fcnname; /* function name */ - int argc, retc, maxarg; /* total and result argument count */ - int argv[]; /* at least a few entries */ -} *InstrPtr, InstrRecord; - -/* For performance analysis we keep track of the number of calls and - * the total time spent while executing the instruction. (See - * mal_profiler.mx) The performance structures are separately - * administered, because they are only used in limited - * curcumstances. */ -typedef struct PERF { -#ifdef HAVE_TIMES - struct tms timer; /* timing information */ -#endif - struct timeval clock; /* clock */ - lng clk; /* time when instruction started */ - lng ticks; /* micro seconds spent on last call */ - lng totalticks; /* accumulate micro seconds send on this instruction */ - int calls; /* number of calls seen */ - bit trace; /* facilitate filter-based profiling */ - lng rbytes; /* bytes read by an instruction */ - lng wbytes; /* bytes written by an instruction */ -} *ProfPtr, ProfRecord; - -typedef struct MALBLK { - str binding; /* related C-function */ - str help; /* supportive commentary */ - oid tag; /* unique block tag */ - struct MALBLK *alternative; - int vtop; /* next free slot */ - int vsize; /* size of variable arena */ - VarRecord **var; /* Variable table */ - int stop; /* next free slot */ - int ssize; /* byte size of arena */ - InstrPtr *stmt; /* Instruction location */ - int ptop; /* next free slot */ - int psize; /* byte size of arena */ - MalProp *prps; /* property table */ - int errors; /* left over errors */ - int typefixed; /* no undetermined instruction */ - int flowfixed; /* all flow instructions are fixed */ - ProfPtr profiler; - struct MALBLK *history; /* of optimizer actions */ - short keephistory; /* do we need the history at all */ - short dotfile; /* send dot file to stethoscope? */ - str marker; /* history points are marked for backtracking */ - int maxarg; /* keep track on the maximal arguments used */ - ptr replica; /* for the replicator tests */ - sht recycle; /* execution subject to recycler control */ - lng recid; /* Recycler identifier */ - lng legid; /* Octopus control */ - sht trap; /* call debugger when called */ - lng starttime; /* track when the query started, for resource management */ - lng runtime; /* average execution time of block in ticks */ - int calls; /* number of calls */ - lng optimize; /* total optimizer time */ -} *MalBlkPtr, MalBlkRecord; - /* Allocation of space assumes a rather exotic number of * arguments. Access to module and function name are cast in macros to * prepare for separate name space management. */ diff --git a/monetdb5/mal/mal_module.h b/monetdb5/mal/mal_module.h --- a/monetdb5/mal/mal_module.h +++ b/monetdb5/mal/mal_module.h @@ -19,7 +19,6 @@ #ifndef _MAL_SCOPE_H_ #define _MAL_SCOPE_H_ -#include "mal_box.h" #include "mal_xml.h" /* #define MAL_SCOPE_DEBUG */ @@ -32,7 +31,6 @@ typedef struct SCOPEDEF { str name; /* index in namespace */ int inheritance; /* set when it plays a role in inheritance */ Symbol *subscope; /* type dispatcher table */ - Box box; /* module related objects */ int isAtomModule; /* atom module definition ? */ void *dll; /* dlopen handle */ str help; /* short description of module functionality*/ diff --git a/monetdb5/mal/mal_properties.h b/monetdb5/mal/mal_properties.h --- a/monetdb5/mal/mal_properties.h +++ b/monetdb5/mal/mal_properties.h @@ -22,12 +22,6 @@ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list