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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
6 #include "src/compiler/graph-inl.h" | 6 #include "src/compiler/graph-inl.h" |
7 #include "src/compiler/js-typed-lowering.h" | 7 #include "src/compiler/js-typed-lowering.h" |
8 #include "src/compiler/node-aux-data-inl.h" | 8 #include "src/compiler/node-aux-data-inl.h" |
9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
10 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 NodeProperties::ReplaceEffectInput(node_, effect); | 215 NodeProperties::ReplaceEffectInput(node_, effect); |
216 } | 216 } |
217 }; | 217 }; |
218 | 218 |
219 | 219 |
220 Reduction JSTypedLowering::ReduceJSAdd(Node* node) { | 220 Reduction JSTypedLowering::ReduceJSAdd(Node* node) { |
221 JSBinopReduction r(this, node); | 221 JSBinopReduction r(this, node); |
222 if (r.OneInputIs(Type::String())) { | 222 if (r.OneInputIs(Type::String())) { |
223 r.ConvertInputsToString(); | 223 r.ConvertInputsToString(); |
224 return r.ChangeToPureOperator(simplified()->StringAdd()); | 224 return r.ChangeToPureOperator(simplified()->StringAdd()); |
225 } else if (r.NeitherInputCanBe(Type::String())) { | 225 } |
| 226 if (r.NeitherInputCanBe(Type::String())) { |
226 r.ConvertInputsToNumber(); | 227 r.ConvertInputsToNumber(); |
227 return r.ChangeToPureOperator(simplified()->NumberAdd()); | 228 return r.ChangeToPureOperator(simplified()->NumberAdd()); |
228 } | 229 } |
229 return NoChange(); | 230 return NoChange(); |
230 } | 231 } |
231 | 232 |
232 | 233 |
233 Reduction JSTypedLowering::ReduceNumberBinop(Node* node, Operator* numberOp) { | 234 Reduction JSTypedLowering::ReduceNumberBinop(Node* node, Operator* numberOp) { |
234 JSBinopReduction r(this, node); | 235 JSBinopReduction r(this, node); |
235 if (r.OneInputIs(Type::Primitive())) { | 236 if (r.OneInputIs(Type::Primitive())) { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 case IrOpcode::kJSLoadProperty: | 615 case IrOpcode::kJSLoadProperty: |
615 return ReduceJSPropertyLoad(node); | 616 return ReduceJSPropertyLoad(node); |
616 default: | 617 default: |
617 break; | 618 break; |
618 } | 619 } |
619 return NoChange(); | 620 return NoChange(); |
620 } | 621 } |
621 } | 622 } |
622 } | 623 } |
623 } // namespace v8::internal::compiler | 624 } // namespace v8::internal::compiler |
OLD | NEW |