changeset 1984:819756825c8d

Merge in upstream
author Patrick Hurst <phurst@mit.edu>
date Fri, 14 Feb 2014 04:00:03 -0500
parents 0ff4f64b4309 fca98a6cbe23
children 5195378deeca
files demo/more/orm1.ur src/c/urweb.c
diffstat 8 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/demo/more/orm1.ur	Wed Jan 29 18:29:43 2014 -0500
+++ b/demo/more/orm1.ur	Fri Feb 14 04:00:03 2014 -0500
@@ -40,7 +40,7 @@
                                                       | Some r => <xml>{[r.B]}</xml>}
       </li></xml>) lsS}
     </body></xml>
-    
+
 fun main () = return <xml><body>
   <form><submit action={action}/></form>
 </body></xml>
--- a/doc/manual.tex	Wed Jan 29 18:29:43 2014 -0500
+++ b/doc/manual.tex	Fri Feb 14 04:00:03 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.
--- a/src/c/Makefile.am	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/c/Makefile.am	Fri Feb 14 04:00:03 2014 -0500
@@ -7,7 +7,7 @@
 liburweb_static_la_SOURCES = static.c
 
 AM_CPPFLAGS = -I$(srcdir)/../../include/urweb $(OPENSSL_INCLUDES)
-AM_CFLAGS = -Wimplicit -Wall -Werror -Wno-format-security -Wno-deprecated-declarations $(PTHREAD_CFLAGS)
+AM_CFLAGS = -Wimplicit -Wall -Werror -Wno-format-security -Wno-deprecated-declarations -U_FORTIFY_SOURCE $(PTHREAD_CFLAGS)
 liburweb_la_LDFLAGS = $(AM_LDFLAGS) $(OPENSSL_LDFLAGS)
 liburweb_la_LIBADD = $(PTHREAD_LIBS) -lm $(OPENSSL_LIBS)
 liburweb_http_la_LIBADD = liburweb.la
--- a/src/c/urweb.c	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/c/urweb.c	Fri Feb 14 04:00:03 2014 -0500
@@ -3933,7 +3933,7 @@
 uw_Basis_time uw_Basis_fromDatetime(uw_context ctx, uw_Basis_int year, uw_Basis_int month, uw_Basis_int day, uw_Basis_int hour, uw_Basis_int minute, uw_Basis_int second) {
   struct tm tm = { .tm_year = year - 1900, .tm_mon = month, .tm_mday = day,
                    .tm_hour = hour, .tm_min = minute, .tm_sec = second };
-  uw_Basis_time r = { timegm(&tm) };
+  uw_Basis_time r = { timelocal(&tm) };
   return r;
 }
 
--- a/src/compiler.sml	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/compiler.sml	Fri Feb 14 04:00:03 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
--- a/src/mono_reduce.sml	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/mono_reduce.sml	Fri Feb 14 04:00:03 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
--- a/src/settings.sig	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/settings.sig	Fri Feb 14 04:00:03 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
 
--- a/src/settings.sml	Wed Jan 29 18:29:43 2014 -0500
+++ b/src/settings.sml	Fri Feb 14 04:00:03 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)