| 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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 SetOutput(node, 0); | 847 SetOutput(node, 0); |
| 848 if (lower()) lowering->DoStoreElement(node); | 848 if (lower()) lowering->DoStoreElement(node); |
| 849 break; | 849 break; |
| 850 } | 850 } |
| 851 case IrOpcode::kObjectIsSmi: { | 851 case IrOpcode::kObjectIsSmi: { |
| 852 ProcessInput(node, 0, kMachAnyTagged); | 852 ProcessInput(node, 0, kMachAnyTagged); |
| 853 SetOutput(node, kRepBit | kTypeBool); | 853 SetOutput(node, kRepBit | kTypeBool); |
| 854 if (lower()) { | 854 if (lower()) { |
| 855 Node* is_tagged = jsgraph_->graph()->NewNode( | 855 Node* is_tagged = jsgraph_->graph()->NewNode( |
| 856 jsgraph_->machine()->WordAnd(), node->InputAt(0), | 856 jsgraph_->machine()->WordAnd(), node->InputAt(0), |
| 857 jsgraph_->Int32Constant(static_cast<int>(kSmiTagMask))); | 857 jsgraph_->IntPtrConstant(kSmiTagMask)); |
| 858 Node* is_smi = jsgraph_->graph()->NewNode( | 858 Node* is_smi = jsgraph_->graph()->NewNode( |
| 859 jsgraph_->machine()->WordEqual(), is_tagged, | 859 jsgraph_->machine()->WordEqual(), is_tagged, |
| 860 jsgraph_->Int32Constant(kSmiTag)); | 860 jsgraph_->IntPtrConstant(kSmiTag)); |
| 861 DeferReplacement(node, is_smi); | 861 DeferReplacement(node, is_smi); |
| 862 } | 862 } |
| 863 break; | 863 break; |
| 864 } | 864 } |
| 865 case IrOpcode::kObjectIsNonNegativeSmi: { | 865 case IrOpcode::kObjectIsNonNegativeSmi: { |
| 866 ProcessInput(node, 0, kMachAnyTagged); | 866 ProcessInput(node, 0, kMachAnyTagged); |
| 867 SetOutput(node, kRepBit | kTypeBool); | 867 SetOutput(node, kRepBit | kTypeBool); |
| 868 if (lower()) { | 868 if (lower()) { |
| 869 Node* is_tagged = jsgraph_->graph()->NewNode( | 869 Node* is_tagged = jsgraph_->graph()->NewNode( |
| 870 jsgraph_->machine()->WordAnd(), node->InputAt(0), | 870 jsgraph_->machine()->WordAnd(), node->InputAt(0), |
| 871 jsgraph_->Int32Constant(static_cast<int>(kSmiTagMask))); | 871 jsgraph_->IntPtrConstant(kSmiTagMask)); |
| 872 Node* is_smi = jsgraph_->graph()->NewNode( | 872 Node* is_smi = jsgraph_->graph()->NewNode( |
| 873 jsgraph_->machine()->WordEqual(), is_tagged, | 873 jsgraph_->machine()->WordEqual(), is_tagged, |
| 874 jsgraph_->Int32Constant(kSmiTag)); | 874 jsgraph_->IntPtrConstant(kSmiTag)); |
| 875 Node* is_non_neg = jsgraph_->graph()->NewNode( | 875 Node* is_non_neg = jsgraph_->graph()->NewNode( |
| 876 jsgraph_->machine()->IntLessThanOrEqual(), | 876 jsgraph_->machine()->IntLessThanOrEqual(), |
| 877 jsgraph_->Int32Constant(0), node->InputAt(0)); | 877 jsgraph_->IntPtrConstant(0), node->InputAt(0)); |
| 878 Node* is_non_neg_smi = jsgraph_->graph()->NewNode( | 878 Node* is_non_neg_smi = jsgraph_->graph()->NewNode( |
| 879 jsgraph_->machine()->Word32And(), is_smi, is_non_neg); | 879 jsgraph_->machine()->Word32And(), is_smi, is_non_neg); |
| 880 DeferReplacement(node, is_non_neg_smi); | 880 DeferReplacement(node, is_non_neg_smi); |
| 881 } | 881 } |
| 882 break; | 882 break; |
| 883 } | 883 } |
| 884 | 884 |
| 885 //------------------------------------------------------------------ | 885 //------------------------------------------------------------------ |
| 886 // Machine-level operators. | 886 // Machine-level operators. |
| 887 //------------------------------------------------------------------ | 887 //------------------------------------------------------------------ |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 | 1512 |
| 1513 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { | 1513 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { |
| 1514 node->set_op(machine()->IntLessThanOrEqual()); | 1514 node->set_op(machine()->IntLessThanOrEqual()); |
| 1515 node->ReplaceInput(0, StringComparison(node, true)); | 1515 node->ReplaceInput(0, StringComparison(node, true)); |
| 1516 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1516 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 } // namespace compiler | 1519 } // namespace compiler |
| 1520 } // namespace internal | 1520 } // namespace internal |
| 1521 } // namespace v8 | 1521 } // namespace v8 |
| OLD | NEW |