From 8e8c217003dcda28e14b330039062d9bf8463e64 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 4 Apr 2009 12:54:39 -0400 Subject: Fix overzealous Marshalcheck; garbage-collect string-embedded closures when no dyns are active --- src/compiler.sig | 4 ++-- src/compiler.sml | 18 +++++++++--------- src/jscomp.sml | 8 ++++---- src/marshalcheck.sml | 3 ++- 4 files changed, 17 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/compiler.sig b/src/compiler.sig index d932c906..94dac67a 100644 --- a/src/compiler.sig +++ b/src/compiler.sig @@ -69,10 +69,10 @@ signature COMPILER = sig val shake : (Core.file, Core.file) phase val rpcify : (Core.file, Core.file) phase val tag : (Core.file, Core.file) phase - val marshalcheck : (Core.file, Core.file) phase val reduce : (Core.file, Core.file) phase val unpoly : (Core.file, Core.file) phase val specialize : (Core.file, Core.file) phase + val marshalcheck : (Core.file, Core.file) phase val monoize : (Core.file, Mono.file) phase val mono_opt : (Mono.file, Mono.file) phase val untangle : (Mono.file, Mono.file) phase @@ -100,11 +100,11 @@ signature COMPILER = sig val toCore_untangle2 : (string, Core.file) transform val toShake2 : (string, Core.file) transform val toTag : (string, Core.file) transform - val toMarshalcheck : (string, Core.file) transform val toReduce : (string, Core.file) transform val toUnpoly : (string, Core.file) transform val toSpecialize : (string, Core.file) transform val toShake3 : (string, Core.file) transform + val toMarshalcheck : (string, Core.file) transform val toMonoize : (string, Mono.file) transform val toMono_opt1 : (string, Mono.file) transform val toUntangle : (string, Mono.file) transform diff --git a/src/compiler.sml b/src/compiler.sml index 0eb8cb0f..6a43d94e 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -475,19 +475,12 @@ val tag = { val toTag = transform tag "tag" o toCore_untangle2 -val marshalcheck = { - func = (fn file => (MarshalCheck.check file; file)), - print = CorePrint.p_file CoreEnv.empty -} - -val toMarshalcheck = transform marshalcheck "marshalcheck" o toTag - val reduce = { func = Reduce.reduce, print = CorePrint.p_file CoreEnv.empty } -val toReduce = transform reduce "reduce" o toMarshalcheck +val toReduce = transform reduce "reduce" o toTag val unpoly = { func = Unpoly.unpoly, @@ -505,12 +498,19 @@ val toSpecialize = transform specialize "specialize" o toUnpoly val toShake3 = transform shake "shake3" o toSpecialize +val marshalcheck = { + func = (fn file => (MarshalCheck.check file; file)), + print = CorePrint.p_file CoreEnv.empty +} + +val toMarshalcheck = transform marshalcheck "marshalcheck" o toShake3 + val monoize = { func = Monoize.monoize CoreEnv.empty, print = MonoPrint.p_file MonoEnv.empty } -val toMonoize = transform monoize "monoize" o toShake3 +val toMonoize = transform monoize "monoize" o toMarshalcheck val mono_opt = { func = MonoOpt.optimize, diff --git a/src/jscomp.sml b/src/jscomp.sml index 934b9945..1409a0cb 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -891,9 +891,9 @@ fun process file = | EJavaScript (Source _, _, SOME _) => (e, st) | EJavaScript (_, _, SOME e) => - (strcat [str "\"cr(\"+ca(function(){return ", + (strcat [str "function(){return ", e, - str "})+\")\""], + str "}"], st) | EClosure _ => unsupported "EClosure" @@ -905,9 +905,9 @@ fun process file = let val (e, st) = jsE inner (e, st) in - (strcat [str "\"cr(\"+ca(function(){return ", + (strcat [str "function(){return ", e, - str "})+\")\""], + str "}"], st) end diff --git a/src/marshalcheck.sml b/src/marshalcheck.sml index 2cce607b..c48fd14f 100644 --- a/src/marshalcheck.sml +++ b/src/marshalcheck.sml @@ -58,7 +58,8 @@ val clientToServer = [("Basis", "int"), ("Basis", "string"), ("Basis", "time"), ("Basis", "unit"), - ("Basis", "option")] + ("Basis", "option"), + ("Basis", "bool")] val clientToServer = PS.addList (PS.empty, clientToServer) -- cgit v1.2.3