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 2162, Thu Nov 2 21:20:47 2006 UTC revision 4149, Mon Sep 28 22:40:45 2015 UTC
# Line 10  Line 10 
10   *                   at most ONE continuation function definition per FIX;  *   *                   at most ONE continuation function definition per FIX;  *
11   *                                                                          *   *                                                                          *
12   *               (3) The outermost function is always a non-recursive       *   *               (3) The outermost function is always a non-recursive       *
13   *                   escaping funciton.                                     *   *                   escaping function.                                     *
14   *                                                                          *   *                                                                          *
15   ****************************************************************************)   ****************************************************************************)
16    
# Line 402  Line 402 
402   * Environment Lookup (whatIs, returning object type)                       *   * Environment Lookup (whatIs, returning object type)                       *
403   ****************************************************************************)   ****************************************************************************)
404    
405  exception Lookup of lvar * env  exception Lookup of string * lvar * env
406  fun whatIs(env as Env(_,_,_,whatMap),v) =  fun whatIs(env as Env(_,_,_,whatMap),v) =
407    IntHashTable.lookup whatMap v handle NotBound => raise Lookup(v,env)    IntHashTable.lookup whatMap v handle NotBound => raise Lookup("whatIs", 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)) =
# Line 418  Line 418 
418   ****************************************************************************)   ****************************************************************************)
419    
420  fun whereIs(env as Env(valueL,closureL,_,whatMap),target) =  fun whereIs(env as Env(valueL,closureL,_,whatMap),target) =
421    let fun bfs(nil,nil) = raise Lookup(target,env)    let fun bfs(nil,nil) = raise Lookup("whereIs",target,env)
422          | bfs(nil,next) = bfs(next,nil)          | bfs(nil,next) = bfs(next,nil)
423          | bfs((h, ox as (_, CR(off, {functions,values,          | bfs((h, ox as (_, CR(off, {functions,values,
424                                       closures,stamp,...})))::m, next) =                                       closures,stamp,...})))::m, next) =
# Line 1925  Line 1925 
1925    
1926  fun closefix(fk,f,vl,cl,ce,env,sn,csg,csf,ret) =  fun closefix(fk,f,vl,cl,ce,env,sn,csg,csf,ret) =
1927    ((fk,f,vl,cl,close(ce,env,sn,csg,csf,ret))    ((fk,f,vl,cl,close(ce,env,sn,csg,csf,ret))
1928         handle Lookup(v,env) => (pr "LOOKUP FAILS on "; vp v;         handle Lookup(f,v,env) => (pr(concat["LOOKUP FAILS on ", f, " "]); vp v;
1929                                       pr "\nin environment:\n";                                       pr "\nin environment:\n";
1930                                  printEnv env;                                  printEnv env;
1931                                  pr "\nin function:\n";                                  pr "\nin function:\n";

Legend:
Removed from v.2162  
changed lines
  Added in v.4149

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