Index: src/compiler/representation-change.h |
diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h |
index e4c257f2ea4bbef34adae3fec268785d5a892c27..8720afdde3ff8938e46ed2f1ab19a647e591e3da 100644 |
--- a/src/compiler/representation-change.h |
+++ b/src/compiler/representation-change.h |
@@ -296,6 +296,13 @@ class RepresentationChanger { |
if (value == 0 || value == 1) return node; |
return jsgraph()->Int32Constant(1); // value != 0 |
} |
+ case IrOpcode::kNumberConstant: { |
+ double value = OpParameter<double>(node); |
+ if (std::isnan(value) || value == 0.0) { |
+ return jsgraph()->Int32Constant(0); |
+ } |
+ return jsgraph()->Int32Constant(1); |
+ } |
case IrOpcode::kHeapConstant: { |
Handle<Object> handle = OpParameter<Unique<Object> >(node).handle(); |
DCHECK(*handle == isolate()->heap()->true_value() || |