OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 VisitInputs(node); | 449 VisitInputs(node); |
450 return SetOutput(node, kRepTagged); | 450 return SetOutput(node, kRepTagged); |
451 | 451 |
452 //------------------------------------------------------------------ | 452 //------------------------------------------------------------------ |
453 // Simplified operators. | 453 // Simplified operators. |
454 //------------------------------------------------------------------ | 454 //------------------------------------------------------------------ |
455 case IrOpcode::kBooleanNot: { | 455 case IrOpcode::kBooleanNot: { |
456 if (lower()) { | 456 if (lower()) { |
457 MachineTypeUnion input = GetInfo(node->InputAt(0))->output; | 457 MachineTypeUnion input = GetInfo(node->InputAt(0))->output; |
458 if (input & kRepBit) { | 458 if (input & kRepBit) { |
459 // BooleanNot(x: kRepBit) => WordEqual(x, #0) | 459 // BooleanNot(x: kRepBit) => Word32Equal(x, #0) |
460 node->set_op(lowering->machine()->WordEqual()); | 460 node->set_op(lowering->machine()->Word32Equal()); |
461 node->AppendInput(jsgraph_->zone(), jsgraph_->Int32Constant(0)); | 461 node->AppendInput(jsgraph_->zone(), jsgraph_->Int32Constant(0)); |
462 } else { | 462 } else { |
463 // BooleanNot(x: kRepTagged) => WordEqual(x, #false) | 463 // BooleanNot(x: kRepTagged) => WordEqual(x, #false) |
464 node->set_op(lowering->machine()->WordEqual()); | 464 node->set_op(lowering->machine()->WordEqual()); |
465 node->AppendInput(jsgraph_->zone(), jsgraph_->FalseConstant()); | 465 node->AppendInput(jsgraph_->zone(), jsgraph_->FalseConstant()); |
466 } | 466 } |
467 } else { | 467 } else { |
468 // No input representation requirement; adapt during lowering. | 468 // No input representation requirement; adapt during lowering. |
469 ProcessInput(node, 0, kTypeBool); | 469 ProcessInput(node, 0, kTypeBool); |
470 SetOutput(node, kRepBit); | 470 SetOutput(node, kRepBit); |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1168 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
1169 node->set_op(machine()->IntLessThanOrEqual()); | 1169 node->set_op(machine()->IntLessThanOrEqual()); |
1170 node->ReplaceInput(0, StringComparison(node, true)); | 1170 node->ReplaceInput(0, StringComparison(node, true)); |
1171 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1171 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1172 } | 1172 } |
1173 | 1173 |
1174 | 1174 |
1175 } // namespace compiler | 1175 } // namespace compiler |
1176 } // namespace internal | 1176 } // namespace internal |
1177 } // namespace v8 | 1177 } // namespace v8 |
OLD | NEW |