Index: src/compiler/change-lowering.cc |
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc |
index 7ddc751ab53199af0e8fc501b6f7eb12215f0d3c..fd425c28850690ddf4e9156d4b09c2bc0d429eff 100644 |
--- a/src/compiler/change-lowering.cc |
+++ b/src/compiler/change-lowering.cc |
@@ -22,9 +22,13 @@ Reduction ChangeLowering::Reduce(Node* node) { |
Node* control = graph()->start(); |
switch (node->opcode()) { |
case IrOpcode::kChangeBitToBool: |
- return ChangeBitToBool(node->InputAt(0), control); |
+ return ChangeBitToBool(node->InputAt(0)); |
case IrOpcode::kChangeBoolToBit: |
return ChangeBoolToBit(node->InputAt(0)); |
+ case IrOpcode::kChangeWord32ToBit: |
+ return ChangeWord32ToBit(node->InputAt(0)); |
+ case IrOpcode::kChangeWord64ToBit: |
+ return ChangeWord64ToBit(node->InputAt(0)); |
case IrOpcode::kChangeFloat64ToTagged: |
return ChangeFloat64ToTagged(node->InputAt(0), control); |
case IrOpcode::kChangeInt32ToTagged: |
@@ -138,17 +142,35 @@ Node* ChangeLowering::Uint32LessThanOrEqual(Node* lhs, Node* rhs) { |
} |
-Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) { |
+Reduction ChangeLowering::ChangeBitToBool(Node* value) { |
MachineType const type = static_cast<MachineType>(kTypeBool | kRepTagged); |
- return Replace(graph()->NewNode(common()->Select(type), val, |
+ return Replace(graph()->NewNode(common()->Select(type), value, |
jsgraph()->TrueConstant(), |
jsgraph()->FalseConstant())); |
} |
-Reduction ChangeLowering::ChangeBoolToBit(Node* val) { |
+Reduction ChangeLowering::ChangeBoolToBit(Node* value) { |
+ return Replace(graph()->NewNode(machine()->WordEqual(), value, |
+ jsgraph()->TrueConstant())); |
+} |
+ |
+ |
+Reduction ChangeLowering::ChangeWord32ToBit(Node* value) { |
+ return Replace( |
+ graph()->NewNode(machine()->Word32Equal(), |
+ graph()->NewNode(machine()->Word32Equal(), value, |
+ jsgraph()->Int32Constant(0)), |
+ jsgraph()->Int32Constant(0))); |
+} |
+ |
+ |
+Reduction ChangeLowering::ChangeWord64ToBit(Node* value) { |
return Replace( |
- graph()->NewNode(machine()->WordEqual(), val, jsgraph()->TrueConstant())); |
+ graph()->NewNode(machine()->Word32Equal(), |
+ graph()->NewNode(machine()->Word64Equal(), value, |
+ jsgraph()->Int64Constant(0)), |
+ jsgraph()->Int32Constant(0))); |
} |