- //TODO! Shouldn't there be a code plan for task exit
- // where the exiting task calculates whether its own
- // siblings need variables from its children, so the
- // exiter should copy those variables into its own out-set
- // and make the available?
- } break;
+
+ // Classify the sources of out-set variables so code
+ // gen can acquire them from children if necessary
+ // before this task exits
+ FlatSESEEnterNode exiter = fsexn.getFlatEnter();
+
+ Iterator<TempDescriptor> outVarItr = exiter.getOutVarSet().iterator();
+ while (outVarItr.hasNext()) {
+ TempDescriptor outVar = outVarItr.next();
+
+ VSTWrapper vstIfStatic = new VSTWrapper();
+ Integer srcType = vstTableIn.getRefVarSrcType(outVar, exiter, vstIfStatic);
+
+ if (srcType.equals(VarSrcTokTable.SrcType_DYNAMIC)) {
+ // if the out-var is dynamic, put it in the set of dyn out vars
+ // so exiting code gen knows to look for the value, but also put
+ // it in the set of dynamic vars the exiter must track!
+ exiter.addDynamicOutVar(outVar);
+ addDynamicVar(exiter, fm, outVar);
+
+ } else if (srcType.equals(VarSrcTokTable.SrcType_STATIC)) {
+ exiter.addStaticOutVar(outVar);
+ VariableSourceToken vst = vstIfStatic.vst;
+ exiter.putStaticOutVar2src(outVar, vst);
+ exiter.addStaticOutVarSrc(new SESEandAgePair(vst.getSESE(), vst.getAge()));
+
+ } else {
+ assert srcType.equals(VarSrcTokTable.SrcType_READY);
+ exiter.addReadyOutVar(outVar);
+ }
+ }
+ }
+ break;