Index: src/compiler/js-typed-lowering.cc |
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc |
index 4c3318135287e9988c2be00d4a84d048c582502c..213a8a414660f87e7f9c685689c07dd3b8c85d8c 100644 |
--- a/src/compiler/js-typed-lowering.cc |
+++ b/src/compiler/js-typed-lowering.cc |
@@ -1853,6 +1853,10 @@ Reduction JSTypedLowering::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)) { |
+ // 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 |
+ // the Operator::kNoDeopt property). |
Type* upper = NodeProperties::GetType(node); |
if (upper->IsInhabited()) { |
if (upper->IsConstant()) { |