[MLton-commit] r5306

Matthew Fluet fluet at mlton.org
Fri Feb 23 06:50:31 PST 2007


Replaced command line option -coalesce with -chunkify
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/doc/changelog
U   mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/doc/changelog
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/doc/changelog	2007-02-23 11:49:55 UTC (rev 5305)
+++ mlton/branches/on-20050822-x86_64-branch/doc/changelog	2007-02-23 14:50:08 UTC (rev 5306)
@@ -1,5 +1,9 @@
 Here are the changes since version 20051202.
 
+* 2007-02-23
+   - Removed expert command line switch -coalesce <n>.
+   - Added expert command line switch -chunkify {coalesce<n>|func|one}.
+
 * 2007-02-18
    - Added command line switch -profile-val, to profile the evaluation of
      val bindings; this is particularly useful with exception history for

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2007-02-23 11:49:55 UTC (rev 5305)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/main.fun	2007-02-23 14:50:08 UTC (rev 5306)
@@ -58,10 +58,10 @@
 val linkOpts: {opt: string, pred: OptPred.t} list ref = ref []
 
 val buildConstants: bool ref = ref false
-val coalesce: int option ref = ref NONE
 val debugRuntime: bool ref = ref false
 val expert: bool ref = ref false
 val explicitAlign: Control.align option ref = ref NONE
+val explicitChunk: Control.chunk option ref = ref NONE
 val explicitCodegen: Control.codegen option ref = ref NONE
 val keepGenerated = ref false
 val keepO = ref false
@@ -183,8 +183,29 @@
        (Expert, "cc-opt-quote", " <opt>", "pass (quoted) option to C compiler",
         SpaceString 
         (fn s => List.push (ccOpts, {opt = s, pred = OptPred.Yes}))),
-       (Expert, "coalesce", " <n>", "coalesce chunk size for C codegen",
-        Int (fn n => coalesce := SOME n)),
+       (Expert, "chunkify", " {coalesce<n>|func|one}", "set chunkify method",
+        SpaceString (fn s =>
+                     explicitChunk
+                     := SOME (case s of
+                                 "func" => ChunkPerFunc 
+                               | "one" => OneChunk
+                               | _ => let
+                                         val usage = fn () =>
+                                            usage (concat ["invalid -chunkify flag: ", s])
+                                      in 
+                                         if String.hasPrefix (s, {prefix = "coalesce"})
+                                            then let
+                                                    val s = String.dropPrefix (s, 8)
+                                                 in
+                                                    if String.forall (s, Char.isDigit)
+                                                       then (case Int.fromString s of
+                                                                NONE => usage ()
+                                                              | SOME n => Coalesce 
+                                                                          {limit = n})
+                                                       else usage ()
+                                                 end
+                                            else usage ()
+                                      end))),
        (Normal, "codegen",
         concat [" {", if hasNative () then "native|" else "", "bytecode|c}"],
         "which code generator to use",
@@ -714,15 +735,12 @@
          else ()
       val _ =
          chunk :=
-         (case !codegen of
-             Bytecode => OneChunk
-           | CCodegen => Coalesce {limit = (case !coalesce of
-                                               NONE => 4096
-                                             | SOME n => n)}
-           | Native =>
-                if isSome (!coalesce)
-                   then usage "can't use -coalesce and -codegen native"
-                else ChunkPerFunc)
+         (case !explicitChunk of
+             NONE => (case !codegen of
+                         Bytecode => OneChunk
+                       | CCodegen => Coalesce {limit = 4096}
+                       | Native => ChunkPerFunc)
+           | SOME c => c)
       val _ = if not (!Control.codegen = Native) andalso !Native.IEEEFP
                  then usage "must use native codegen with -ieee-fp true"
               else ()




More information about the MLton-commit mailing list