Skip to content

Commit b6b7dfd

Browse files
committed
notes for BF ME review
1 parent a053d2a commit b6b7dfd

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/Hyperbee.Expressions/Transformation/StateMachineBuilder.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,18 @@ FieldInfo[] fields
433433
// return bodyExpressions;
434434
//}
435435

436-
private static List<Expression> GetBodyExpressions( Expression jumpTable, StateContext.Scope firstScope ) //BF ME Where does this operation belong? Should we do this for each scope?
436+
//BF ME
437+
//
438+
// This proof-of-concept only merges the top-level scope.
439+
//
440+
// The final implementation
441+
//
442+
// - should merge all scopes
443+
// - should probably be moved to the state-machine (node) optimizer
444+
// - needs to latch in to try-catch transitions
445+
// - should we consider a `BlockNodeExpression` that contains mergeable nodes?
446+
447+
private static List<Expression> GetBodyExpressions( Expression jumpTable, StateContext.Scope firstScope )
437448
{
438449
return [jumpTable, MergeNodeExpressions( firstScope.Nodes )];
439450

src/Hyperbee.Expressions/Transformation/Transitions/TryCatchTransition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ List<Expression> GetExpressions()
6060
)
6161
};
6262

63-
body.AddRange( StateScope.Nodes );
63+
body.AddRange( StateScope.Nodes ); //BF ME - merge nodes here or add a single `NodeBlockExpression` node that contains the merge reduce
6464

6565
MapCatchBlock( Parent.StateOrder, out var catches, out var switchCases );
6666

0 commit comments

Comments
 (0)