# HG changeset patch # User Adam Chlipala # Date 1391992176 18000 # Node ID b15a4c2cb542d36ef3bdaa99c6192755c9a79e1f # Parent fec7beec96c7c70879ebed05a73a8ce623801f89 neverInline diff -r fec7beec96c7 -r b15a4c2cb542 doc/manual.tex --- a/doc/manual.tex Sun Jan 19 14:31:55 2014 -0500 +++ b/doc/manual.tex Sun Feb 09 19:29:36 2014 -0500 @@ -171,6 +171,7 @@ \item \texttt{linker CMD} sets \texttt{CMD} as the command line prefix to use for linking C object files. The command line will be completed with a space-separated list of \texttt{.o} and \texttt{.a} files, \texttt{-L} and \texttt{-l} flags, and finally with a \texttt{-o} flag to set the location where the executable should be written. \item \texttt{minHeap NUMBYTES} sets the initial size for thread-local heaps used in handling requests. These heaps grow automatically as needed (up to any maximum set with \texttt{limit}), but each regrow requires restarting the request handling process. \item \texttt{monoInline TREESIZE} sets how many nodes the AST of a function definition may have before the optimizer stops trying hard to inline calls to that function. (This is one of two options for one of two intermediate languages within the compiler.) +\item \texttt{neverInline PATH} requests that no call to the referenced function be inlined. Section \ref{structure} explains how functions are assigned path strings. \item \texttt{noMangleSql} avoids adding a \texttt{uw\_} prefix in front of each identifier in SQL. With this experimental feature, the burden is on the programmer to avoid naming tables or columns after SQL keywords! \item \texttt{noXsrfProtection URIPREFIX} turns off automatic cross-site request forgery protection for the page handler identified by the given URI prefix. This will avoid checking cryptographic signatures on cookies, which is generally a reasonable idea for some pages, such as login pages that are going to discard all old cookie values, anyway. \item \texttt{onError Module.var} changes the handling of fatal application errors. Instead of displaying a default, ugly error 500 page, the error page will be generated by calling function \texttt{Module.var} on a piece of XML representing the error message. The error handler should have type $\mt{xbody} \to \mt{transaction} \; \mt{page}$. Note that the error handler \emph{cannot} be in the application's main module, since that would register it as explicitly callable via URLs. diff -r fec7beec96c7 -r b15a4c2cb542 src/compiler.sml --- a/src/compiler.sml Sun Jan 19 14:31:55 2014 -0500 +++ b/src/compiler.sml Sun Feb 09 19:29:36 2014 -0500 @@ -869,6 +869,7 @@ NONE => ErrorMsg.error ("invalid mono inline level '" ^ arg ^ "'") | SOME n => Settings.setMonoInline n) | "alwaysInline" => Settings.addAlwaysInline arg + | "neverInline" => Settings.addNeverInline arg | "noXsrfProtection" => Settings.addNoXsrfProtection arg | "timeFormat" => Settings.setTimeFormat arg | "noMangleSql" => Settings.setMangleSql false diff -r fec7beec96c7 -r b15a4c2cb542 src/mono_reduce.sml --- a/src/mono_reduce.sml Sun Jan 19 14:31:55 2014 -0500 +++ b/src/mono_reduce.sml Sun Feb 09 19:29:36 2014 -0500 @@ -395,10 +395,11 @@ fun mayInline (n, e, t, s) = case IM.find (uses, n) of NONE => false - | SOME count => count <= 1 - orelse size e <= Settings.getMonoInline () - orelse functionInside t - orelse Settings.checkAlwaysInline s + | SOME count => not (Settings.checkNeverInline s) + andalso (count <= 1 + orelse size e <= Settings.getMonoInline () + orelse functionInside t + orelse Settings.checkAlwaysInline s) fun summarize d (e, _) = let diff -r fec7beec96c7 -r b15a4c2cb542 src/settings.sig --- a/src/settings.sig Sun Jan 19 14:31:55 2014 -0500 +++ b/src/settings.sig Sun Feb 09 19:29:36 2014 -0500 @@ -252,6 +252,9 @@ val addAlwaysInline : string -> unit val checkAlwaysInline : string -> bool + val addNeverInline : string -> unit + val checkNeverInline : string -> bool + val addNoXsrfProtection : string -> unit val checkNoXsrfProtection : string -> bool diff -r fec7beec96c7 -r b15a4c2cb542 src/settings.sml --- a/src/settings.sml Sun Jan 19 14:31:55 2014 -0500 +++ b/src/settings.sml Sun Feb 09 19:29:36 2014 -0500 @@ -688,6 +688,10 @@ fun addAlwaysInline s = alwaysInline := SS.add (!alwaysInline, s) fun checkAlwaysInline s = SS.member (!alwaysInline, s) +val neverInline = ref SS.empty +fun addNeverInline s = neverInline := SS.add (!neverInline, s) +fun checkNeverInline s = SS.member (!neverInline, s) + val noXsrfProtection = ref SS.empty fun addNoXsrfProtection s = noXsrfProtection := SS.add (!noXsrfProtection, s) fun checkNoXsrfProtection s = SS.member (!noXsrfProtection, s)