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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); | 1034 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit); |
1035 if (lower()) { | 1035 if (lower()) { |
1036 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); | 1036 NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); |
1037 } | 1037 } |
1038 break; | 1038 break; |
1039 } | 1039 } |
1040 case IrOpcode::kStringEqual: { | 1040 case IrOpcode::kStringEqual: { |
1041 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 1041 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
1042 if (lower()) { | 1042 if (lower()) { |
1043 // StringEqual(x, y) => Call(StringEqualStub, x, y, no-context) | 1043 // StringEqual(x, y) => Call(StringEqualStub, x, y, no-context) |
1044 Operator::Properties properties = node->op()->properties(); | 1044 Operator::Properties properties = |
| 1045 Operator::kCommutative | Operator::kNoThrow; |
1045 Callable callable = CodeFactory::StringEqual(jsgraph_->isolate()); | 1046 Callable callable = CodeFactory::StringEqual(jsgraph_->isolate()); |
1046 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 1047 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
1047 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1048 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1048 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 1049 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
1049 flags, properties); | 1050 flags, properties); |
1050 node->InsertInput(jsgraph_->zone(), 0, | 1051 node->InsertInput(jsgraph_->zone(), 0, |
1051 jsgraph_->HeapConstant(callable.code())); | 1052 jsgraph_->HeapConstant(callable.code())); |
1052 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); | 1053 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); |
| 1054 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
| 1055 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
1053 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); | 1056 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
1054 } | 1057 } |
1055 break; | 1058 break; |
1056 } | 1059 } |
1057 case IrOpcode::kStringLessThan: { | 1060 case IrOpcode::kStringLessThan: { |
1058 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 1061 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
1059 if (lower()) { | 1062 if (lower()) { |
1060 // StringLessThan(x, y) => Call(StringLessThanStub, x, y, no-context) | 1063 // StringLessThan(x, y) => Call(StringLessThanStub, x, y, no-context) |
1061 Operator::Properties properties = node->op()->properties(); | 1064 Operator::Properties properties = Operator::kNoThrow; |
1062 Callable callable = CodeFactory::StringLessThan(jsgraph_->isolate()); | 1065 Callable callable = CodeFactory::StringLessThan(jsgraph_->isolate()); |
1063 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 1066 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
1064 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1067 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1065 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 1068 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
1066 flags, properties); | 1069 flags, properties); |
1067 node->InsertInput(jsgraph_->zone(), 0, | 1070 node->InsertInput(jsgraph_->zone(), 0, |
1068 jsgraph_->HeapConstant(callable.code())); | 1071 jsgraph_->HeapConstant(callable.code())); |
1069 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); | 1072 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); |
| 1073 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
| 1074 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
1070 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); | 1075 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
1071 } | 1076 } |
1072 break; | 1077 break; |
1073 } | 1078 } |
1074 case IrOpcode::kStringLessThanOrEqual: { | 1079 case IrOpcode::kStringLessThanOrEqual: { |
1075 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 1080 VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
1076 if (lower()) { | 1081 if (lower()) { |
1077 // StringLessThanOrEqual(x, y) | 1082 // StringLessThanOrEqual(x, y) |
1078 // => Call(StringLessThanOrEqualStub, x, y, no-context) | 1083 // => Call(StringLessThanOrEqualStub, x, y, no-context) |
1079 Operator::Properties properties = node->op()->properties(); | 1084 Operator::Properties properties = Operator::kNoThrow; |
1080 Callable callable = | 1085 Callable callable = |
1081 CodeFactory::StringLessThanOrEqual(jsgraph_->isolate()); | 1086 CodeFactory::StringLessThanOrEqual(jsgraph_->isolate()); |
1082 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 1087 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
1083 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1088 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1084 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 1089 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
1085 flags, properties); | 1090 flags, properties); |
1086 node->InsertInput(jsgraph_->zone(), 0, | 1091 node->InsertInput(jsgraph_->zone(), 0, |
1087 jsgraph_->HeapConstant(callable.code())); | 1092 jsgraph_->HeapConstant(callable.code())); |
1088 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); | 1093 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); |
| 1094 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
| 1095 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
1089 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); | 1096 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
1090 } | 1097 } |
1091 break; | 1098 break; |
1092 } | 1099 } |
1093 case IrOpcode::kStringToNumber: { | 1100 case IrOpcode::kStringToNumber: { |
1094 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); | 1101 VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged); |
1095 if (lower()) { | 1102 if (lower()) { |
1096 // StringToNumber(x) => Call(StringToNumberStub, x, no-context) | 1103 // StringToNumber(x) => Call(StringToNumberStub, x, no-context) |
1097 Operator::Properties properties = node->op()->properties(); | 1104 Operator::Properties properties = Operator::kNoThrow; |
1098 Callable callable = CodeFactory::StringToNumber(jsgraph_->isolate()); | 1105 Callable callable = CodeFactory::StringToNumber(jsgraph_->isolate()); |
1099 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; | 1106 CallDescriptor::Flags flags = CallDescriptor::kNoFlags; |
1100 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1107 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1101 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, | 1108 jsgraph_->isolate(), jsgraph_->zone(), callable.descriptor(), 0, |
1102 flags, properties); | 1109 flags, properties); |
1103 node->InsertInput(jsgraph_->zone(), 0, | 1110 node->InsertInput(jsgraph_->zone(), 0, |
1104 jsgraph_->HeapConstant(callable.code())); | 1111 jsgraph_->HeapConstant(callable.code())); |
1105 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); | 1112 node->AppendInput(jsgraph_->zone(), jsgraph_->NoContextConstant()); |
| 1113 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
| 1114 node->AppendInput(jsgraph_->zone(), jsgraph_->graph()->start()); |
1106 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); | 1115 NodeProperties::ChangeOp(node, jsgraph_->common()->Call(desc)); |
1107 } | 1116 } |
1108 break; | 1117 break; |
1109 } | 1118 } |
1110 case IrOpcode::kAllocate: { | 1119 case IrOpcode::kAllocate: { |
1111 ProcessInput(node, 0, UseInfo::TruncatingWord32()); | 1120 ProcessInput(node, 0, UseInfo::TruncatingWord32()); |
1112 ProcessRemainingInputs(node, 1); | 1121 ProcessRemainingInputs(node, 1); |
1113 SetOutput(node, MachineRepresentation::kTagged); | 1122 SetOutput(node, MachineRepresentation::kTagged); |
1114 break; | 1123 break; |
1115 } | 1124 } |
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2364 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 2373 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
2365 Operator::kNoProperties); | 2374 Operator::kNoProperties); |
2366 to_number_operator_.set(common()->Call(desc)); | 2375 to_number_operator_.set(common()->Call(desc)); |
2367 } | 2376 } |
2368 return to_number_operator_.get(); | 2377 return to_number_operator_.get(); |
2369 } | 2378 } |
2370 | 2379 |
2371 } // namespace compiler | 2380 } // namespace compiler |
2372 } // namespace internal | 2381 } // namespace internal |
2373 } // namespace v8 | 2382 } // namespace v8 |
OLD | NEW |