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/gc-safety/gc-cells.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/gc-safety/gc-cells.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 476 - (download) (annotate)
Wed Nov 10 22:59:58 1999 UTC (19 years, 11 months ago) by monnier
File size: 923 byte(s)
This commit was generated by cvs2svn to compensate for changes in r475,
which included commits to RCS files with non-trunk default branches.
 * This makes a new cell module that automatically propagate gc type info.
functor GCCells(structure C  : CELLS
                structure GCMap : GC_MAP) : GC_CELLS =

   structure C  = C
   structure GC = GCMap.GC
   structure GCMap = GCMap

   val gcmap = ref NONE : GCMap.gcmap option ref

   fun setGCMap map = gcmap := SOME map
   fun getGCMap() = Option.valOf(!gcmap) 

    * Generate a new virtual register and update the gc map at the same time.
   fun newCell k = 
   let val new = C.newCell k
       val gcmap = getGCMap()
       val add  = Intmap.add gcmap
       fun genVar gc =
       let val r = new()
       in  add(r,gc); r end
   in  genVar

    * Create a new GC map
   fun newGCMap() =
   let val gcmap = Intmap.new(129,GCMap.GCMap)
   in  case C.zeroReg C.GP of
         SOME r => Intmap.add gcmap (r,GC.CONST 0)
       | _ => ();


ViewVC Help
Powered by ViewVC 1.0.0