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

SCM Repository

[smlnj] Diff of /sml/trunk/compiler/FLINT/clos/closure.sml
ViewVC logotype

Diff of /sml/trunk/compiler/FLINT/clos/closure.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 286  Line 286 
286  abstype env = Env of lvar list *                  (* values *)  abstype env = Env of lvar list *                  (* values *)
287                       (lvar * closureRep) list *   (* closures *)                       (lvar * closureRep) list *   (* closures *)
288                       lvar list *                  (* disposable cells *)                       lvar list *                  (* disposable cells *)
289                       object Intmap.intmap         (* what map *)                       object IntHashTable.hash_table (* what map *)
290  with  with
291    
292  (****************************************************************************  (****************************************************************************
# Line 294  Line 294 
294   ****************************************************************************)   ****************************************************************************)
295    
296  exception NotBound  exception NotBound
297  fun emptyEnv() = Env([],[],[],Intmap.new(32,NotBound))  fun emptyEnv() = Env([],[],[],IntHashTable.mkTable(32,NotBound))
298    
299  (* add a new object to an environment *)  (* add a new object to an environment *)
300  fun augment(m as (v,obj),e as Env(valueL,closureL,dispL,whatMap)) =  fun augment(m as (v,obj),e as Env(valueL,closureL,dispL,whatMap)) =
301    (Intmap.add whatMap m;    (IntHashTable.insert whatMap m;
302     case obj     case obj
303      of Value _ => Env(v::valueL,closureL,dispL,whatMap)      of Value _ => Env(v::valueL,closureL,dispL,whatMap)
304       | Closure cr => Env(valueL,(v,cr)::closureL,dispL,whatMap)       | Closure cr => Env(valueL,(v,cr)::closureL,dispL,whatMap)
# Line 393  Line 393 
393    in  pr "Values:"; ilist valueL;    in  pr "Values:"; ilist valueL;
394        pr "Closures:\n"; p(fn () => (),closureL,nil);        pr "Closures:\n"; p(fn () => (),closureL,nil);
395        pr "Disposable records:\n"; ilist dispL;        pr "Disposable records:\n"; ilist dispL;
396        pr "Known function mapping:\n"; Intmap.app fp whatMap;        pr "Known function mapping:\n"; IntHashTable.appi fp whatMap;
397        pr "Callee-save continuation mapping:\n";        pr "Callee-save continuation mapping:\n";
398        Intmap.app cp whatMap        IntHashTable.appi cp whatMap
399    end    end
400    
401  (****************************************************************************  (****************************************************************************
# Line 404  Line 404 
404    
405  exception Lookup of lvar * env  exception Lookup of lvar * env
406  fun whatIs(env as Env(_,_,_,whatMap),v) =  fun whatIs(env as Env(_,_,_,whatMap),v) =
407    Intmap.map whatMap v handle NotBound => raise Lookup(v,env)    IntHashTable.lookup whatMap v handle NotBound => raise Lookup(v,env)
408    
409  (* Add v to the access environment, v must be in whatMap already *)  (* Add v to the access environment, v must be in whatMap already *)
410  fun augvar(v,e as Env(valueL,closureL,dispL,whatMap)) =  fun augvar(v,e as Env(valueL,closureL,dispL,whatMap)) =

Legend:
Removed from v.651  
changed lines
  Added in v.733

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