Changeset: 9e6973158978 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9e6973158978
Modified Files:
monetdb5/mal/mal_authorize.mx
monetdb5/optimizer/Makefile.ag
monetdb5/optimizer/opt_accessmode.mx
Branch: headless
Log Message:
Minor one
diffs (150 lines):
diff --git a/monetdb5/mal/mal_authorize.mx b/monetdb5/mal/mal_authorize.mx
--- a/monetdb5/mal/mal_authorize.mx
+++ b/monetdb5/mal/mal_authorize.mx
@@ -80,7 +80,7 @@
@c
/* Author(s) M.L. Kersten, F. Groffen
-/* Authorisation adminstration management
+ * Authorisation adminstration management
* Authorisation of users is a key concept in protecting the server from
* malicious and unauthorised users. This file contains a number of
* functions that administrate a set of BATs backing the authorisation tables.
diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -28,7 +28,6 @@
NOINST
SOURCES = \
optimizer.mx \
- opt_accessmode.mx \
opt_accumulators.mx \
opt_aliases.mx \
opt_cluster.mx \
diff --git a/monetdb5/optimizer/opt_accessmode.mx
b/monetdb5/optimizer/opt_accessmode.mx
deleted file mode 100644
--- a/monetdb5/optimizer/opt_accessmode.mx
+++ /dev/null
@@ -1,122 +0,0 @@
-@/
-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-July 2008 CWI.
-Copyright August 2008-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f opt_accessmode
-@a M. Kersten
-@-
-@- Access mode optimization
-The routine @sc{optimizer.accessmode()} reduces the number of read/write
-mode changes of
-variables to a minimum. Especially setting a BAT to write mode is expensive,
-because it often implies creation of a private copy first.
-
-A full implementation is delayed until really needed.
-@{
-@mal
-pattern optimizer.accessmode():str
-address OPTaccessmode;
-pattern optimizer.accessmode(mod:str, fcn:str):str
-address OPTaccessmode
-comment "Reduce the number of mode changes.";
-
-@h
-#ifndef _MAL_MODES_
-#define _MAL_MODES_
-#include "opt_prelude.h"
-#include "opt_support.h"
-
-@:exportOptimizer(accessmode)@
-
-#define OPTDEBUGaccessmode if ( optDebug & (1 <<DEBUG_OPT_ACCESSMODE) )
-
-#endif
-@-
-The implementation strategy is currently quite simple.
-We make a scan to identify all setWriteModes and see if
-they are later indeed to target of a function with side
-effects.
-We should also remember the BATs that are already been set
-writable, to avoid subsequent calls.[todo]
-In a second pass we can then remove/keep them upon need.
-@c
-#include "monetdb_config.h"
-#include "opt_accessmode.h"
-#include "mal_interpreter.h"
-
-static int
-OPTaccessmodeImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr p)
-{
- int i, j, k;
- int actions = 0;
- InstrPtr *candidate;
- int *writeable;
- int top=0;
- (void) stk;
-
- candidate= (InstrPtr*) GDKmalloc(sizeof(InstrPtr) * mb->stop);
- if ( candidate == NULL)
- return 0;
- writeable= (int*) GDKzalloc(sizeof(int) * mb->vtop);
- if ( writeable == NULL){
- GDKfree(candidate);
- return 0;
- }
-
- for(i=0; i<mb->stop; i++){
- p= getInstrPtr(mb,i);
- if( getFunctionId(p)== setWriteModeRef && getModuleId(p)==
batRef ){
- if( writeable[getArg(p,1)] ){
- writeable[getArg(p,0)]= writeable[getArg(p,1)];
- p->token= ASSIGNsymbol;
- setModuleId(p,NULL);
- setFunctionId(p,NULL);
- p->argc=2;
- } else{
- candidate[top++] = p;
- writeable[getArg(p,0)]= getArg(p,0);
- }
- } else
- if( isUpdateInstruction(p) ){
- for(j=k=0; j<top;j++)
- if( getArg(p,1) != getArg(candidate[j],0) )
- candidate[k++]= candidate[j];
- top= k;
- }
- }
- /* now remove all candidates */
- for( j=0; j<top; j++){
- p= candidate[j];
- /* turn it into an alias */
- setModuleId(p,NULL);
- setFunctionId(p,NULL);
- p->token= ASSIGNsymbol;
- p->argc= 2;
- p->fcn= NULL;
- actions++;
- }
- (void) cntxt;
- GDKfree(candidate);
- GDKfree(writeable);
- return actions;
-}
-@include optimizerWrapper.mx
-@c
-#include "opt_statistics.h"
-@:wrapOptimizer(accessmode,OPT_CHECK_ALL)@
-@}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list