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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1070 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1071 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 1071 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
1072 flags, properties); | 1072 flags, properties); |
1073 node->InsertInput(jsgraph_->zone(), 0, | 1073 node->InsertInput(jsgraph_->zone(), 0, |
1074 jsgraph_->HeapConstant(callable.code())); | 1074 jsgraph_->HeapConstant(callable.code())); |
1075 node->InsertInput(jsgraph_->zone(), 3, jsgraph_->NoContextConstant()); | 1075 node->InsertInput(jsgraph_->zone(), 3, jsgraph_->NoContextConstant()); |
1076 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); | 1076 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
1077 } | 1077 } |
1078 break; | 1078 break; |
1079 } | 1079 } |
| 1080 case IrOpcode::kStringToNumber: { |
| 1081 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
| 1082 if (lower()) { |
| 1083 // StringToNumber(x) => Call(StringToNumberStub, x, no-context) |
| 1084 Operator::Properties properties = node->op()->properties(); |
| 1085 Callable callable = CodeFactory::StringToNumber(jsgraph_->isolate()); |
| 1086 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
| 1087 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 1088 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
| 1089 flags, properties); |
| 1090 node->InsertInput(jsgraph_->zone(), 0, |
| 1091 jsgraph_->HeapConstant(callable.code())); |
| 1092 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); |
| 1093 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
| 1094 } |
| 1095 break; |
| 1096 } |
1080 case IrOpcode::kAllocate: { | 1097 case IrOpcode::kAllocate: { |
1081 ProcessInput(node, 0, UseInfo::AnyTagged()); | 1098 ProcessInput(node, 0, UseInfo::AnyTagged()); |
1082 ProcessRemainingInputs(node, 1); | 1099 ProcessRemainingInputs(node, 1); |
1083 SetOutput(node, MachineRepresentation::kTagged); | 1100 SetOutput(node, MachineRepresentation::kTagged); |
1084 break; | 1101 break; |
1085 } | 1102 } |
1086 case IrOpcode::kLoadField: { | 1103 case IrOpcode::kLoadField: { |
1087 FieldAccess access = FieldAccessOf(node->op()); | 1104 FieldAccess access = FieldAccessOf(node->op()); |
1088 ProcessInput(node, 0, UseInfoForBasePointer(access)); | 1105 ProcessInput(node, 0, UseInfoForBasePointer(access)); |
1089 ProcessRemainingInputs(node, 1); | 1106 ProcessRemainingInputs(node, 1); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 if (!rhs_type->Is(type_cache_.kZeroToThirtyOne)) { | 1788 if (!rhs_type->Is(type_cache_.kZeroToThirtyOne)) { |
1772 node->ReplaceInput(1, graph()->NewNode(machine()->Word32And(), rhs, | 1789 node->ReplaceInput(1, graph()->NewNode(machine()->Word32And(), rhs, |
1773 jsgraph()->Int32Constant(0x1f))); | 1790 jsgraph()->Int32Constant(0x1f))); |
1774 } | 1791 } |
1775 NodeProperties::ChangeOp(node, op); | 1792 NodeProperties::ChangeOp(node, op); |
1776 } | 1793 } |
1777 | 1794 |
1778 } // namespace compiler | 1795 } // namespace compiler |
1779 } // namespace internal | 1796 } // namespace internal |
1780 } // namespace v8 | 1797 } // namespace v8 |
OLD | NEW |