From 8f7d05be6d40f30f1ec62a4069aa93d6d4514f38 Mon Sep 17 00:00:00 2001 From: Vladimir Shabanov Date: Wed, 12 Sep 2012 19:49:02 +0400 Subject: Fixed HTTP date format and added Cache-Control to app.js --- src/cjr_print.sml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cjr_print.sml b/src/cjr_print.sml index c1198ccf..33980f69 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -3239,7 +3239,7 @@ fun p_file env (ds, ps) = val now = Time.now () val nowD = Date.fromTimeUniv now - val rfcFmt = "%a, %d %b %Y %H:%M:%S" + val rfcFmt = "%a, %d %b %Y %H:%M:%S GMT" in box [string "#include \"", string (OS.Path.joinDirFile {dir = !Settings.configInclude, @@ -3430,6 +3430,8 @@ fun p_file env (ds, ps) = newline, string ("uw_write_header(ctx, \"Last-modified: " ^ Date.fmt rfcFmt nowD ^ "\\r\\n\");"), newline, + string ("uw_write_header(ctx, \"Cache-Control: max-age=31536000, public\\r\\n\");"), + newline, string "uw_write(ctx, jslib);", newline, string "return;", -- cgit v1.2.3 From 22850e38ea15f120eb415b5e17a034cc74c995a8 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 14 Sep 2012 07:35:48 -0400 Subject: Reduce default inlining thresholds; improve a let-substitution optimization to compensate --- src/mono_reduce.sml | 30 ++++++++++++++++++++++++------ src/settings.sml | 4 ++-- 2 files changed, 26 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml index af61489c..c633bfce 100644 --- a/src/mono_reduce.sml +++ b/src/mono_reduce.sml @@ -313,10 +313,28 @@ fun reduce file = val (timpures, impures, absCounts) = foldl (fn ((d, _), (timpures, impures, absCounts)) => let - fun countAbs (e, _) = - case e of - EAbs (_, _, _, e) => 1 + countAbs e - | _ => 0 + fun countAbs env e = + case #1 e of + EAbs (x, t, _, e) => 1 + countAbs (E.pushERel env x t NONE) e + | _ => + let + fun remaining e = + case #1 e of + ENamed n => IM.find (absCounts, n) + | EApp (e, arg) => + if simpleImpure (timpures, impures) env arg then + NONE + else + (case remaining e of + NONE => NONE + | SOME n => if n > 0 then + SOME (n - 1) + else + NONE) + | _ => NONE + in + getOpt (remaining e, 0) + end in case d of DDatatype dts => @@ -335,7 +353,7 @@ fun reduce file = IS.add (impures, n) else impures, - IM.insert (absCounts, n, countAbs e)) + IM.insert (absCounts, n, countAbs E.empty e)) | DValRec vis => (timpures, if List.exists (fn (_, _, _, e, _) => simpleImpure (timpures, impures) E.empty e) vis then @@ -344,7 +362,7 @@ fun reduce file = else impures, foldl (fn ((x, n, _, e, _), absCounts) => - IM.insert (absCounts, n, countAbs e)) + IM.insert (absCounts, n, countAbs E.empty e)) absCounts vis) | _ => (timpures, impures, absCounts) end) diff --git a/src/settings.sml b/src/settings.sml index 45e8640a..6839d39e 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -615,11 +615,11 @@ val sql = ref (NONE : string option) fun setSql so = sql := so fun getSql () = !sql -val coreInline = ref 20 +val coreInline = ref 5 fun setCoreInline n = coreInline := n fun getCoreInline () = !coreInline -val monoInline = ref 100 +val monoInline = ref 5 fun setMonoInline n = monoInline := n fun getMonoInline () = !monoInline -- cgit v1.2.3 From bd53c29db79488b2485427ebf3fa5ea5ed0df306 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 16 Sep 2012 08:31:54 -0400 Subject: Better error message about signals remaining in server-side code --- src/cjrize.sml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cjrize.sml b/src/cjrize.sml index a0ec2ece..9e41fda4 100644 --- a/src/cjrize.sml +++ b/src/cjrize.sml @@ -162,7 +162,9 @@ fun cifyTyp x = ((L'.TList (t', si), loc), sm) end | L.TSource => ((L'.TFfi ("Basis", "source"), loc), sm) - | L.TSignal _ => raise Fail "Cjrize: TSignal remains" + | L.TSignal _ => (ErrorMsg.errorAt loc "TSignal remains"; + Print.epreface ("Full type", MonoPrint.p_typ MonoEnv.empty (#1 x)); + ((L'.TFfi ("Basis", "bogus"), loc), sm)) in cify IM.empty x end -- cgit v1.2.3