Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/visualization/graphLayout.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/visualization/graphLayout.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1065 - (download) (annotate)
Thu Feb 14 15:05:16 2002 UTC (18 years, 7 months ago) by george
File size: 1096 byte(s)
Fixed the MLRISC bug sent by Markus Wenzel regarding the compilation
of Isabelle on the x86.

From Allen:
-----------
 I've found the problem:

     in ra-core.sml, I use the counter "blocked" to keep track of the
     true number of elements in the freeze queue.  When the counter goes
     to zero, I skip examining the queue.  But I've messed up the
     bookkeeping in combine():

         else ();
         case !ucol of
           PSEUDO => (if !cntv > 0 then
                 (if !cntu > 0 then blocked := !blocked - 1 else ();
                                    ^^^^^^^^^^^^^^^^^^^^^^^
                  moveu := mergeMoveList(!movev, !moveu)
                 )
              else ();

     combine() is called to coalesce two nodes u and v.
     I think I was thinking that if the move counts of u and v are both
     greater than zero then after they are coalesced then one node is
     removed from the freeze queue.  Apparently I was thinking that
     both u and v are of low degree, but that's clearly not necessarily true.


02/12/2002:
    Here's the patch.  HOL now compiles.

    I don't know how this impact on performance (compile
    time or runtime).  This bug caused the RA (especially on the x86)
    to go thru the potential spill phase when there are still nodes on the
    freeze queue.
(*
 * Here are some graph layout annotations.
 *
 * -- Allen
 *)

structure GraphLayout =
struct

   datatype format = 
     LABEL of string
   | COLOR of string
   | NODE_COLOR of string
   | EDGE_COLOR of string
   | TEXT_COLOR of string
   | ARROW_COLOR of string
   | BACKARROW_COLOR of string
   | BORDER_COLOR of string
   | BORDERLESS 
   | SHAPE of string 
   | ALGORITHM of string
   | EDGEPATTERN of string
   | DIR (* for internal use only! *)

   val STYLE = Annotations.new(SOME(fn _ => "STYLE")) : 
         format list Annotations.property 

   type ('n,'e,'g) style = 
      { edge  : 'e Graph.edge -> format list,
        node  : 'n Graph.node -> format list,
        graph : 'g -> format list
      }

   type layout = (format list, format list, format list) Graph.graph

   fun makeLayout {node,edge,graph} G = 
       IsomorphicGraphView.map node edge graph G

   fun makeLayout' G =
   let val edgeColor = [COLOR "red"]
   in  makeLayout {node=fn (i,_) => [LABEL(Int.toString i)],
                   edge=fn _ => edgeColor,
                   graph=fn _ => []} G
   end
end


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0