Index: src/compiler/simplified-operator-reducer.cc |
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc |
index f27741c2ca31d6bd4edb4134d2148eedc6ba7031..dda29ef6a8c6e07da3769a0380f831065f43a16c 100644 |
--- a/src/compiler/simplified-operator-reducer.cc |
+++ b/src/compiler/simplified-operator-reducer.cc |
@@ -110,6 +110,14 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) { |
} |
break; |
} |
+ case IrOpcode::kObjectIsSmi: { |
+ NumberMatcher m(node->InputAt(0)); |
+ if (m.HasValue()) return ReplaceBoolean(IsSmiDouble(m.Value())); |
+ if (m.IsChangeBitToTagged()) return ReplaceBoolean(false); |
+ if (m.IsChangeInt31ToTaggedSigned()) return ReplaceBoolean(true); |
+ if (m.IsHeapConstant()) return ReplaceBoolean(false); |
+ break; |
+ } |
case IrOpcode::kNumberCeil: |
case IrOpcode::kNumberFloor: |
case IrOpcode::kNumberRound: |
@@ -165,6 +173,9 @@ Reduction SimplifiedOperatorReducer::Change(Node* node, const Operator* op, |
return Changed(node); |
} |
+Reduction SimplifiedOperatorReducer::ReplaceBoolean(bool value) { |
+ return Replace(jsgraph()->BooleanConstant(value)); |
+} |
Reduction SimplifiedOperatorReducer::ReplaceFloat64(double value) { |
return Replace(jsgraph()->Float64Constant(value)); |