Index: src/compiler/typed-optimization.cc |
diff --git a/src/compiler/typed-optimization.cc b/src/compiler/typed-optimization.cc |
index 4fef5323e4e1c9bef51d4cad907aaaf6adbf0203..5a6e4d7647a3c9bb61a5ca457ad38a42b7c29aec 100644 |
--- a/src/compiler/typed-optimization.cc |
+++ b/src/compiler/typed-optimization.cc |
@@ -33,6 +33,10 @@ Reduction TypedOptimization::Reduce(Node* node) { |
// result value and can simply replace the node if it's eliminable. |
if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) && |
node->op()->HasProperty(Operator::kEliminatable)) { |
+ // TODO(v8:5303): We must not eliminate FinishRegion here. This special |
+ // case can be removed once we have separate operators for value and |
+ // effect regions. |
+ if (node->opcode() == IrOpcode::kFinishRegion) return NoChange(); |
// We can only constant-fold nodes here, that are known to not cause any |
// side-effect, may it be a JavaScript observable side-effect or a possible |
// eager deoptimization exit (i.e. {node} has an operator that doesn't have |