Skip to content

Commit

Permalink
Merge pull request #7282 from ke-yu/cbn-force-execution
Browse files Browse the repository at this point in the history
Disable delta computation on code block node
  • Loading branch information
ke-yu authored Oct 20, 2016
2 parents e189317 + 3a17b6b commit b59d6d7
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 132 deletions.
13 changes: 10 additions & 3 deletions src/DynamoCore/Engine/EngineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,22 @@ private bool VerifyGraphSyncData(IEnumerable<NodeModel> nodes)
nodes.Where(n => n.NeedsForceExecution)
.Select(n => n.GUID));

if (reExecuteNodesIds.Any())
var codeBlockNodes = new HashSet<Guid>(
nodes.Where(n => n is CodeBlockNodeModel).Select(n => n.GUID));

if (reExecuteNodesIds.Any() || codeBlockNodes.Any())
{
for (int i = 0; i < graphSyncdata.ModifiedSubtrees.Count; ++i)
{
var st = graphSyncdata.ModifiedSubtrees[i];
if (reExecuteNodesIds.Contains(st.GUID))
var forceExecution = reExecuteNodesIds.Contains(st.GUID);
var isCodeBlockNode = codeBlockNodes.Contains(st.GUID);

if (forceExecution || isCodeBlockNode)
{
Subtree newSt = new Subtree(st.AstNodes, st.GUID);
newSt.ForceExecution = true;
newSt.ForceExecution = forceExecution;
newSt.DeltaComputation = !isCodeBlockNode;
graphSyncdata.ModifiedSubtrees[i] = newSt;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Engine/ProtoAssociative/CodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,7 @@ private AssociativeNode DFSEmitSplitAssign_AST(AssociativeNode node, ref List<As
{
AssociativeNode lastNode = DFSEmitSplitAssign_AST(bnode.RightNode, ref astList);
var newBNode = AstFactory.BuildBinaryExpression(bnode.LeftNode, lastNode, Operator.assign);
newBNode.OriginalAstID = bnode.OriginalAstID;

astList.Add(newBNode);
return bnode.LeftNode;
Expand Down
5 changes: 0 additions & 5 deletions src/Engine/ProtoCore/Parser/AssociativeAST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2076,11 +2076,6 @@ public class BinaryExpressionNode : AssociativeNode
public bool isSSAPointerAssignment { get; set; }
public bool IsFirstIdentListNode { get; set; }

// These properties are used only for the GraphUI ProtoAST
public uint Guid { get; set; }
//private uint splitFromUID = 0;
//public uint SplitFromUID { get { return splitFromUID; } set { splitFromUID = value; } }

public BinaryExpressionNode(AssociativeNode left = null, AssociativeNode right = null, Operator optr = Operator.none)
{
isSSAAssignment = false;
Expand Down
Loading

0 comments on commit b59d6d7

Please sign in to comment.