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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // TODO(turbofan): avoid a truncation with a smi check. | 769 // TODO(turbofan): avoid a truncation with a smi check. |
770 VisitUnop(node, kTypeUint32 | kRepFloat64, kTypeUint32 | kRepWord32); | 770 VisitUnop(node, kTypeUint32 | kRepFloat64, kTypeUint32 | kRepWord32); |
771 if (lower()) { | 771 if (lower()) { |
772 NodeProperties::ChangeOp( | 772 NodeProperties::ChangeOp( |
773 node, lowering->machine()->TruncateFloat64ToInt32( | 773 node, lowering->machine()->TruncateFloat64ToInt32( |
774 TruncationMode::kJavaScript)); | 774 TruncationMode::kJavaScript)); |
775 } | 775 } |
776 } | 776 } |
777 break; | 777 break; |
778 } | 778 } |
| 779 case IrOpcode::kNumberIsHoleNaN: { |
| 780 VisitUnop(node, kMachFloat64, kMachBool); |
| 781 if (lower()) { |
| 782 // NumberIsHoleNaN(x) => Word32Equal(Float64ExtractLowWord32(x), |
| 783 // #HoleNaNLower32) |
| 784 node->ReplaceInput(0, |
| 785 jsgraph_->graph()->NewNode( |
| 786 lowering->machine()->Float64ExtractLowWord32(), |
| 787 node->InputAt(0))); |
| 788 node->AppendInput(jsgraph_->zone(), |
| 789 jsgraph_->Int32Constant(kHoleNanLower32)); |
| 790 NodeProperties::ChangeOp(node, jsgraph_->machine()->Word32Equal()); |
| 791 } |
| 792 break; |
| 793 } |
779 case IrOpcode::kPlainPrimitiveToNumber: { | 794 case IrOpcode::kPlainPrimitiveToNumber: { |
780 VisitUnop(node, kMachAnyTagged, kTypeNumber | kRepTagged); | 795 VisitUnop(node, kMachAnyTagged, kTypeNumber | kRepTagged); |
781 if (lower()) { | 796 if (lower()) { |
782 // PlainPrimitiveToNumber(x) => Call(ToNumberStub, x, no-context) | 797 // PlainPrimitiveToNumber(x) => Call(ToNumberStub, x, no-context) |
783 Operator::Properties properties = node->op()->properties(); | 798 Operator::Properties properties = node->op()->properties(); |
784 Callable callable = CodeFactory::ToNumber(jsgraph_->isolate()); | 799 Callable callable = CodeFactory::ToNumber(jsgraph_->isolate()); |
785 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 800 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
786 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 801 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
787 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 802 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
788 flags, properties); | 803 flags, properties); |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 ReplaceEffectUses(node, comparison); | 1569 ReplaceEffectUses(node, comparison); |
1555 node->ReplaceInput(0, comparison); | 1570 node->ReplaceInput(0, comparison); |
1556 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); | 1571 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); |
1557 node->TrimInputCount(2); | 1572 node->TrimInputCount(2); |
1558 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); | 1573 NodeProperties::ChangeOp(node, machine()->IntLessThanOrEqual()); |
1559 } | 1574 } |
1560 | 1575 |
1561 } // namespace compiler | 1576 } // namespace compiler |
1562 } // namespace internal | 1577 } // namespace internal |
1563 } // namespace v8 | 1578 } // namespace v8 |
OLD | NEW |