Index: src/compiler/representation-change.cc |
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc |
index 6e1341321cf2dc81ce51879b7be943810ae5000f..7002b2d9b27b6c47e43632f03afd633cc928c5b7 100644 |
--- a/src/compiler/representation-change.cc |
+++ b/src/compiler/representation-change.cc |
@@ -9,6 +9,7 @@ |
#include "src/base/bits.h" |
#include "src/code-factory.h" |
#include "src/compiler/machine-operator.h" |
+#include "src/compiler/node-matchers.h" |
namespace v8 { |
namespace internal { |
@@ -694,8 +695,12 @@ Node* RepresentationChanger::GetBitRepresentationFor( |
// Eagerly fold representation changes for constants. |
switch (node->opcode()) { |
case IrOpcode::kHeapConstant: { |
- Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); |
- return jsgraph()->Int32Constant(value->BooleanValue() ? 1 : 0); |
+ HeapObjectMatcher m(node); |
+ if (m.Is(factory()->false_value())) { |
+ return jsgraph()->Int32Constant(0); |
+ } else if (m.Is(factory()->true_value())) { |
+ return jsgraph()->Int32Constant(1); |
+ } |
} |
default: |
break; |