SCM Repository
View of /branches/pure-cfg/src/compiler/codegen/classify-state.sml
Parent Directory
|
Revision Log
Revision 651 -
(download)
(annotate)
Sun Mar 20 16:53:55 2011 UTC (11 years, 3 months ago) by jhr
File size: 1260 byte(s)
Sun Mar 20 16:53:55 2011 UTC (11 years, 3 months ago) by jhr
File size: 1260 byte(s)
Starting to work on partitioning strand states
(* classify-state.sml * * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) * All rights reserved. * * Classify strand state variables into three categories: * * UNIFORM -- these have the same value for all strands * INVARIANT -- does not change over the life of the strand * VARYING -- varies from step to step * * UNIFORM variables can be lifted into the global name space, while INVARIANT variables * can be lifted into the non-varying state. *) structure ClassifyState : sig datatype state_var_class = UNIFORM | INVARIANT | VARYING (* get the classification of a state variable *) val varClass : LowIL.var -> state_var_class end = struct structure IL = LowIL structure V = IL.Var datatype state_var_class = UNIFORM | INVARIANT | VARYING (* property for state variable classification *) val {getFn = varClass : V.var -> state_var_class, setFn = setClass, ...} = V.newProp (fn x => raise Fail(V.toString x ^ " not a state variable")) (* analyse a strand *) fun analyseStrand (IL.Strand{name, params, state, stateInit, methods}) = let in (* initially, we mark all state variables as UNIFORM *) List.app (fn x => setClass(x, UNIFORM)) state; end end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |