diff options
Diffstat (limited to 'deps/v8/src/compiler/constant-folding-reducer.cc')
-rw-r--r-- | deps/v8/src/compiler/constant-folding-reducer.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/v8/src/compiler/constant-folding-reducer.cc b/deps/v8/src/compiler/constant-folding-reducer.cc index 5e74ba7535..14279b0b13 100644 --- a/deps/v8/src/compiler/constant-folding-reducer.cc +++ b/deps/v8/src/compiler/constant-folding-reducer.cc @@ -13,7 +13,7 @@ namespace internal { namespace compiler { namespace { -Node* TryGetConstant(JSGraph* jsgraph, Node* node) { +Node* TryGetConstant(JSGraph* jsgraph, Node* node, JSHeapBroker* broker) { Type type = NodeProperties::GetType(node); Node* result; if (type.IsNone()) { @@ -29,7 +29,7 @@ Node* TryGetConstant(JSGraph* jsgraph, Node* node) { } else if (type.Is(Type::Hole())) { result = jsgraph->TheHoleConstant(); } else if (type.IsHeapConstant()) { - result = jsgraph->Constant(type.AsHeapConstant()->Ref()); + result = jsgraph->Constant(type.AsHeapConstant()->Ref(), broker); } else if (type.Is(Type::PlainNumber()) && type.Min() == type.Max()) { result = jsgraph->Constant(type.Min()); } else { @@ -66,8 +66,9 @@ ConstantFoldingReducer::~ConstantFoldingReducer() = default; Reduction ConstantFoldingReducer::Reduce(Node* node) { if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) && node->op()->HasProperty(Operator::kEliminatable) && - node->opcode() != IrOpcode::kFinishRegion) { - Node* constant = TryGetConstant(jsgraph(), node); + node->opcode() != IrOpcode::kFinishRegion && + node->opcode() != IrOpcode::kTypeGuard) { + Node* constant = TryGetConstant(jsgraph(), node, broker()); if (constant != nullptr) { DCHECK(NodeProperties::IsTyped(constant)); if (!v8_flags.assert_types) { |