Index: src/compiler/simplified-operator-reducer.cc |
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc |
index e9ce0d5a660776cd29af6c2d8f29dc9f787c5f7d..46d8e2f72d5d4024c0f9a3473d0c7db9e85f80b6 100644 |
--- a/src/compiler/simplified-operator-reducer.cc |
+++ b/src/compiler/simplified-operator-reducer.cc |
@@ -43,9 +43,8 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) { |
switch (node->opcode()) { |
case IrOpcode::kBooleanNot: { |
HeapObjectMatcher m(node->InputAt(0)); |
- if (m.HasValue()) { |
- return Replace(jsgraph()->BooleanConstant(!m.Value()->BooleanValue())); |
- } |
+ if (m.Is(factory()->true_value())) return ReplaceBoolean(false); |
+ if (m.Is(factory()->false_value())) return ReplaceBoolean(true); |
if (m.IsBooleanNot()) return Replace(m.InputAt(0)); |
break; |
} |
@@ -127,6 +126,14 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) { |
} |
break; |
} |
+ case IrOpcode::kCheckIf: { |
+ HeapObjectMatcher m(node->InputAt(0)); |
+ if (m.Is(factory()->true_value())) { |
+ Node* const effect = NodeProperties::GetEffectInput(node); |
+ return Replace(effect); |
+ } |
+ break; |
+ } |
case IrOpcode::kCheckTaggedPointer: { |
Node* const input = node->InputAt(0); |
if (DecideObjectIsSmi(input) == Decision::kFalse) { |
@@ -203,9 +210,15 @@ Reduction SimplifiedOperatorReducer::ReplaceNumber(int32_t value) { |
return Replace(jsgraph()->Constant(value)); |
} |
+Factory* SimplifiedOperatorReducer::factory() const { |
+ return isolate()->factory(); |
+} |
Graph* SimplifiedOperatorReducer::graph() const { return jsgraph()->graph(); } |
+Isolate* SimplifiedOperatorReducer::isolate() const { |
+ return jsgraph()->isolate(); |
+} |
MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { |
return jsgraph()->machine(); |