Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 843cd5f85808289c3b2b9a177757dff0d68a8edc..178a8811f2f4b73bc8009b0cc3bbd281baa17001 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1898,6 +1898,12 @@ void BytecodeGraphBuilder::BuildLoopHeaderForBackwardBranches( |
void BytecodeGraphBuilder::BuildJump(int source_offset, int target_offset) { |
DCHECK_NULL(merge_environments_[source_offset]); |
+ // Append merge nodes to the environment. We may merge here with another |
+ // environment. So add a place holder for merge nodes. We may add redundant |
+ // but will be eliminated in a later pass. |
+ // TODO(mstarzinger): This can be simplified by propagating environment |
+ // forward along the direction of the dataflow. |
+ NewMerge(); |
merge_environments_[source_offset] = environment(); |
if (source_offset >= target_offset) { |
MergeEnvironmentsOfBackwardBranches(source_offset, target_offset); |