[MLton-commit] r7072

Matthew Fluet fluet at mlton.org
Wed Apr 8 05:33:29 PDT 2009


Drop File and Line operands from RSSA and Machine ILs

No need to use ".S", because no need to preprocess assembler files.
----------------------------------------------------------------------

U   mlton/trunk/mlton/backend/backend.fun
U   mlton/trunk/mlton/backend/limit-check.fun
U   mlton/trunk/mlton/backend/machine.fun
U   mlton/trunk/mlton/backend/machine.sig
U   mlton/trunk/mlton/backend/rep-type.fun
U   mlton/trunk/mlton/backend/rssa.fun
U   mlton/trunk/mlton/backend/rssa.sig
U   mlton/trunk/mlton/backend/signal-check.fun
U   mlton/trunk/mlton/backend/ssa-to-rssa.fun
U   mlton/trunk/mlton/codegen/amd64-codegen/amd64-codegen.fun
U   mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun
U   mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.sig
U   mlton/trunk/mlton/codegen/amd64-codegen/amd64-translate.fun
U   mlton/trunk/mlton/codegen/bytecode/bytecode.fun
U   mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun
U   mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun
U   mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.fun
U   mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig
U   mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun
U   mlton/trunk/mlton/main/main.fun
U   mlton/trunk/runtime/gc/garbage-collection.c
U   mlton/trunk/runtime/gc/garbage-collection.h

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

Modified: mlton/trunk/mlton/backend/backend.fun
===================================================================
--- mlton/trunk/mlton/backend/backend.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/backend.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -502,9 +503,7 @@
              | Const c => constOperand c
              | EnsuresBytesFree =>
                   Error.bug "Backend.translateOperand: EnsuresBytesFree"
-             | File => M.Operand.File
              | GCState => M.Operand.GCState
-             | Line => M.Operand.Line
              | Offset {base, offset, ty} =>
                   let
                      val base = translateOperand base

Modified: mlton/trunk/mlton/backend/limit-check.fun
===================================================================
--- mlton/trunk/mlton/backend/limit-check.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/limit-check.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -272,11 +273,9 @@
                                label = collect,
                                statements = Vector.new0 (),
                                transfer = (Transfer.CCall
-                                           {args = Vector.new5 (Operand.GCState,
+                                           {args = Vector.new3 (Operand.GCState,
                                                                 amount,
-                                                                force,
-                                                                Operand.File,
-                                                                Operand.Line),
+                                                                force),
                                             func = func,
                                             return = SOME collectReturn})}
                       :: (Block.T

Modified: mlton/trunk/mlton/backend/machine.fun
===================================================================
--- mlton/trunk/mlton/backend/machine.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/machine.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -204,12 +205,10 @@
        | Cast of t * Type.t
        | Contents of {oper: t,
                       ty: Type.t}
-       | File
        | Frontier
        | GCState
        | Global of Global.t
        | Label of Label.t
-       | Line
        | Null
        | Offset of {base: t,
                     offset: Bytes.t,
@@ -224,12 +223,10 @@
        fn ArrayOffset {ty, ...} => ty
         | Cast (_, ty) => ty
         | Contents {ty, ...} => ty
-        | File => Type.cpointer ()
         | Frontier => Type.cpointer ()
         | GCState => Type.gcState ()
         | Global g => Global.ty g
         | Label l => Type.label l
-        | Line => Type.cint ()
         | Null => Type.cpointer ()
         | Offset {ty, ...} => ty
         | Real r => Type.real (RealX.size r)
@@ -257,12 +254,10 @@
              | Contents {oper, ty} =>
                   seq [str (concat ["C", Type.name ty, " "]),
                        paren (layout oper)]
-             | File => str "<File>"
              | Frontier => str "<Frontier>"
              | GCState => str "<GCState>"
              | Global g => Global.layout g
              | Label l => Label.layout l
-             | Line => str "<Line>"
              | Null => str "NULL"
              | Offset {base, offset, ty} =>
                   seq [str (concat ["O", Type.name ty, " "]),
@@ -285,11 +280,9 @@
                 Type.equals (t, t') andalso equals (z, z')
            | (Contents {oper = z, ...}, Contents {oper = z', ...}) =>
                 equals (z, z')
-           | (File, File) => true
            | (GCState, GCState) => true
            | (Global g, Global g') => Global.equals (g, g')
            | (Label l, Label l') => Label.equals (l, l')
-           | (Line, Line) => true
            | (Offset {base = b, offset = i, ...},
               Offset {base = b', offset = i', ...}) =>
                 equals (b, b') andalso Bytes.equals (i, i')
@@ -1047,7 +1040,6 @@
                       | Contents {oper, ...} =>
                            (checkOperand (oper, alloc)
                             ; Type.isCPointer (Operand.ty oper))
-                      | File => true
                       | Frontier => true
                       | GCState => true
                       | Global _ =>
@@ -1060,7 +1052,6 @@
                            (let val _ = labelBlock l
                             in true
                             end handle _ => false)
-                      | Line => true
                       | Null => true
                       | Offset {base, offset, ty} =>
                            (checkOperand (base, alloc)

Modified: mlton/trunk/mlton/backend/machine.sig
===================================================================
--- mlton/trunk/mlton/backend/machine.sig	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/machine.sig	2009-04-08 12:33:25 UTC (rev 7072)
@@ -80,12 +80,10 @@
              | Cast of t * Type.t
              | Contents of {oper: t,
                             ty: Type.t}
-             | File (* expanded by codegen into string constant *)
              | Frontier
              | GCState
              | Global of Global.t
              | Label of Label.t
-             | Line (* expand by codegen into int constant *)
              | Null
              | Offset of {base: t,
                           offset: Bytes.t,

Modified: mlton/trunk/mlton/backend/rep-type.fun
===================================================================
--- mlton/trunk/mlton/backend/rep-type.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/rep-type.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -834,16 +834,14 @@
 
       local
          fun make b = fn () =>
-            T {args = Vector.new5 (Type.gcState (), Type.csize (), Type.bool, 
-                                   Type.cpointer (), Type.word WordSize.word32),
+            T {args = Vector.new3 (Type.gcState (), Type.csize (), Type.bool),
                    bytesNeeded = NONE,
                    convention = Cdecl,
                    ensuresBytesFree = true,
                    mayGC = true,
                    maySwitchThreads = b,
                    modifiesFrontier = true,
-                   prototype = (Vector.new5 (CType.cpointer, CType.csize (), CType.bool, 
-                                             CType.cpointer, CType.Int32),
+                   prototype = (Vector.new3 (CType.cpointer, CType.csize (), CType.bool),
                                 NONE),
                    readsStackTop = true,
                    return = Type.unit,

Modified: mlton/trunk/mlton/backend/rssa.fun
===================================================================
--- mlton/trunk/mlton/backend/rssa.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/rssa.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -44,9 +45,7 @@
        | Cast of t * Type.t
        | Const of Const.t
        | EnsuresBytesFree
-       | File
        | GCState
-       | Line
        | Offset of {base: t,
                     offset: Bytes.t,
                     ty: Type.t}
@@ -79,9 +78,7 @@
                    | WordVector v => Type.ofWordXVector v
                end
           | EnsuresBytesFree => Type.csize ()
-          | File => Type.cpointer ()
           | GCState => Type.gcState ()
-          | Line => Type.cint ()
           | Offset {ty, ...} => ty
           | ObjptrTycon _ => Type.objptrHeader ()
           | Runtime z => Type.ofGCField z
@@ -100,9 +97,7 @@
                   seq [str "Cast ", tuple [layout z, Type.layout ty]]
              | Const c => seq [Const.layout c, constrain (ty z)]
              | EnsuresBytesFree => str "<EnsuresBytesFree>"
-             | File => str "<File>"
              | GCState => str "<GCState>"
-             | Line => str "<Line>"
              | Offset {base, offset, ty} =>
                   seq [str (concat ["O", Type.name ty, " "]),
                        tuple [layout base, Bytes.layout offset],
@@ -1532,9 +1527,7 @@
                                              tyconTy = tyconTy})
                        | Const _ => true
                        | EnsuresBytesFree => true
-                       | File => true
                        | GCState => true
-                       | Line => true
                        | Offset {base, offset, ty} =>
                             Type.offsetIsOk {base = Operand.ty base,
                                              offset = offset,

Modified: mlton/trunk/mlton/backend/rssa.sig
===================================================================
--- mlton/trunk/mlton/backend/rssa.sig	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/rssa.sig	2009-04-08 12:33:25 UTC (rev 7072)
@@ -52,9 +52,7 @@
                 * a real operand.
                 *)
              | EnsuresBytesFree
-             | File (* expand by codegen into string constant *)
              | GCState
-             | Line (* expand by codegen into int constant *)
              | Offset of {base: t,
                           offset: Bytes.t,
                           ty: Type.t}

Modified: mlton/trunk/mlton/backend/signal-check.fun
===================================================================
--- mlton/trunk/mlton/backend/signal-check.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/signal-check.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -104,11 +105,9 @@
                     statements = Vector.new0 (),
                     transfer =
                     Transfer.CCall
-                    {args = Vector.new5 (Operand.GCState,
+                    {args = Vector.new3 (Operand.GCState,
                                          Operand.word (WordX.zero (WordSize.csize ())),
-                                         Operand.bool false,
-                                         Operand.File,
-                                         Operand.Line),
+                                         Operand.bool false),
                      func = func,
                      return = SOME collectReturn}})
                :: (Block.T

Modified: mlton/trunk/mlton/backend/ssa-to-rssa.fun
===================================================================
--- mlton/trunk/mlton/backend/ssa-to-rssa.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/backend/ssa-to-rssa.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -1196,12 +1197,10 @@
                                | FFI f => simpleCCall f
                                | GC_collect =>
                                     ccall
-                                    {args = (Vector.new5
+                                    {args = (Vector.new3
                                              (GCState,
                                               Operand.zero (WordSize.csize ()),
-                                              Operand.bool true,
-                                              File,
-                                              Line)),
+                                              Operand.bool true)),
                                      func = (CFunction.gc
                                              {maySwitchThreads = handlesSignals})}
                                | IntInf_toVector => cast ()
@@ -1312,12 +1311,10 @@
                                             Goto {args = Vector.new0 (),
                                                   dst = continue}}
                                         val args =
-                                           Vector.new5
+                                           Vector.new3
                                            (GCState,
                                             Operand.zero (WordSize.csize ()),
-                                            Operand.bool false,
-                                            File,
-                                            Line)
+                                            Operand.bool false)
                                         val switchToHandler =
                                            newBlock
                                            {args = Vector.new0 (),

Modified: mlton/trunk/mlton/codegen/amd64-codegen/amd64-codegen.fun
===================================================================
--- mlton/trunk/mlton/codegen/amd64-codegen/amd64-codegen.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/amd64-codegen/amd64-codegen.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -167,13 +168,6 @@
 
         val _ = amd64MLtonBasic.init ()
 
-        fun file_begin file
-          = [amd64.Assembly.pseudoop_data (),
-             amd64.Assembly.pseudoop_p2align 
-             (amd64.Immediate.int 2, NONE, NONE),
-             amd64.Assembly.label amd64MLton.fileNameLabel,
-             amd64.Assembly.pseudoop_string [file]]
-
         fun outputJumpToSML print =
            let
               val win64 = case !Control.Target.os of
@@ -449,11 +443,7 @@
               val split = !Control.Native.split
               fun loop chunks
                 = let
-                    val {file, print, done} = makeS()
-                    val _ = List.foreach
-                            (file_begin file,
-                             fn asm => (Layout.print(Assembly.layout asm, print);
-                                        print "\n"))
+                    val {print, done, ...} = makeS()
                     fun loop' (chunks, size) 
                       = case chunks
                           of [] => done ()

Modified: mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun
===================================================================
--- mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -262,32 +263,6 @@
 
   val globalObjptrNonRoot_base = Label.fromString "globalObjptrNonRoot"
 
-  val fileNameLabel = Label.fromString "fileName"
-  val fileName = Operand.immediate_label fileNameLabel
-  (* This is a hack: The line number needs to be pushed, but the actual
-   *  call to GC_collect is about 9 lines further (push 4 more arguments,
-   *  adjust stackTop, save return label,
-   *  save gcState.frontier and gcState.stackTop, make call).
-   * However, there are probably cases where this is different.
-   *
-   * We also have another hack because on some platforms, Label.toString appends
-   * an _ to the beginning of each label.
-   *)
-  val fileLineLabel =
-     Promise.lazy (fn () => Label.fromString (if !Control.labelsHaveExtra_
-                                                 then "_LINE__"
-                                              else "__LINE__"))
-
-  (* When debugging, the assembly file is not passed through cpp,
-   * so use an dummy value (zero).
-   *)
-  val fileLine
-    = fn () => if !Control.debug
-                 then Operand.immediate (Immediate.zero)
-                 else (Operand.immediate
-                       (Immediate.labelPlusInt
-                        (fileLineLabel (), 9)))
-
   val gcState_label = Label.fromString "gcState"
 
   structure Field = Runtime.GCField

Modified: mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.sig
===================================================================
--- mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.sig	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/amd64-codegen/amd64-mlton-basic.sig	2009-04-08 12:33:25 UTC (rev 7072)
@@ -96,11 +96,6 @@
     val global_base : amd64.CType.t -> amd64.Label.t
     val globalObjptrNonRoot_base : amd64.Label.t
 
-    (* Misc. *)
-    val fileNameLabel : amd64.Label.t
-    val fileName : amd64.Operand.t
-    val fileLine : unit -> amd64.Operand.t
-
     (* gcState relative locations defined in gc.h *)
     val gcState_label: amd64.Label.t
     val gcState_offset: {offset: int, ty: amd64.CType.t} -> amd64.Operand.t

Modified: mlton/trunk/mlton/codegen/amd64-codegen/amd64-translate.fun
===================================================================
--- mlton/trunk/mlton/codegen/amd64-codegen/amd64-translate.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/amd64-codegen/amd64-translate.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -164,7 +165,6 @@
                       scale = amd64.Scale.One,
                       size = size}, size), offset + amd64.Size.toBytes size))
                end
-          | File => Vector.new1 (amd64MLton.fileName, amd64MLton.pointerSize)
           | Frontier => 
                let 
                   val frontier = amd64MLton.gcState_frontierContentsOperand ()
@@ -177,8 +177,6 @@
           | Global g => Global.toAMD64Operand g
           | Label l => 
                Vector.new1 (amd64.Operand.immediate_label l, amd64MLton.pointerSize)
-          | Line => 
-               Vector.new1 (amd64MLton.fileLine (), amd64MLton.wordSize)
           | Null => 
                Vector.new1 (amd64.Operand.immediate_zero, amd64MLton.wordSize)
           | Offset {base = GCState, offset, ty} =>

Modified: mlton/trunk/mlton/codegen/bytecode/bytecode.fun
===================================================================
--- mlton/trunk/mlton/codegen/bytecode/bytecode.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/bytecode/bytecode.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -527,7 +527,6 @@
              | Contents {oper, ...} =>
                    (emitLoadOperand oper
                     ; emitOpcode (contents (ls, cty)))
-             | File => emitOperand (Null, ls)
              | Frontier => emitOpcode (frontier ls)
              | GCState => emitOpcode (gcState ls)
              | Global g =>
@@ -538,8 +537,6 @@
              | Label l =>
                   (emitOpcode (wordOpcode (ls, cty))
                    ; emitLabel l)
-             | Line => (emitOpcode (wordOpcode (ls, cty))
-                        ; emitWordX (WordX.zero (WordSize.cint ())))
              | Null => (emitOpcode (wordOpcode (ls, cty))
                         ; emitWordX (WordX.zero (WordSize.cpointer ())))
              | Offset {base, offset = off, ...} =>

Modified: mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun
===================================================================
--- mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -674,7 +674,6 @@
                                        C.bytes offset]]
              | Cast (z, ty) => concat ["(", Type.toC ty, ")", toString z]
              | Contents {oper, ty} => contents (ty, toString oper)
-             | File => "(CPointer)(__FILE__)"
              | Frontier => "Frontier"
              | GCState => "GCState"
              | Global g =>
@@ -684,7 +683,6 @@
                                           Int.toString (Global.index g)]]
                   else concat ["GPNR", C.args [Int.toString (Global.index g)]]
              | Label l => labelToStringIndex l
-             | Line => "__LINE__"
              | Null => "NULL"
              | Offset {base, offset, ty} =>
                   concat ["O", C.args [Type.toC ty,

Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-codegen.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -169,13 +170,6 @@
 
         val _ = x86MLtonBasic.init ()
 
-        fun file_begin file
-          = [x86.Assembly.pseudoop_data (),
-             x86.Assembly.pseudoop_p2align 
-             (x86.Immediate.int 2, NONE, NONE),
-             x86.Assembly.label x86MLton.fileNameLabel,
-             x86.Assembly.pseudoop_string [file]]
-
         fun outputJumpToSML print =
            let
               val jumpToSML = x86.Label.fromString "MLton_jumpToSML"
@@ -468,11 +462,7 @@
               val split = !Control.Native.split
               fun loop chunks
                 = let
-                    val {file, print, done} = makeS()
-                    val _ = List.foreach
-                            (file_begin file,
-                             fn asm => (Layout.print(Assembly.layout asm, print);
-                                        print "\n"))
+                    val {print, done, ...} = makeS()
                     fun loop' (chunks, size) 
                       = case chunks
                           of [] => done ()

Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -323,32 +324,6 @@
 
   val globalObjptrNonRoot_base = Label.fromString "globalObjptrNonRoot"
 
-  val fileNameLabel = Label.fromString "fileName"
-  val fileName = Operand.immediate_label fileNameLabel
-  (* This is a hack: The line number needs to be pushed, but the actual
-   *  call to GC_collect is about 9 lines further (push 4 more arguments,
-   *  adjust stackTop, save return label,
-   *  save gcState.frontier and gcState.stackTop, make call).
-   * However, there are probably cases where this is different.
-   *
-   * We also have another hack because on some platforms, Label.toString appends
-   * an _ to the beginning of each label.
-   *
-   * Make it a label (not an immediate) so that it doesn't get PIC-ified.
-   *)
-  val fileLineLabel =
-     Promise.lazy (fn () => Label.fromString (if !Control.labelsHaveExtra_
-                                                 then "_LINE__+9"
-                                              else "__LINE__+9"))
-
-  (* When debugging, the assembly file is not passed through cpp,
-   * so use an dummy value (zero).
-   *)
-  val fileLine
-    = fn () => if !Control.debug
-                 then Operand.immediate (Immediate.zero)
-                 else Operand.label (fileLineLabel ())
-
   val gcState_label = Label.fromString "gcState"
 
   structure Field = Runtime.GCField

Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-mlton-basic.sig	2009-04-08 12:33:25 UTC (rev 7072)
@@ -100,11 +100,6 @@
     val global_base : x86.CType.t -> x86.Label.t
     val globalObjptrNonRoot_base : x86.Label.t
 
-    (* Misc. *)
-    val fileNameLabel : x86.Label.t
-    val fileName : x86.Operand.t
-    val fileLine : unit -> x86.Operand.t
-
     (* gcState relative locations defined in gc.h *)
     val gcState_label: x86.Label.t
     val gcState_offset: {offset: int, ty: x86.CType.t} -> x86.Operand.t

Modified: mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun
===================================================================
--- mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-(* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+(* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -164,7 +165,6 @@
                       scale = x86.Scale.One,
                       size = size}, size), offset + x86.Size.toBytes size))
                end
-          | File => Vector.new1 (x86MLton.fileName, x86MLton.pointerSize)
           | Frontier => 
                let 
                   val frontier = x86MLton.gcState_frontierContentsOperand ()
@@ -177,8 +177,6 @@
           | Global g => Global.toX86Operand g
           | Label l => 
                Vector.new1 (x86.Operand.immediate_label l, x86MLton.pointerSize)
-          | Line => 
-               Vector.new1 (x86MLton.fileLine (), x86MLton.wordSize)
           | Null => 
                Vector.new1 (x86.Operand.immediate_zero, x86MLton.wordSize)
           | Offset {base = GCState, offset, ty} =>

Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/mlton/main/main.fun	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1498,8 +1498,7 @@
                                  Compile.compileMLB
                                  {input = file,
                                   outputC = make (Control.C, ".c"),
-                                  outputS = make (Control.Assembly,
-                                                  if !debug then ".s" else ".S")}
+                                  outputS = make (Control.Assembly, ".s")}
                      in
                         case stop of
                            Place.Files => ()

Modified: mlton/trunk/runtime/gc/garbage-collection.c
===================================================================
--- mlton/trunk/runtime/gc/garbage-collection.c	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/runtime/gc/garbage-collection.c	2009-04-08 12:33:25 UTC (rev 7072)
@@ -218,10 +218,7 @@
   assert (hasHeapBytesFree (s, oldGenBytesRequested, nurseryBytesRequested));
 }
 
-void GC_collect (GC_state s, size_t bytesRequested, bool force,
-            char *file, int line) {
-  if (DEBUG)
-    fprintf (stderr, "%s %d: GC_collect\n", file, line);
+void GC_collect (GC_state s, size_t bytesRequested, bool force) {
   enter (s);
   /* When the mutator requests zero bytes, it may actually need as
    * much as GC_HEAP_LIMIT_SLOP.

Modified: mlton/trunk/runtime/gc/garbage-collection.h
===================================================================
--- mlton/trunk/runtime/gc/garbage-collection.h	2009-04-08 12:33:20 UTC (rev 7071)
+++ mlton/trunk/runtime/gc/garbage-collection.h	2009-04-08 12:33:25 UTC (rev 7072)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 2009 Matthew Fluet.
+ * Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -27,7 +28,6 @@
 
 #if (defined (MLTON_GC_INTERNAL_BASIS))
 
-PRIVATE void GC_collect (GC_state s, size_t bytesRequested, bool force,
-                         char *file, int line);
+PRIVATE void GC_collect (GC_state s, size_t bytesRequested, bool force);
 
 #endif /* (defined (MLTON_GC_INTERNAL_BASIS)) */




More information about the MLton-commit mailing list