Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: src/compiler/change-lowering.cc

Issue 850013003: [turbofan] Fix truncation/representation sloppiness wrt. bool/bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes/Cleanups Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/change-lowering.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index fd425c28850690ddf4e9156d4b09c2bc0d429eff..7ddc751ab53199af0e8fc501b6f7eb12215f0d3c 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -22,13 +22,9 @@ Reduction ChangeLowering::Reduce(Node* node) {
Node* control = graph()->start();
switch (node->opcode()) {
case IrOpcode::kChangeBitToBool:
- return ChangeBitToBool(node->InputAt(0));
+ return ChangeBitToBool(node->InputAt(0), control);
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:
@@ -142,35 +138,17 @@ Node* ChangeLowering::Uint32LessThanOrEqual(Node* lhs, Node* rhs) {
}
-Reduction ChangeLowering::ChangeBitToBool(Node* value) {
+Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) {
MachineType const type = static_cast<MachineType>(kTypeBool | kRepTagged);
- return Replace(graph()->NewNode(common()->Select(type), value,
+ return Replace(graph()->NewNode(common()->Select(type), val,
jsgraph()->TrueConstant(),
jsgraph()->FalseConstant()));
}
-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) {
+Reduction ChangeLowering::ChangeBoolToBit(Node* val) {
return Replace(
- graph()->NewNode(machine()->Word32Equal(),
- graph()->NewNode(machine()->Word64Equal(), value,
- jsgraph()->Int64Constant(0)),
- jsgraph()->Int32Constant(0)));
+ graph()->NewNode(machine()->WordEqual(), val, jsgraph()->TrueConstant()));
}
« no previous file with comments | « src/compiler/change-lowering.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698