Index: src/compiler/simplified-operator-reducer.cc |
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc |
index b9d5c268d180735d779af8e7141e466bb8a107ce..e9ce0d5a660776cd29af6c2d8f29dc9f787c5f7d 100644 |
--- a/src/compiler/simplified-operator-reducer.cc |
+++ b/src/compiler/simplified-operator-reducer.cc |
@@ -34,9 +34,7 @@ Decision DecideObjectIsSmi(Node* const input) { |
SimplifiedOperatorReducer::SimplifiedOperatorReducer(Editor* editor, |
JSGraph* jsgraph) |
- : AdvancedReducer(editor), |
- jsgraph_(jsgraph), |
- type_cache_(TypeCache::Get()) {} |
+ : AdvancedReducer(editor), jsgraph_(jsgraph) {} |
SimplifiedOperatorReducer::~SimplifiedOperatorReducer() {} |
@@ -162,41 +160,17 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) { |
if (m.HasValue()) return ReplaceNumber(std::fabs(m.Value())); |
break; |
} |
- case IrOpcode::kNumberCeil: |
- case IrOpcode::kNumberFloor: |
- case IrOpcode::kNumberRound: |
- case IrOpcode::kNumberTrunc: { |
- Node* const input = NodeProperties::GetValueInput(node, 0); |
- Type* const input_type = NodeProperties::GetType(input); |
- if (input_type->Is(type_cache_.kIntegerOrMinusZeroOrNaN)) { |
- return Replace(input); |
- } |
+ case IrOpcode::kReferenceEqual: { |
+ HeapObjectBinopMatcher m(node); |
+ if (m.left().node() == m.right().node()) return ReplaceBoolean(true); |
break; |
} |
- case IrOpcode::kReferenceEqual: |
- return ReduceReferenceEqual(node); |
default: |
break; |
} |
return NoChange(); |
} |
-Reduction SimplifiedOperatorReducer::ReduceReferenceEqual(Node* node) { |
- DCHECK_EQ(IrOpcode::kReferenceEqual, node->opcode()); |
- Node* const left = NodeProperties::GetValueInput(node, 0); |
- Node* const right = NodeProperties::GetValueInput(node, 1); |
- HeapObjectMatcher match_left(left); |
- HeapObjectMatcher match_right(right); |
- if (match_left.HasValue() && match_right.HasValue()) { |
- if (match_left.Value().is_identical_to(match_right.Value())) { |
- return Replace(jsgraph()->TrueConstant()); |
- } else { |
- return Replace(jsgraph()->FalseConstant()); |
- } |
- } |
- return NoChange(); |
-} |
- |
Reduction SimplifiedOperatorReducer::Change(Node* node, const Operator* op, |
Node* a) { |
DCHECK_EQ(node->InputCount(), OperatorProperties::GetTotalInputCount(op)); |