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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 stringOp = simplified()->StringLessThanOrEqual(); | 296 stringOp = simplified()->StringLessThanOrEqual(); |
297 break; | 297 break; |
298 case IrOpcode::kJSGreaterThanOrEqual: | 298 case IrOpcode::kJSGreaterThanOrEqual: |
299 stringOp = simplified()->StringLessThanOrEqual(); | 299 stringOp = simplified()->StringLessThanOrEqual(); |
300 r.SwapInputs(); // a >= b => b <= a | 300 r.SwapInputs(); // a >= b => b <= a |
301 break; | 301 break; |
302 default: | 302 default: |
303 return NoChange(); | 303 return NoChange(); |
304 } | 304 } |
305 return r.ChangeToPureOperator(stringOp); | 305 return r.ChangeToPureOperator(stringOp); |
306 } else if (r.OneInputCannotBe(Type::String())) { | 306 } |
| 307 Type* maybe_string = Type::Union(Type::String(), Type::Receiver(), zone()); |
| 308 if (r.OneInputCannotBe(maybe_string)) { |
307 // If one input cannot be a string, then emit a number comparison. | 309 // If one input cannot be a string, then emit a number comparison. |
308 const Operator* less_than; | 310 const Operator* less_than; |
309 const Operator* less_than_or_equal; | 311 const Operator* less_than_or_equal; |
310 if (r.BothInputsAre(Type::Unsigned32())) { | 312 if (r.BothInputsAre(Type::Unsigned32())) { |
311 less_than = machine()->Uint32LessThan(); | 313 less_than = machine()->Uint32LessThan(); |
312 less_than_or_equal = machine()->Uint32LessThanOrEqual(); | 314 less_than_or_equal = machine()->Uint32LessThanOrEqual(); |
313 } else if (r.BothInputsAre(Type::Signed32())) { | 315 } else if (r.BothInputsAre(Type::Signed32())) { |
314 less_than = machine()->Int32LessThan(); | 316 less_than = machine()->Int32LessThan(); |
315 less_than_or_equal = machine()->Int32LessThanOrEqual(); | 317 less_than_or_equal = machine()->Int32LessThanOrEqual(); |
316 } else { | 318 } else { |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 return ReduceJSStoreProperty(node); | 670 return ReduceJSStoreProperty(node); |
669 default: | 671 default: |
670 break; | 672 break; |
671 } | 673 } |
672 return NoChange(); | 674 return NoChange(); |
673 } | 675 } |
674 | 676 |
675 } // namespace compiler | 677 } // namespace compiler |
676 } // namespace internal | 678 } // namespace internal |
677 } // namespace v8 | 679 } // namespace v8 |
OLD | NEW |