Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/codegen/codegen-fn.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/codegen/codegen-fn.sml

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

revision 2245, Sun Mar 3 12:51:51 2013 UTC revision 2246, Sun Mar 3 14:51:31 2013 UTC
# Line 41  Line 41 
41              tr              tr
42            end            end
43    
44      fun trStrand (prog,globalBlock,env) (IL.Strand{name, params, state, stateInit, methods}) = let      fun trStrand (prog,globalReduce,env) (IL.Strand{name, params, state, stateInit, methods}) = let
45            val strand = T.Strand.define(prog, name, state)            val strand = T.Strand.define(prog, name, state)
46            val env = T.Env.scopeStrand env            val env = T.Env.scopeStrand env
47          (* define the parameters and add them to the environment *)          (* define the parameters and add them to the environment *)
48            val params' = List.map T.Var.param params            val params' = List.map T.Var.param params
49            val env = ListPair.foldlEq (fn (x, y, env) => T.Env.bind(env, x, y)) env (params, params')            val env = ListPair.foldlEq (fn (x, y, env) => T.Env.bind(env, x, y)) env (params, params')
50            in            in
51             (* global block for this strand *)             (* global reduction for this strand *)
52              T.Program.genGlobalFun(prog, strand, T.Tr.block (T.Env.scopeGlobal env, globalBlock));              T.Program.genGlobalReduceFun(prog, strand, T.Tr.block (T.Env.scopeGlobal env, globalReduce));
53              T.Strand.init (strand, params', T.Tr.block (env, stateInit));              T.Strand.init (strand, params', T.Tr.block (env, stateInit));
54              List.app (trMethod (strand,state,env,T.Program.hasSpatialCom(prog))) methods              List.app (trMethod (strand,state,env,T.Program.hasSpatialCom(prog))) methods
55            end            end
# Line 80  Line 80 
80    
81      fun generate (tgt : TargetUtil.target_desc, srcProg) = let      fun generate (tgt : TargetUtil.target_desc, srcProg) = let
82            val _ = if #parallel tgt then targetSupportsPrinting := false else ()            val _ = if #parallel tgt then targetSupportsPrinting := false else ()
83            val treeProg as TreeIL.Program{props, globals, inputInit, globalInit, globalBlock, strands, initially} =            val treeProg as TreeIL.Program{props, globals, inputInit, globalInit, globalReduce, globalBlock, strands, initially} =
84                  PhaseTimer.withTimer Timers.timeLowToTree LowToTree.translate srcProg                  PhaseTimer.withTimer Timers.timeLowToTree LowToTree.translate srcProg
85  val _ = (  val _ = (
86  TextIO.output(Log.logFile(), "********** After translation to TreeIL **********\n");  TextIO.output(Log.logFile(), "********** After translation to TreeIL **********\n");
# Line 111  Line 111 
111              T.Program.inputs (prog, T.Env.scopeGlobal env, inputInit);              T.Program.inputs (prog, T.Env.scopeGlobal env, inputInit);
112            (* global initialization *)            (* global initialization *)
113              T.Program.init (prog, T.Tr.block (T.Env.scopeGlobal env, globalInit));              T.Program.init (prog, T.Tr.block (T.Env.scopeGlobal env, globalInit));
114               (* global block *)
115                T.Program.genGlobalFun(prog, T.Tr.block (T.Env.scopeGlobal env, globalBlock));
116            (* global destruction *)            (* global destruction *)
117              T.Program.free (prog, T.Tr.free (T.Env.scopeGlobal env, globalInit));              T.Program.free (prog, T.Tr.free (T.Env.scopeGlobal env, globalInit));
118            (* translate strands *)            (* translate strands *)
119              List.app (trStrand (prog,globalBlock,env)) strands;              List.app (trStrand (prog,globalReduce,env)) strands;
120            (* generate the initially function *)            (* generate the initially function *)
121              trInitially (env, prog, initially);              trInitially (env, prog, initially);
122            (* output the program *)            (* output the program *)

Legend:
Removed from v.2245  
changed lines
  Added in v.2246

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